User avatar
jbeale
Posts: 3512
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

RPi Zero USB OTG (usb-ethernet device)

Fri Aug 24, 2018 9:12 pm

I'm trying to use my Raspberry Pi Zero V1.2 with current Raspbian Lite:

Code: Select all

Linux rp01 4.14.50+ #1122 Tue Jun 19 12:21:21 BST 2018 armv6l GNU/Linux
in the USB OTG ("usb gadget") mode, to appear as a USB-Ethernet device to another PC (in this case, a MiniPC running Ubuntu 18.04.1).

Following an online tutorial I added a 'modules_load' part to /boot/cmdline.txt:

Code: Select all

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=8f416024-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2, g_ether
and also a line with 'dtoverlay=dwc2' to /boot/config.txt

I am using the hardware serial port on the GPIO pins to see the boot messages from the Pi Zero. I do see that the Ubuntu system tries to attach to it, however this is what 'dmesg' says:
[ 180.487085] usb 1-4: new high-speed USB device number 6 using xhci_hcd
[ 185.675209] usb 1-4: device descriptor read/64, error -110
[ 201.288188] usb 1-4: device descriptor read/64, error -110
[ 201.523950] usb 1-4: new high-speed USB device number 7 using xhci_hcd
[ 206.664268] usb 1-4: device descriptor read/64, error -110
[ 222.281386] usb 1-4: device descriptor read/64, error -110
[ 222.389581] usb usb1-port4: attempt power cycle
[ 223.041478] usb 1-4: new high-speed USB device number 8 using xhci_hcd
[ 228.297737] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[ 233.673482] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[ 233.881767] usb 1-4: device not accepting address 8, error -62
[ 234.009774] usb 1-4: new high-speed USB device number 9 using xhci_hcd
[ 239.049619] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[ 244.425463] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[ 244.633519] usb 1-4: device not accepting address 9, error -62
[ 244.633791] usb usb1-port4: unable to enumerate USB device
anything obvious I'm doing wrong?

EDIT: SOLVED!
I had an extra space after the comma in my cmdline.txt before g_ether and removing that space was the trick. Ubuntu now shows:

Code: Select all

Bus 001 Device 010: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadget
I had copy-and-pasted the whole line exactly from a web page tutorial, but it had been translated from French, and perhaps Google Translate helpfully added a space after the comma.
There is an English tutorial here: https://learn.adafruit.com/turning-your ... net-gadget

EDIT2: Not Quite Solved for Windows 10 :-(

Although the RPi Zero-as-USB-Ethernet-Gadget works fine with a Linux host, it turns out there is trouble using it with a Win10 laptop. All the online tutorials I've found on this issue, claim I should be able to go through Device Manager in Win10 to manually change the installed driver to a Microsoft RNDIS network type, but on my system, Windows sees the RPi Zero USB as a serial device (COM5) and the device driver dialog refuses to present any drivers from Microsoft or anyone else, which are not serial devices. Perhaps Windows has recently changed to "helpfully" :-( prevent you from choosing the wrong device type, but that means I'm locked out of using this as a network device. Any ideas? FWIW, Win10 says USB\VID_0525&PID_A4A2

Supposedly this driver would work, but it is apparently no longer available for download.
http://www.catalog.update.microsoft.com ... 8e439f90a2

EDIT3: Turns out that only one laptop has a problem.

I tried the same RPi Zero connected to a different Windows 10 laptop, and that one worked right away with Device Manager showing the Pi Zero as "USB Ethernet/RNDIS Gadget" without any user action at all. The network connection operates as expected. The difference between the two laptops remains a mystery.

fkopac
Posts: 1
Joined: Wed Sep 11, 2019 12:28 pm

Re: RPi Zero USB OTG (usb-ethernet device)

Wed Sep 11, 2019 12:30 pm

I had unexplained problems with the RNDIS Gadget too. I had to manually delete the driver in the device manager and then it worked.

Return to “Troubleshooting”