//home | tags | archives | about | grosu.nl | eulinux.org | RSS Feed

Serial console on a Raspberry Pi

floyd - Sun 25 October 2020 - raspberrypi, pi, serial, console

Tested on: Raspberry Pi 1, model A+, Raspberry Pi 1 model B

To enable a login serial console on your RaspberryPi running Alpine Linux, run:

echo "ttyAMA0::respawn:/sbin/getty -L ttyAMA0 115200 vt100" >> /etc/inittab
echo "ttyAMA0" >> /etc/securetty
lbu commit -d

A USB-to-TTL cable will be required, I've used some no-name, pl2303-based cable that came with one of my Rasbperry Pi orders. The following pins have to be connected (see the official pinout documentation ):

  • GND (usually black) to 'Ground' (3nd pin from the top)
  • RX (white?) to TXD (GPIO 14), 4th pin
  • TX (green?) to RXD (GPIO 15), 5th pin

My cable also has a 5V wire (red), that can be used to provide power to the Raspberry board via the first pin on the GPIO header, but only for the low power boards like the Zero, or the A+ (not 3A+, but the original 1A+. If your board is powered in a 'traditional' way (via the microUSB socket), DO NOT connect the 5V line, you might (and probably will) fry something.

If the board boots up successfully, you can attach to the serial console by running, e.g, screen /dev/ttyUSB0 115200 (provided that your pl2303 cable is at /dev/ttyUSB0)