By standard the UART interface is configured as serial console. If you want to use the UART interface for other things, e.g. for a GPS module, the standard function needs to be deactivated.
- Open the cmdline.txt file with the Nano text editor.
sudo nano /boot/cmdline.txt
and remove the following part from the file.
console=ttyAMA0,115200 kgdboc=ttyAMA0,115200
The content of the file should look like this
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Exit the editor with
ctrl
+x
and save the changes usingy
. - Open inittab
sudo nano /etc/inittab
and search for the following line.
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Insert a
#
at the beginning of the line to comment this line. Doing so the line should look like this.#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Exit the editor the same ways as in the previous step.
- From Kernel 3.18.x on the following step must be excecuted aditionally.
sudo nano /boot/config.txt
Search for the following line and remove the
#
at the beginning of the line.#dtparam=spi=on
Exit the editor the same ways as in the previous step.
Show kernel version
uname -a
- Restart RPI.
sudo reboot