I have an issue where RPi Pico which I’m using as a fan/adxl controller suddenly won’t connect when I restart the main RPi board.
Both Spider and Pico are connected to RPi 4B via USB, and they were happily working for half a year. Couple of weeks ago, I’ve run an update of everything (RPi system packages, Klipper, Mainsail, Moonraker, and the mcu code for both Spider and Pico). I’ve got no immediate issues after the update. I was able to start the print. However, halfway through the print, I’ve lost WiFi connection to the printer - however, it was still printing and eventually the (quite large) print finished successfully.
I have found out that what helps is to reconnect USB cable only after RPi is fully running.
I’m using the following boards in my setup:
- Raspberry Pi 4B
- FYSETC Spider v1.1
- Raspberry Pico
What’s interesting is that this problem only manifests for Pico running Klipper. When I try to connect Pico without Klipper installed, I can restart the RPi and I still see the Pico connected.
I’ve done extensive debugging to find out what’s going on, but no luck so far. Let me walk you through it. First, the Pico with Klipper is not visible with lsusb after the restart. This is what dmesg contains:
[146678.328959] usb 1-1.1: USB disconnect, device number 14
[146678.643925] usb 1-1.1: new full-speed USB device number 15 using xhci_hcd
[146678.744199] usb 1-1.1: device descriptor read/64, error -32
[146678.964188] usb 1-1.1: device descriptor read/64, error -32
[146679.183932] usb 1-1.1: new full-speed USB device number 16 using xhci_hcd
[146679.284189] usb 1-1.1: device descriptor read/64, error -32
[146679.504179] usb 1-1.1: device descriptor read/64, error -32
[146679.624574] usb 1-1-port1: attempt power cycle
[146680.283924] usb 1-1.1: new full-speed USB device number 17 using xhci_hcd
[146680.284255] usb 1-1.1: Device not responding to setup address.
[146680.504158] usb 1-1.1: Device not responding to setup address.
[146680.723919] usb 1-1.1: device not accepting address 17, error -71
[146680.823926] usb 1-1.1: new full-speed USB device number 18 using xhci_hcd
[146680.824180] usb 1-1.1: Device not responding to setup address.
[146681.044208] usb 1-1.1: Device not responding to setup address.
[146681.263967] usb 1-1.1: device not accepting address 18, error -71
[146681.264563] usb 1-1-port1: unable to enumerate USB device
I did some googling, and the sugestion is that this issue is caused by inadequate power delivery or cable. Well, I have bought a pretty expensive and short cable with guaranteed 3A delivery, no luck.
So I have tried to buy an active USB hub to deliver more power (3A max) in case that the Pi wouldn’t be able to deliver it. Again, no luck - also I can’t imagine why the Pico would need anything even close to that power.
I was also curious if it helps when I power cycle the USB port using software. So I have installed uhubctl. This is how the usb hub looks like when everything is OK (see Port 1: 0103):
pi@fluiddpi:~ $ sudo uhubctl
Current status for hub 2 [1d6b:0003 Linux 5.10.103-v7l+ xhci-hcd xHCI Host Controller 0000:01:00.0, USB 3.00, 4 ports, ppps]
Port 1: 02a0 power 5gbps Rx.Detect
Port 2: 02a0 power 5gbps Rx.Detect
Port 3: 02a0 power 5gbps Rx.Detect
Port 4: 02a0 power 5gbps Rx.Detect
Current status for hub 1-1 [2109:3431 USB2.0 Hub, USB 2.10, 4 ports, ppps]
Port 1: 0103 power enable connect [1d50:614e Klipper rp2040 E6609CB2D3243128]
Port 2: 0100 power
Port 3: 0503 power highspeed enable connect [046d:0892 HD Pro Webcam C920 4E1C7DDF]
Port 4: 0100 power
Current status for hub 1 [1d6b:0002 Linux 5.10.103-v7l+ xhci-hcd xHCI Host Controller 0000:01:00.0, USB 2.00, 1 ports, ppps]
Port 1: 0503 power highspeed enable connect [2109:3431 USB2.0 Hub, USB 2.10, 4 ports, ppps]
11:37
Linux fluiddpi 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux
I can turn it off:
Current status for hub 1-1 [2109:3431 USB2.0 Hub, USB 2.10, 4 ports, ppps]
Port 1: 0000 off
And back on:
Current status for hub 1-1 [2109:3431 USB2.0 Hub, USB 2.10, 4 ports, ppps]
Port 1: 0101 power connect []
Which is exactly the state in which the port is after restart as well.
I’ve tried rolling back Klipper to the point in time when I knew everything was working, no luck. Since there was no change to the hardware, I suspect that it must be collision between updated RPi firmware and Klipper (as firmware was one of the things that the system package updade performed). But it is just a guess.
Also - I have tried several Pico boards, some of them with nothing attached to them, just Klipper installed. Still the same problem. So this is definitely not an issue with that specific board.
Is there anything else I could try to find where the problem is?