Hardware Reference
In-Depth Information
Then select “Serial port setup.” You need to change three settings for Minicom to be able to talk with the
Raspberry Pi.
Change the “Serial Device” to be whatever your serial port is on your client PC.
Then set the speed of the port. The Raspberry Pi's UART runs at 115200 like most ARM devices.
Ensure that you turn off hardware and software flow control.
When you're done, press Enter and then select “Exit.”
This will exit the setup and drop you back into Minicom's main screen. Press Enter on the client PC. Nothing
happened? No surprise, was it? Reboot your Raspberry Pi. You will now see your boot messages coming in over the
serial console if your circuit is working. You will notice that there is no login prompt. If your circuit works, it should
look something like Figure 9-9 with no login prompt.
Figure 9-9. Working console with no login prompt
What's going on? It's working but you can't log in. There is a good answer behind this. First log in via SSH and
take a look at /boot/cmdline.txt . You will see the following line as part of the file:
console=ttyAMA0,115200 kgdboc=ttyAMA0,115200
What this means is that Linux should redirect all boot and kernel debug messages to the ttyAMA0 device. This
is why you see boot and shutdown messages on your serial console. This has nothing to do with a login prompt also
known as a getty process. Fedora manages the gettys; remember in Chapter 2 where I reduced the amount of running
tty processes? Well, the serial console is no different; you must start a getty on that device in order to be able to log
in via the serial port. Because most people no longer log in to a serial console as their main working environment,
Fedora by default won't start a getty process on a serial line. If you are logged in to your Raspberry Pi via SSH you can
start a getty with this command:
/sbin/agetty 115200 ttyAMA0 vt102 &
You will now see a login prompt on your serial console on your client machine. Log in via serial: it's all working.
Now log out. What happened to the login prompt? It's gone! It's gone because you spawned a single getty process
without initial system management. What happens when you log in is that the getty process will be replaced by your
running shell; the getty process no longer exists. This is why when you log off you have no getty process to greet you.
In order to have a getty respawn it must be managed by the system's init process.
In Fedora you need to create a file in /etc/init/ for this to work. I have called this file pitty.conf , which is short
for a “pi tty config” file. Take a look at the contents of this file in Listing 9-1.
Listing 9-1. The Contents of pitty.conf
# ttyAMA0 - getty
#
# Author : Brendan Horan
# Start and maintain a getty on ttyAMA0
 
Search WWH ::




Custom Search