You want to use the serial port (Rx and Tx pins) on the Raspberry Pi for your own projects, but it is in use by Linux as a console connection.
By default, the serial port acts as a console, through which you can connect to the Raspberry Pi using a special serial lead (see Recipe 2.6).
To disable this so that you can use the serial port to connect to peripherals such as GPS (Recipe 11.10), comment out a line in /etc/inittab:
$ sudo nano /etc/inittab |
Scroll down to the end of the file to find the line:
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100 |
Comment it out by placing a # in front of it:
#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100 |
Save the file with Ctrl-X followed by Y.
For the changes to take effect, you need to reboot your Raspberry Pi with sudo reboot.
Discussion
One effect of making this change is that you will no longer be able to connect to the Raspberry Pi with a serial console cable. However, it will not affect WiFi or Ethernet connections.
If, in the future, you want to reverse this operation, then just change the files back to how they were and reboot.
See Also
You will need to use this technique in recipes that connect hardware to the serial port, such as Recipe 11.10 and many of the recipes in Chapter 14 that communicate with an Arduino using the serial port.