0

first experience with Raspberry pi zero, and I decided to go with the simple retropie project. I installed retropie on it without any problems, during installation my controller was connected via the USB OTG cable. It was detected and configured without any problems.

Now to install ROMS I saved them on a 8GB USB drive and connected both to the pi zero via a 4 port usb hub (which was connected via the same OTG cable). The pi zero fails to detect the hub and anything connected to it. The controller and USB drive are detected individually but not via the hub.

The hub is a simple unpowered one, I believe its a USB 2.0 one. I have also tried another hub I had lying around and experienced the same problem.

Both these hubs work fine on my laptop.

I thought maybe my power supply was inadequate which was a 0.5A android charger, so I went ahead and bout a 1.4A charger and booted via that, but still had the same problem.

I searched and found this: https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=127158

many people are having problems with this, some people suggest that you need a powered hub for this to work butr a lot of people in that thread mentioned that they were using simple cheap unpowered ones as well without any problems.

Would appreciate some help please.

my setup:

The yellow is the HDMI cable, the white cable is the power cable. and the USB hub is attached to the USB OTG cable. Anything attached to the hub is not detected.

enter image description here

  • The simple thing would be to borrow a powered hub from a friend and give it a try. – Steve Robillard Nov 13 '16 at 8:38
  • There have been other people complain about this, and yet it does not seem to be a problem for most people, which begs the question whether the people with the problem are doing something wrong. To rule that possibility out, you need to include 1) The output of lsusb with the hub attached -- you may have to apt install usbutils (or whatever equivalent) first; 2) A photograph of how the hub is connected to the Pi. – goldilocks Nov 13 '16 at 10:25
  • Hi goldilocks. I have retropie, where is the terminal or how can I enter this command without terminal? Same goes for other command? Also the pizero only has one port to which the hub is attached. I will connect the keyboard to that. Since hub is not working the keyboard via the hub will not work either? Would these commands and outputs be useful when the keyboard is directly attached to the pizero? – StuckInPhD Nov 13 '16 at 11:00
  • Good point -- you need to use the serial console to do this, for which you need something you can connect it to, and if retropie doesn't have the right tools for debugging anyway, then there is not much point. I'll reopen the question, but if you don't have a means of debugging the issue then there is not much anyone can say besides "If it doesn't work for you then it doesn't work, oh well". WRT how the hub is connected, yes the pi only has one port, the place people tend to go wrong here is assuming they can just use a microUSB cable and connect that to any port on the hub, which is wrong. – goldilocks Nov 13 '16 at 11:57
  • So if that's what you've done, leave a comment. If you aren't sure, add a photo. If you are sure you have the hub connected correctly but you can't debug via serial or install an OS with diagnostic tools then once again, I think you will just have to accept that you cannot get it to work. – goldilocks Nov 13 '16 at 11:58
3

I already have an OTG hub that works fine either powered or not as described here, but note when the hub is powered, it must be used to provide power to the Pi, since otherwise there would be two competing power sources and that is a bad thing.

But I decided to try this with an ordinary (optionally powered) USB hub, and ended up with a similar answer to this one from a similar question. People who are having a problem may want to look at both.

There are two traps I suspect people fall into:

  1. Believing you can plug the Pi into any random port on the hub with a microUSB cable. You can, and power the pi that way, but it will then be a slave device, meaning it won't have access to other devices on the hub.

    Instead, you must connect the hub's data line to the Pi. Unless they are specially designed, hubs have only one of those. This makes the Pi the master. There may be many slaves, but only one master.

  2. Believing you can power the Pi via the hub's data line. You cannot do that because the data line from the hub is intended to connect to a normal USB master, and masters provide power, they do not draw it. In other words, you can connect a normal hub via its data line and power the hub from the Pi, but not vice versa.

    This means with a normal USB hub, no matter what, you will have to connect both ports on the Zero to something, as shown below.

To make sure these points are clear:

  • If you want to use a normal USB hub as a hub with the Zero, you must connect the hub data line to it.
  • A normal hub does not provide power on the data line, so it cannot power the Pi that way.
  • You can power a hub this way from the Pi.

If you want a hub that you can both power the pi from and use as a hub, you need an OTG hub, not just a normal hub with an OTG adapter; see the first link above.

Here's two variations on the normal hub. In the first picture, the Pi is powering the hub:

enter image description here

A is the data line coming from the hub. It is connected to the data jack on the Pi. It's mostly hidden in the picture, but I'm using an OTG adapter on the other end that fits inside the normal size male end of the data cable, so what you can see is the smaller micro B jack sticking out of it into the Pi.

B is an RF keyboard/mouse transciever I used to test that the hub worked to provide slave devices. C is the power supply to the Pi, which is used to power the hub.

It can't be seen in the picture, but the hub is unplugged (there's a third variation on all this, since it also works with the hub plugged in but the pi powered separately).

Here's a variation on that where the hub is powered, and used to power the pi, but this requires two cables between the hub and the pi, one for the data line and a normal one to provide power.

enter image description here

The green dots are at either end of the data line (of which, again, there is only one per hub). The red dots are at either end of a normal microUSB cable used to power the Pi.

I would guess that if the hub is plugged in, it disconnects the power from the data line so there are not competing supplies. I'd also guess that any hub which can be used this way does the same thing, and that most powered hubs can be used this way. But I don't know for sure. In any case, it did not explode for me ;)

One thing you should be sure of: DO NOT PLUG TWO NORMAL PORTS INTO THE PI THIS WAY. One is okay. The other one here is the hub's data line.

  • Thanks for the detailed reply. I have added a picture of my setup. It is a simple USB hub with only one data line. It is not working in this arrangement. Thanks – StuckInPhD Nov 14 '16 at 16:02
  • Presuming you've verified the OTG adapter works with a keyboard or something I'd say you are most likely out of luck. I guess it would be nice to know why -- if I wanted to dig into that I'd first find a way to get that lsusb output with the hub attached. First make sure you have the command installed and it works, then try adding lsusb &> /home/pi/lsusb.txt to /etc/rc.local, shutdown, power off, plug in the hub, reboot, wait a minute to let it finish, unplug the hub, plug in the keyboard, login and have a look at /home/pi/lsusb.txt. – goldilocks Nov 14 '16 at 16:14
  • If there's only one hub listed (the internal one), and no "mystery devices" as per the question in the first link above, then the hub is not registering with the OS. Registering doesn't require any driver beyond standard USB stuff (even if the hub or device itself required a missing driver to actually be used), so if there's no mention, it could be that there's not enough power, too much signal degradation in the connection or cables, etc. – goldilocks Nov 14 '16 at 16:14
  • I can get the terminal on the retropie and can get the output to lsusb. But it can't be via the hub as the hub is not detected. But the keyboard connected directly via the OTG is detected. Will that output be any good? – StuckInPhD Nov 14 '16 at 16:42
  • Check if retropie has an /etc/rc.local file and follow the instructions from my last comment -- I guess it probably doesn't have a /home/pi unless there is a pi user, so you could just write to /etc/lsusb-output.txt. In case it wasn't clear, the idea is that you are going to add that line, then reboot the pi with the hub attached, then unplug the hub and plug in the keyboard so you can see whatever was written to the file. – goldilocks Nov 14 '16 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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