Not all USB hubs are created equal! Take these two for instance:
They really look the same. I've chosen two with different case colours, but they are available in either. Testing with one is great, testing with the other is very confusing. On Linux,
lsusb gives all kinds of weird behaviors:
A closer inspection of
dmesg gives things like:
device descriptor read/64, error -71
device descriptor read/all, error -32
usb 1-1-port2: unable to enumerate USB device
Some people experience errors like this when they don't supply enough power to their USB hub, so make sure that this isn't an issue. If you need, you can edit
/boot/config.txt to include
max_usb_current=1, but if you are only drawing small amounts of power and are certain this is not the case, read on. If you ARE drawing large amounts of power, familiarise yourself with the USB standards regrading USB current output.
With THAT out of the way, let's look at these a bit more closely:
Weird, it looks like a whole chip is missing from the faulty USB hub!
It turns out that the bad USB hub simply connects all the devices in parallel! For power and ground, this is fine, and if you are only using the hub as a breakout for charging, then you don't need to worry about it. But connecting D+/D- lines in parallel turns out to be enough to confuse the USB software enough to give nonsensical errors.
To avoid this yourself when you're buying hubs from eBay, try to spend around $4 AUD (2018) per hub. More than this is probably a rip-off, less (~$1) and you might be looking at one of the "streamlined" models.
I hope this guide helps someone, one day. I'll never get the time I lost debugging back, but maybe someone else can keep a few extra hairs on their head.