raghava216
Posts: 11
Joined: Wed Jul 18, 2018 5:07 pm

USB on Raspberry Pi Zero W not working

Thu Aug 16, 2018 5:36 am

I brought out wires from the PP22 and PP23 USB pads on the rear side of Pi Zero W to an external connector. Also, took out wires from PP1 (5V) and PP6 (GND) for providing power to Pi Zero externally. During the process, I am sure that I did not short either of the USB wires to those coming from PP1 or PP6.

When I switched on the Pi, it booted up normally, but the mouse that I connected to its USB port did not work. Then, I measured the voltage between the PP1 (5V) and the micro USB connector body and found it to be 5V. So, it is getting the power but data lines are not working.

Any idea how to fix this?

User avatar
Imperf3kt
Posts: 3626
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: USB on Raspberry Pi Zero W not working

Thu Aug 16, 2018 6:09 am

The Pi needs to assert itself as host.
You should short pin 4 on the microUSB connector, to ground (pin 5) using a 100 ohm resistor.

At least, as per my experience discussed here:
viewtopic.php?f=29&t=218905&p=1348903#p1348903
55:55:44:44:4C
52:4C:52:42:41

raghava216
Posts: 11
Joined: Wed Jul 18, 2018 5:07 pm

Re: USB on Raspberry Pi Zero W not working

Thu Aug 16, 2018 6:35 am

Any idea what would have happened with my Pi zero w?

Also, I think its difficult to put a 100 ohm resistor between pins 4 and 5 as u suggested.
Can I directly short them instead?

User avatar
Imperf3kt
Posts: 3626
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: USB on Raspberry Pi Zero W not working

Thu Aug 16, 2018 6:42 am

I've seen devices that do this, and the information I pulled from Wikipedia isn't exactly clear on why the resistor is necessary, if at all.

I myself am going to try this sooner or later, so may have more info later.
As far as I can determine, it should be fine to do so.
55:55:44:44:4C
52:4C:52:42:41

aBUGSworstnightmare
Posts: 1969
Joined: Tue Jun 30, 2015 1:35 pm

Re: USB on Raspberry Pi Zero W not working

Thu Aug 16, 2018 7:49 am

Sorry, but what are 'the wires' good for, and how did you connect your mouse?

If there is something connected to 'your wires' you can't connect another device to the RPI microUSB connector. If you want to connect multiple devices you will have to use a USB hub.

User avatar
Imperf3kt
Posts: 3626
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: USB on Raspberry Pi Zero W not working

Thu Aug 16, 2018 9:41 am

aBUGSworstnightmare wrote:
Thu Aug 16, 2018 7:49 am
Sorry, but what are 'the wires' good for, and how did you connect your mouse?

If there is something connected to 'your wires' you can't connect another device to the RPI microUSB connector. If you want to connect multiple devices you will have to use a USB hub.
As I understand it, 'the wires', connect to the D+ and D- connections in the MicroUSB port, via use of the PP pads. It looks as if the OP wants to place a (single) full size USB-A port on the other end of said wires.

Basically, so using an OTG cable can be skipped, and possibly, so the position of the port can be repositioned inside an enclosure.

A hub is indeed necessary, if more than one USB device is required at a time.
55:55:44:44:4C
52:4C:52:42:41

raghava216
Posts: 11
Joined: Wed Jul 18, 2018 5:07 pm

Re: USB on Raspberry Pi Zero W not working

Thu Aug 16, 2018 10:11 am

In my final application, I can't have the usb cables coming sideways from the Pi Zero (default provision). Hence, I brought out those usb lines out. In lab, I connected mouse to the Pi Zero through an OTG cable.

aBUGSworstnightmare
Posts: 1969
Joined: Tue Jun 30, 2015 1:35 pm

Re: USB on Raspberry Pi Zero W not working

Thu Aug 16, 2018 11:30 am

Understood. So, in case it is not working you will have to check your wiring. Try to keep the wire lenght same for D+ and D-.

I did similiar thing but used a PCB with Pogo-Pins instead of wires. Needed a WiFi stick which is supporting monitor mode
CIMG1955.jpg
CIMG1955.jpg (102.29 KiB) Viewed 1955 times

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

Re: USB on Raspberry Pi Zero W not working

Thu Aug 16, 2018 11:35 am

According to the device tree docs you should be able to force the usb driver into host mode:

Code: Select all

Name:   dwc2
Info:   Selects the dwc2 USB controller driver
Load:   dtoverlay=dwc2,<param>=<val>
Params: dr_mode                 Dual role mode: "host", "peripheral" or "otg"

        g-rx-fifo-size          Size of rx fifo size in gadget mode

        g-np-tx-fifo-size       Size of non-periodic tx fifo size in gadget
mode
Source: https://github.com/raspberrypi/firmware ... ays/README

Try adding

Code: Select all

dtoverlay=dwc2,dr_mode=host
to /boot/config.txt.
Arguing with strangers on the internet since 1993.

raghava216
Posts: 11
Joined: Wed Jul 18, 2018 5:07 pm

Re: USB on Raspberry Pi Zero W not working

Mon Aug 20, 2018 7:20 am

thagrol wrote:
Thu Aug 16, 2018 11:35 am
According to the device tree docs you should be able to force the usb driver into host mode:

Code: Select all

Name:   dwc2
Info:   Selects the dwc2 USB controller driver
Load:   dtoverlay=dwc2,<param>=<val>
Params: dr_mode                 Dual role mode: "host", "peripheral" or "otg"

        g-rx-fifo-size          Size of rx fifo size in gadget mode

        g-np-tx-fifo-size       Size of non-periodic tx fifo size in gadget
mode
Source: https://github.com/raspberrypi/firmware ... ays/README

Try adding

Code: Select all

dtoverlay=dwc2,dr_mode=host
to /boot/config.txt.
I tried this. But, it didn't work.
The Pi Zero W is still not getting detected with SSH.

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

Re: USB on Raspberry Pi Zero W not working

Mon Aug 20, 2018 2:03 pm

raghava216 wrote:
Mon Aug 20, 2018 7:20 am

I tried this. But, it didn't work.
The Pi Zero W is still not getting detected with SSH.
Ok.
  • Have you enabled ssh?
  • Have you rebooted since making that change?
  • Do you have a stock cmdline.txt or have you modified it in anyway? E.g. to load any extra modules.
  • With a monitor, USB hub, and keyboard connected to the stock USB port (and nothing to the one you added), are the USB devices recognised and are they reported by

    Code: Select all

    lsusb
Arguing with strangers on the internet since 1993.

Return to “Interfacing (DSI, CSI, I2C, etc.)”