Question 8.7: You want to use the serial port (Rx and Tx pins) on the Rasp......

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.

Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

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.

Related Answered Questions

Question: 8.16

Verified Answer:

The PiFace Digital (“Modules” on page 381) is an e...
Question: 8.15

Verified Answer:

Use a boost regulator module (Figure 8-10). The mo...
Question: 8.14

Verified Answer:

A typical project using a Raspberry Pi requires 5V...
Question: 8.11

Verified Answer:

Use a Pi Cobbler, a device consisting of a small p...
Question: 8.9

Verified Answer:

Install Minicom: $ sudo apt-get install minicom...
Question: 8.21

Verified Answer:

You can use the paddle terminal breakout board sho...
Question: 8.20

Verified Answer:

The Pi Plate (Figure 8-16) is a prototyping board ...
Question: 8.19

Verified Answer:

The Humble Pi (Figure 8-15) is a prototyping board...
Question: 8.17

Verified Answer:

Figure 8-13 shows a Gertboard attached to a Raspbe...