0

I've currently got a headless Raspberry Pi set up to play music. In my previous home I had an ethernet connection, and everything was fine and dandy. Then I moved, and now I have to work over WiFi. The WiFi adapter I had laying around is old and seems to eat an insane amount of power, so I have to plug it into a USB-hub with an external power supply. Considering that my speakers were probably also quite energy-hungry, I also plugged those into the hub.

So, setup now: Raspberry Pi with

  • USB-stick with music
  • USB hub with external power supply, physically 7 ports, internally 2*4.
    • power-hungry WiFi adapter
    • power-hungry speakers

Everything works fine until a reboot happens. The Pi won't recognize the WiFi adapter, nor the speakers, nor the 2nd internal 4-port hub of the USB-hub. To make everything work again I have to:

  1. Pull all power
  2. Plug in the Pi
  3. Wait about five seconds
  4. Plug in the adapter of the hub

When done correctly everything works, even with the "wait for network on boot" option turned on.

While I wait for a newer and (hopefully) less power-hungry WiFi adapter, is there any way to resolve this situation? Is this a shortcoming in the USB-hub, or one in the Pi? If in the hub, can I work around it with software? (Adding an SSR would help of course, but that seems like a bit overkill for a temporary problem.) If the shortcoming is in the Pi, how can I fix this?

Related to but not a duplicate of:

  1. USB not recognized on startup or boot - only pulling and replug in
  2. USB hub not working after boot

2 Answers 2

0

To anybody running into this problem: try a different usb hub. I'm currently using a simpler usb hub, and the problem is gone.

0

I managed to solve this by unbinding and rebinding the USB hub via a crontab @reboot entry.

I created a script named ~/rebind-usb.sh and chmod +x ~/rebind-usb.sh with the following content

echo 'rebinding USB hub'
echo '1-1:1.0' | tee /sys/bus/usb/drivers/hub/unbind
echo '1-1:1.0' | tee /sys/bus/usb/drivers/hub/bind

and the following entry in crontab

@reboot ~/rebind-usb.sh > ~/rebind-usb.log 2>&1

I found the 1-1:1.0 identifier by searching around in the /sys/bus/usb/drivers/hub/ directory and guessing which one it could be, since lsusb and usb-devices didn't give me that information.

In my case it was relatively easy to find because it was a hub attached to a Raspberry Pi Zero, which only has the root hub and the one attached to it, and the root hub only contained one port while the other one 4:

~ ls /sys/bus/usb/drivers/hub/
1-0:1.0  1-1:1.0  module  bind  new_id  remove_id  uevent  unbind

~ ls /sys/bus/usb/drivers/hub/1-0:1.0 (root hub)
contains only 1 port usb1-port1 among other things.

~ ls /sys/bus/usb/drivers/hub/1-1:1.0 (problematic hub)
contains 4 ports 1-1-port1, 1-1-port2, 1-1-port3 and 1-1-port4 among other things.

This USB hub has an integrated NIC, and after rebinding it starts working as expected, the same with the attached SSD. One odd thing: When I had a keyboard attached to it then it would function properly after a reboot without rebinding.

It's a EHUB01 | Unet | USB-C Hub ( 4 in 1 ) | USB 3.0 hub recognized as a Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub which contains the Bus 001 Device 006: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter NIC.

If anyone knows how to find these ID's reliably, please leave a comment.

PS: This is with Ubuntu 22.04 LTS server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.