lmore3
Posts: 11
Joined: Tue Dec 22, 2015 6:38 am

Raspberry Pi zero USB gadget not working

Fri Jan 11, 2019 9:05 pm

I'm trying to use the pi zero w as a USB ethernet gadget but it's not working at all. If I leave out the SD card it shows the bootloader on my computer and I can use usbboot https://github.com/raspberrypi/usbboot but that's the only thing that works. I also tried plugging a keyboard in and that works.

User avatar
HawaiianPi
Posts: 3166
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry Pi zero USB gadget not working

Sat Jan 12, 2019 11:16 am

I have a pre-configured Raspbian Lite USB Gadget mode image you could try, just to make sure it works on your Pi Zero.

2018-11-13-raspbian-stretch-lite-Pi0USB.zip
SHA256 = 32ca25d28122cea2fd40d3f8d8c0e0ac2efd88fb5f569d0976828f42a604c2ed

It's the default Raspbian Stretch Lite image with Pi0(W) USB Ethernet Gadget mode pre-configured (config/cmdline .txt files modified and "ssh" file added with no other changes). Just write it you your SD card with Etcher and DO NOT modify anything (just burn-n-boot).
  1. Put the card in your Pi0 or Pi0W
  2. Connect a normal micro USB data cable to the USB data port of the Pi0 (the one closest to the HDMI)
  3. Do not connect anything to the power port (the one closest to the outer edge)
  4. Connect the other end of the micro USB cable to your main PC and the Pi0 should start to boot
It should boot up in USB Ethernet Gadget mode.
Note that the first boot can take awhile, so give it a couple of minutes before you try to SSH in.

If it doesn't work, verfiy the SHA256 hash sum of the download, and check Device Manager to see what driver (if any) was installed.

If you don't see this USB Ethernet/RNDIS Gadget driver,
Image
then something is wrong with your Windows system (it's installing the wrong driver), and you can try this driver (all the details match the driver installed in my Win10 system). Other hardware - Acer USB Ethernet/RNDIS Gadget

If you DO see that driver but it has a problem, right click on it and uninstall it, then click on scan for hardware changes in the Action menu. If that doesn't fix it you can try the driver linked above.

If the driver appears to be working, but you can't SSH into [email protected] then Zeroconf/mDNS is not working on your system (install Apple's Bonjour Printer service).

This image was tested and confirmed working on my Windows 10 notebook with my Pi0W.

The difinitive guide to USB Gadget mode can be found here: https://blog.gbaman.info/?p=791
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

lmore3
Posts: 11
Joined: Tue Dec 22, 2015 6:38 am

Re: Raspberry Pi zero USB gadget not working

Sun Jan 13, 2019 10:24 pm

I flashed the image and it booted fine but it still didn't work. I uploaded dmesg here https://pastebin.com/6t7i3Rqx

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

Re: Raspberry Pi zero USB gadget not working

Mon Jan 14, 2019 5:20 pm

lmore3 wrote:
Sun Jan 13, 2019 10:24 pm
I flashed the image and it booted fine but it still didn't work. I uploaded dmesg here https://pastebin.com/6t7i3Rqx
Is that dmesg fromn the zero or the USB host?

If it's from the zero, exactly what do you have connected and to which ports? At a guess, do you have a Dell USB keyboard connected to the inner microUSB port and the USB host to the outer one?

If this is the case, it isn't going to work. Despite there being two microUSB sockets, there is only one port on the SoC and the outer most socket is power only. For USB gadget to work, you must connect the host directly to the inner port without an otg adapter.
Note to self: don't feed the trolls
If you believe "L'enfer, c'est les autres" (Hell is other people) have you considered that it may be of your own making?

lmore3
Posts: 11
Joined: Tue Dec 22, 2015 6:38 am

Re: Raspberry Pi zero USB gadget not working

Wed Jan 16, 2019 8:37 am

It's from the pi. I plugged it into my laptop at first but after it completely booted I connected a keyboard by plugging a battery bank in the other port, unplugging it from my computer, and plugging in a keyboard so I can get the log. I already knew about only one port being able to transfer data.

Return to “Troubleshooting”