Raspberry Pi serial console


by Drew Fustini via Element 14 Community Blog

The serial console is a convenient way to interact with the Raspberry Pi when a display isn't handy. From the pinout on the eLinux wiki, I can see that the serial port (aka UART) on the Pi is on GPIO Pin 14 (TX) and GPIO Pin 15 (RX):



This serial port can be connected to your computer via a USB to serial adapter. However, these pins are designed for 3.3V (e.g. 3V3), so some USB to serial adapters may damage the Pi. The simplest option is to use a 3.3V adapter such as:

FTDI TTL-232R-3V3 cable 
SparkFun 3.3V Basic FTDI Breakout board

Another option is to use a logic level converter (e.g. level shifter). This will prevent a higher voltage adapter from damaging the Pi's 3.3V pins. I already had a 5V FTDI cable (TTL-232R-5V) and a SparkFun converter board, so I went this route:



Here is the pinout for my TTL-232R-5V cable (datasheet):





Note: TXD (transmit) on the Pi needs to talk to RXD (receive) on FTDI cable, and TXD on the FTDI needs to talk to RXD on the Pi. Otherwise, it would just be a straight-through connection, and communication wouldn't be possible.

Once wired up, power on the Pi and plug the FTDI cable into the PC. Finally, a terminal emulator application will be needed to connect to the Pi. I run Ubuntu Linux and already had gtkterminstalled. The program screen is another option for Linux and Mac (OS X). On Windows, HyperTerm or TeraTerm should work. The eLinux wiki has additional information.
In gtkterm, I selected Configuration->Port and set the Port to /dev/ttyUSB0 and Baud to 115200. The rest of the defaults are ok (8 bits, stopbits 1, flow control and parity: none). After clicking OK, I pressed the Enter key a few times and the Pi prompted for username. I was able to log in and then use the shell as I normally would. Here is the utility top running:



Finally, FTDI has created a cable specifically for the Raspberry Pi: TTL-232R-RPi. It is available from the UK-based FTDI web shop, but I've not seen it stocked yet by any distributors I'm famil
iar with.