{"id":977,"date":"2013-08-21T20:24:15","date_gmt":"2013-08-21T20:24:15","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=977"},"modified":"2019-02-06T20:28:18","modified_gmt":"2019-02-06T20:28:18","slug":"uart-pins","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/pi-operating-systems\/raspbian\/io-pins-raspbian\/uart-pins","title":{"rendered":"UART Pins"},"content":{"rendered":"<h4>Turning off the UART\u00a0functioning as a serial\u00a0console<\/h4>\n<p><span style=\"color: #ff8c00;\"><strong><em>UPDATE &#8211;\u00a0You can now disable serial via the GUI or command line raspi-config tool.\u00a0 The below is no longer good for Raspbian Jessie and above, it doesn&#8217;t work<\/em><\/strong><\/span><br \/>\n(This is based on <a href=\"http:\/\/www.irrational.net\/2012\/04\/19\/using-the-raspberry-pis-serial-port\/\" target=\"_blank\" rel=\"noopener\">Clayton Smiths<\/a> nifty guide).<\/p>\n<p>Backup the \/boot\/cmdline.txt file before you edit it just in case of screw-ups:<\/p>\n<pre><code>sudo cp \/boot\/cmdline.txt \/boot\/cmdline_backup.txt<\/code><\/pre>\n<p>Edit the file:<\/p>\n<pre><code>sudo nano \/boot\/cmdline.txt<\/code><\/pre>\n<p>Running &#8220;2014-09-09-wheezy-raspbian.img&#8221; the file contained the following:<\/p>\n<pre><code>dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=\/dev\/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait<\/code><\/pre>\n<p>Delete any parameters involving the serial port &#8220;ttyAMA0&#8221; or &#8220;serial0&#8221;, which in this example is:<\/p>\n<pre><code>console=ttyAMA0,115200<\/code><\/pre>\n<p>Which gives:<\/p>\n<pre><code>dwc_otg.lpm_enable=0 console=tty1 root=\/dev\/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait<\/code><\/pre>\n<p>Press CTRL+X\u00a0to exit and save .<\/p>\n<p><span style=\"color: #a9a9a9;\">You also need to edit this file &lt;&lt;This is no longer present with Raspbian Jessie:<\/span><\/p>\n<pre><span style=\"color: #a9a9a9;\"><code>\nsudo nano \/etc\/inittab\n<\/code><\/span><\/pre>\n<p><span style=\"color: #a9a9a9;\">Search for the serial port usage by using CTRL+W and typing:<\/span><\/p>\n<pre><span style=\"color: #a9a9a9;\"><code>ttyAMA0<\/code><\/span><\/pre>\n<p><span style=\"color: #a9a9a9;\">This should find the line of the file specifying the serial port (if there is one). \u00a0Use &#8220;#&#8221; at the start of the line to comment it out. \u00a0Then press CTRL+X\u00a0to save and exit.<\/span><\/p>\n<p>Enter &#8220;sudo reboot&#8221; 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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Turning off the UART\u00a0functioning as a serial\u00a0console UPDATE &#8211;\u00a0You can now disable serial via the GUI or command line raspi-config tool.\u00a0 The below is no longer good for Raspbian Jessie and above, it doesn&#8217;t work (This is based on Clayton Smiths nifty guide). Backup the \/boot\/cmdline.txt file before you edit it just in case of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[],"class_list":["post-977","post","type-post","status-publish","format-standard","hentry","category-io-pins-raspbian"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/977","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=977"}],"version-history":[{"count":11,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/977\/revisions"}],"predecessor-version":[{"id":3004,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/977\/revisions\/3004"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}