brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: enable_uart=1 gives a headless Raspberry Pi a serial console

Setup and devices
~/tips/tip-raspberry-pi-enable-uart-serial-console

enable_uart=1

Turns on the serial console on the GPIO pins, so you can see boot messages without a monitor or network.

A Pi without a monitor that does not show up on the network is the most annoying kind of broken. The serial console is my answer to that: boot messages and a login prompt over the GPIO pins, with no network involved.

Add this line to config.txt:

enable_uart=1

The docs say it works together with console=serial0,115200 in cmdline.txt. The kernel then creates a serial console on GPIO 14 and 15, which are pins 8 and 10 on the 40-pin header. Edit cmdline.txt and remove the word quiet if you also want the kernel boot messages to appear there.

The 115200 in that kernel option is the baud rate, so set the terminal program on the other computer to the same speed.

A few caveats from the interface docs:

  • On a Raspberry Pi 5 the primary UART is the dedicated three-pin debug header by default. With enable_uart=1 and no cable on that header, kernel debug output goes to GPIO 14 and 15 instead.
  • When the mini UART is the primary UART, enable_uart=1 fixes the core clock at 250 MHz, or at the turbo frequency if that is forced. A variable core clock would otherwise disable the mini UART.
  • The default is 0 when the mini UART is primary and 1 when a PL011 UART is primary, so on some models the line changes nothing.

Like every config.txt change, it only takes effect after a reboot.

Further reading: config.txt boot options, UART configuration

More Setup and devices tips sudo rpi-imager --cli --sha256 <hash> raspios.img.xz /dev/sdb sudo smartctl -l sataphy /dev/sda rpicam-still --timeout 30000 --timelapse 2000 -o timelapse/image%04d.jpg sudo smartctl -n standby -H /dev/sdb sudo smartctl -l scterc /dev/sda All Setup and devices tips (9) All topics

Link