APiNoob
Posts: 6
Joined: Sun Oct 18, 2020 1:59 am

Wiring a USB Hub to A Raspberry PI Zero 1.3

Tue Nov 24, 2020 10:28 pm

This is something that I've been having trouble with for a while and I've hit a wall on the project I've been doing because of this problem. I'm new to working with Pis so keep that in mind.

I've been working on a mini game console project for a while now. It's going to run on a Raspberry Pi Zero 1.3 and play NES and SNES games. I'm using USB to connect the controllers to the device. In just about every console ever, the power and video and whatever else ports are in the back of the console, and the controller ports and power button are in front. However, the Pi Zero has all of its ports on one side. I did a bit of research and found that there are a number of USB extension products for the Pi Zero that connect to test points PP1, PP6, PP22 and PP23. "Ok," I thought, "It should be simple and I can just wire the USB hub's wires to the corresponding test points, then made the USB hub go out the front." I tried it. It didn't work. I killed the USB capability of that Pi, mostly just my own error on that one. I get a new Pi. I try it. Didn't kill the USB but it still didn't work. There's something really funky going on and I'm at a loss for what could be causing all of this trouble.

I really need advice on what my options are. A nearly absolute requirement is that whatever USB solution can go out the opposite side of the ports on the Pi. Is there anything that might be directly causing my issue that can be solved easily? Worse case with this project is I make a port for the microUSB port on the back and just stick a microUSB OTG adapter in the Pi, plug a hub into that, and route the hub from the outside of the shell to the inside, which would just be nasty looking.
Some info I think might be helpful is when I had the USB wired, the main microUSB port didn't work on the Pi. As soon as it was unwired, it did work.

BMS Doug
Posts: 4303
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Wiring a USB Hub to A Raspberry PI Zero 1.3

Tue Nov 24, 2020 11:33 pm

APiNoob wrote:
Tue Nov 24, 2020 10:28 pm
Some info I think might be helpful is when I had the USB wired, the main microUSB port didn't work on the Pi. As soon as it was unwired, it did work.
If I'm understanding that statement correctly then it does define your issue.

Using the pads to get usb isn't a 2nd hidden usb port, it's just another way of accessing the same main microusb port.
Leave the microusb port empty and rewire your hub to the pads. Test.
Doug.
Building Management Systems Engineer.

User avatar
thagrol
Posts: 4018
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Wiring a USB Hub to A Raspberry PI Zero 1.3

Tue Nov 24, 2020 11:53 pm

APiNoob wrote:
Tue Nov 24, 2020 10:28 pm
Some info I think might be helpful is when I had the USB wired, the main microUSB port didn't work on the Pi. As soon as it was unwired, it did work.
The SoC on a zero* has a single USB controller with a single USB port. You can access that through the data micro socket or the test points but not both at the same time. Doing so is like trying to use a "Y" cable to connect two devices to a single USB port - it simply won't work.

*: Actually all models. The 4B has an extra USB controller connected via PCIe, other B models haev an onboard USB hub that provides the extra ports and the ethernet connection.
Arguing with strangers on the internet since 1993.

hippy
Posts: 8882
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Wiring a USB Hub to A Raspberry PI Zero 1.3

Wed Nov 25, 2020 12:50 pm

APiNoob wrote:
Tue Nov 24, 2020 10:28 pm
Worse case with this project is I make a port for the microUSB port on the back and just stick a microUSB OTG adapter in the Pi, plug a hub into that, and route the hub from the outside of the shell to the inside, which would just be nasty looking.
I couldn't even get that to work. It seems the Zero is rather finnicky about what can be connected. None of my bus powered hubs worked though others have reported better luck. Powered hubs seem to work much better. I suspect it's an issue of whether the hub powers up with the Zero or before.

If your chosen hub doesn't work anyway it's not going to work when wired directly to the Pi. So it's not easy to tell if what you did has not worked because of some connection issue or because it never would.

APiNoob
Posts: 6
Joined: Sun Oct 18, 2020 1:59 am

Re: Wiring a USB Hub to A Raspberry PI Zero 1.3

Thu Nov 26, 2020 2:00 am

Leave the microusb port empty and rewire your hub to the pads.
This is how I've done it every time.
If your chosen hub doesn't work anyway it's not going to work when wired directly to the Pi.
I verified that the hub I was trying to wire to it was 100% functional with the Pi Zero before trying. It worked just fine with the hub through the microUSB port.
Still really stuck.

hippy
Posts: 8882
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Wiring a USB Hub to A Raspberry PI Zero 1.3

Thu Nov 26, 2020 12:08 pm

APiNoob wrote:
Thu Nov 26, 2020 2:00 am
I verified that the hub I was trying to wire to it was 100% functional with the Pi Zero before trying. It worked just fine with the hub through the microUSB port.
In which case it would seem the issue is in directly wiring it to the Pi; wiring error, wires swapped over, cold solder joint, or something like that.

Or is it simply that you haven't pulled the OTG ID signal to 0V, haven't configured Raspberry Pi OS so you don't have to ?

User avatar
thagrol
Posts: 4018
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Wiring a USB Hub to A Raspberry PI Zero 1.3

Thu Nov 26, 2020 12:23 pm

hippy wrote:
Thu Nov 26, 2020 12:08 pm
Or is it simply that you haven't pulled the OTG ID signal to 0V, haven't configured Raspberry Pi OS so you don't have to ?
IIRC there is no test point available for the ID pin so it's either solder to the micor UBS connector or do it in software via a droverlay parameter (see /boot/overlays/README)
Arguing with strangers on the internet since 1993.

APiNoob
Posts: 6
Joined: Sun Oct 18, 2020 1:59 am

Re: Wiring a USB Hub to A Raspberry PI Zero 1.3

Tue Dec 01, 2020 9:54 pm

In regards to the project I was doing, I've finished it up. I went with worst case - a USB stick is permanently sticking out of the back and then going back in the enclosure. It's not pretty, but it works!

This sort of thing is definitely something I want to get right in the future, though. From the new replies coming in, it sounds like I need to specifically configure something in the OS? What specific change needs to be made to make USB data come through the test points?

User avatar
thagrol
Posts: 4018
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Wiring a USB Hub to A Raspberry PI Zero 1.3

Tue Dec 01, 2020 11:22 pm

APiNoob wrote:
Tue Dec 01, 2020 9:54 pm
In regards to the project I was doing, I've finished it up. I went with worst case - a USB stick is permanently sticking out of the back and then going back in the enclosure. It's not pretty, but it works!

This sort of thing is definitely something I want to get right in the future, though. From the new replies coming in, it sounds like I need to specifically configure something in the OS? What specific change needs to be made to make USB data come through the test points?
USB data always goes through the test points. That's regardless of whether the zero is acting as a host or device.

A better question would be: what software settings do I need in order to use the zero as a USB host when connecting a USB device via the test points?

If that's what you meant, see the documentation for the dwc2 device tree overlay in /boot/overlays/README.

TL;DR: try adding this to config.txt then rebooting:

Code: Select all

dtoverlay=dwc2,dr_mode=host
Arguing with strangers on the internet since 1993.

Return to “Troubleshooting”