Turning off the UART functioning as a serial console

UPDATE – You can now disable serial via the GUI so the below will be redundant for many users
 

(This is based on Clayton Smiths nifty guide).

Backup the /boot/cmdline.txt file before you edit it just in case of screw-ups:

sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt

Edit the file:

sudo nano /boot/cmdline.txt

Running "2014-09-09-wheezy-raspbian.img" the file contained the following:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Delete any parameters involving the serial port "ttyAMA0" or "serial0", which in this example is:

console=ttyAMA0,115200

Which gives:

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Press CTRL+X to exit and save .

You also need to edit this file <<This is no longer present with Raspbian Jessie:


sudo nano /etc/inittab

Search for the serial port usage by using CTRL+W and typing:

ttyAMA0

This should find the line of the file specifying the serial port (if there is one).  Use "#" at the start of the line to comment it out.  Then press CTRL+X to save and exit.

Enter "sudo reboot" to restart the pi and now the UART will be available for another process to use it, or the pins can simply be used as general IO.





USEFUL?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.

Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.