Tutorial: Enable GPIO Serial on RPi 3

Hello everyone.

[Today I found a very nice tutorial to enable UART (GPIO) serial on Raspberry Pi 3 and Pi Zero W.][1]

To summarize, here are the commands I did to enable serial (/dev/ttyS0) on my Raspberry Pi 3:

$ sudo -s
$ echo "enable_uart=1" >> /boot/config.txt
$ systemctl stop serial-getty@ttyS0.service
$ systemctl disable serial-getty@ttyS0.service
$ nano /boot/cmdline.txt #Remove console=serial0,115200

After a reboot you should be able to use /dev/ttyS0

Quick test:

$ sudo apt install screen # Install screen if you don't have it already
$ sudo screen /dev/ttyS0 # Open the port for viewing

Now you should be able to connect any other device to the Raspberry Pi using serial.
[1]: http://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/

3 Likes

Thanks for sharing this!