Skip to content

How to Enable Serial Port hardware on the Raspberry Pi

Dr. Takeyuki Ueda edited this page Nov 20, 2018 · 3 revisions

By raspi-config command

The screen interface of Raspi-config command depend on it release version.

RASPBIAN STRETCH 2018-06-27 Release:

By editing /boot/config.txt file

Add the line enable_uart=1 to the end of /boot/config.txt file as follows:

# Uncomment this to enable the lirc-rpi module

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)

# ↓↓↓↓↓ Add this line ↓↓↓↓↓

Then, reboot to enable this setting as follows:

sudo reboot

Following shell script add the line to end of /boot/config.txt file and ask "Would you like to reboot now?". Actually, this is bottom half of script.

sudo sed -i "s/^enable_uart=.*/enable_uart=1/" /boot/config.txt
read -p "Would you like to reboot now?  (y/n) :" YN
if [ "${YN}" = "y" ]; then
  sudo reboot
  exit 1;
You can’t perform that action at this time.