Did you even know the Raspberry Pi had a serial port? If you did and have tried to use it in Raspbian you’ve probably run in to some weird behavior. That’s because, by default, the serial port is tied up by the operating system so it can’t be reliably used in your projects. In this episode I show you how to configure the serial port so it can be used to make your awesome ideas reality.
All you have to do is modify two files to reclaim the serial port from Raspbian. The rest of this post shows you how.
Comment out the line near the very bottom that spawns a getty using the serial port.
#Spawn a getty on Raspberry Pi serial line
Be careful with this one as it contains the parameters sent to the kernel at startup. You need to remove any references to ttyAMA0,115200.
So you would change this:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait