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=1and 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=1fixes 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