4

I have an OTG hub like this sold for use by a reputable dealer for use with the Pi Zero.

enter image description here

However, while it shows up in lsusb as an unidentified device with ID 214b:7000:

Bus 001 Device 002: ID 214b:7000  
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Anything that's attached to it does not, including a wifi adapter (Ralink RT5370) that works fine on every other other model of Pi I have (B, B+, 2, 3).

I notice that when I plug in another USB device to the hub, what's already connected suddenly appears. The new device does not, but if I unplug it and plug it in again it does. Unfortunately, I want to use the pi headless with just the wifi adapter, and if I plug that in after boot, it causes the Zero to reboot (just like some things do with the model B and the built in USB ports).

As with the model B, I figured this is due to a voltage drop in the 5V system when there is a sudden current draw the circuitry supplying the Zero's inbuilt hub can't handle; I have tried this using 2.5 A 5V adapters sold for use with the Pi and that work well on other models, so I do not think it is insufficient supply to the Zero itself.

There's a barrel jack on the side of the hub to provide external power. However, the retailer warns this is connected to the cable as well (meaning it shouldn't be used that way if the Pi is powered normally), although this connection can be snipped easily by opening the case.

If this worked, it would mean having to provide separate power for both the Zero and the hub. I thought about wiring the barrel connector to the Pi's 5V pins to see if that circumvents the issue, but since the Zero can be backpowered via the OTG hub, I decided to try using it that way instead.

This works, and solves the issue with spontaneous rebooting [alhough this later proved inconsistent], but it does not solve the issue with anything attached to it at boot not being recognized, meaning I still have to (unplug and) plug the wifi adapter in once the pi is running to get it online. :/

Is there anything I can do here?

1 Answer 1

6

Binding and unbinding the driver for the hub itself will cause anything connected to it to be registered and appear in lsusb. Unloading and reloading the driver module itself might also work, but for that you'd have to build your own kernel, since it is built into the stock one used on Raspbian, etc. Note this driver is also needed for the Pi's build in hub (which on the Zero only has one port). I did not try this to find out.

Since the external hub itself is recognized, it should be listed in /sys/bus/usb/devices. In this case it was not hard to spot (1-1:1.0), since the only other thing there is the built in, which logically must be registered first (1-0:1.0). It can be unbound and rebound to the driver via /sys/bus/usb/drivers/hub/bind (and unbind), so I added this to /etc/rc.local:

(
        echo "1-1:1.0" > /sys/bus/usb/drivers/hub/unbind
        sleep 3
        echo "1-1:1.0" > /sys/bus/usb/drivers/hub/bind
) &

Presto, the attached wifi adapter is then available. If you have something you need to happen at that point (custom networking, etc.), this does trigger a udev "add" event, so you can add a .rules file (e.g., 50-localWifi.rules) like this to /etc/udev/rules.d:

KERNEL=="wlan*" ACTION=="add" RUN+="/full/path/to/some/command arg1 arg2"

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.