Raspberry Pi OS Broke USB Serial for Klipper

My Klipper printer has been working great for quite some time… that is, until yesterday. Suddenly Klipper was not able to connect to the MCU (Octopus V1.1) that is attached via serial-over-USB.

I’ll spare you all the troubleshooting steps that I went through — most of them ended up being unnecessary… including buying a new Octopus and digging out another Pi 4 from a different project.

I believe the problem came down to some system update that removed something related to the way USB serial devices are handled in Linux. Originally I had configured Klipper to communicate to the Octopus MCU using the /dev/serial/by-id/ path as most online guides do. The MCU section of my config looked like this.

[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_120031000350534E4E313020-if00
restart_method: command

If I recall correctly, this is the same device path that I used to flash Klipper onto the Octopus in the first place. Anyway, after my printer broke I found that the by-id directory would never appear, but I still had the /dev/serial/by-path/ directory. When I try to list out the contents of /dev/serial/, this is all I saw.

pi@fluidd0:~ $ ls -l /dev/serial/
total 0
drwxr-xr-x 2 root root 60 May 30 09:44 by-path

Ignoring the things I temporarily changed and switched back, all I needed to do was change the MCU to the by-path path instead.

To find that, open a terminal on the Klipper host and list the directory contents of the by-path directory.

pi@fluidd0:~ $ ls -l /dev/serial/by-path/
total 0
lrwxrwxrwx 1 root root 13 May 30 09:44 platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0 -> ../../ttyACM0

Then copy-paste that path into your Klipper config as shown below.

[mcu]
serial: /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0
restart_method: command

That’s really all it took. Side note: I think that the serial setting may also work by pointing it to /dev/ttyACM0. I have not tested that nor do I know which path would be the most resilient to future update changes.

Regardless, now I have a working printer again, a spare Octopus, and fresh parts for my next RC airplane. That reminds me, I should go take a fresh backup of my printer’s SD card. Bye now!