Setting up Pi Zero OTG

Hi All,

I’ve followed the guide below to enable the USB Gadget in Ethernet emulation but when i connect this to my Windows 10 and Windows 7 PC’s it doesn’t get detected, i see some people have driver issues but i don’t even see and unrecognized hardware device in windows device manager.

any help would be appreciated, could this be a hardware fault?

Thanks :)

Just for the basic sanity check, which USB port are you using? (on the Pi side)

the one next to the HDMI but thank you :)

It’s quite possible that whatever editor you used on Windows could have done horrible things to the cmdline.txt file ( config.txt is a bit more resilient ), might be worth double checking. Also, did you flash the SD card yourself, or use an out of the box NOOBS?

When I plug mine in (Windows 10) I see it in “Devices and Printers” under the heading “Unspecified”

1 Like

Hi Thanks again, i used notepad++ in windows which should be fine and the Pi boots fine when i connect it via HDMI to a monitor so i think the config.txt is ok.

I’ve tried with Rasp via noobs and also Rasp direct on the SD card using win32imager

Tried another USB cable? That’s got me a few times!

Yes, 3 all together a couple of short ones and a long one and they have all been used with other devices for data purposes so i know they work

I have consulted with the oracle (@RogueM that is) and he suggested it could be USB3. I tried it in a USB3 port directly and while it showed up in my devices list, I couldn’t connect t it. Worth mentioning, anyway.

my suggestion would be to try through a USB2 hub, preferably externally powered, and see if that makes any difference… obviously not a very practical solution depending on your goal, but that may shed some lights on the cause of the issue.

Hi Guys,

Thanks for the suggestion i will try this tonight, although i have already tried connecting the PiZero to the main PSU and then connecting the USB OTG to the PC on a USB2.0 port so this should eliminate and lack of power issues.

I’ll do as suggested and report back and thanks you for all the support.

[EDIT] one thing i haven’t tried is a different SD Card as this one was supplied and appears to boot fine when i use a keyboard and monitor with the Pi so i will try a different one as well

Kind Regards,

Hi Guys,

I’ve tried what was mentioned in the above posts, so using USB2.0 Ports on the PC with a powered hub and also a different SD.

I’ve put some output below showing what modules have load etc, and it seem the software side if functioning just the OTG port doesn’t output anything.

dmesg | grep dwc

[    0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1440 bcm2708_fb.fbheight=900 bcm2708.boardrev=0x900093 bcm2708.serial=0xdf0a9e4c smsc95xx.macaddr=B8:27:EB:0A:9E:4C bcm2708_fb.fbswap=1 bcm2708.uart_clock=48000000 bcm2708.disk_led_gpio=47 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_ether
[    2.160778] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    2.167199] dwc_otg: FIQ enabled
[    2.167224] dwc_otg: NAK holdoff enabled
[    2.167238] dwc_otg: FIQ split-transaction FSM enabled
[    2.167297] Module dwc_common_port init
[    6.103439] dwc2 20980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[    6.721510] dwc2 20980000.usb: DWC OTG Controller
[    6.763456] dwc2 20980000.usb: new USB bus registered, assigned bus number 1
[    6.803491] dwc2 20980000.usb: irq 33, io mem 0x00000000
[    6.893786] usb usb1: Manufacturer: Linux 4.4.21+ dwc2_hsotg
[    7.410702] dwc2 20980000.usb: bound driver g_ether
[    8.083372] usb 1-1: new high-speed USB device number 2 using dwc2

.

lsmod

Module Size Used by
cfg80211 499234 0
rfkill 21397 1 cfg80211
smsc75xx 22660 0
snd_bcm2835 23131 0
snd_pcm 95473 1 snd_bcm2835
snd_timer 22556 1 snd_pcm
snd 68368 3 snd_bcm2835,snd_timer,snd_pcm
bcm2835_gpiomem 3823 0
bcm2835_wdt 4133 0
uio_pdrv_genirq 3718 0
uio 10230 1 uio_pdrv_genirq
usb_f_ecm 7608 1
g_ether 5037 0
usb_f_rndis 17023 2 g_ether
u_ether 14023 3 usb_f_ecm,usb_f_rndis,g_ether
libcomposite 49383 3 usb_f_ecm,usb_f_rndis,g_ether
dwc2 109939 0
udc_core 12769 2 dwc2,libcomposite
ipv6 367575 24

.

ifconfig

usb0 Link encap:Ethernet HWaddr f6:dd:64:70:5d:2b
inet6 addr: fe80::ce9b:8157:aef9:e7f7/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

It could well be the difference between Linux & windows newline characters.
I have had this before when using wordpad scripts and scratching my head why they don’t work.

Try this as it will not hurt

Do the above as it will purely convert windows newlines to unix and even if there was none it still will do know harm, but we will know then that the newline compatibility problem isn’t an issue.

Thanks, just tried this but unfortunately still no joy, but i do like the tool very neat :)

I am just trying it now and the adafruit instructions are more comprehensive.

What I would do is use noobs to set everything back to default and edit those files on the pi.
That is what I am doing now as apols about your woes but thanks for posting as being able to set it up as g_ether and not have to bother with a usb_ethernet is a great tool.

PS how old is the pi as have you done an rpi-update & the apt-get update - apt-get upgrade, to make sure everything is the latest?

Hi

I have tested with NOOBS and a RAW Install of Rasp, the Zero is only a few days old and the installation of the OS’s were from the website a few days ago and they were fully updated after install

At this point, I think you’ve got us all at a loss. We’re not going to geek our way out of this one :D

One last thing; have you managed to get any USB devices (mouse/keyboard) to work when connected to the Pi Zeros USB port and booted up connected to a screen? (I’m making the assumption that you have adaptors here, if not skip ahead).

If no, and all else fails, drop a line to support@pimoroni.com referencing this thread and they’ll sort you out.

Hi

Yes a Keyboard, Mouse and USB Ethernet dongle all connected through a passive USB hub work fine.

I’ve popped an email through to the support email.

Thanks

That’s extremely odd. It would seem to suggest that there’s a fault on the sense/ID line, a dry joint or something, which I guess could happen! Can’t help but feel we’re missing something silly, but I suppose this stuff happens.

it is very strange the only time i ever see anything in Windows Device Manager is when i connect it via OTG and withoutn an SD card installed and it show as below

Then i can insert the SD card and use rpiboot.exe to enable mass storage, and i can then access the SD card.

I was hoping i had just missed something

There must be something going wonky with software here. Have you got a Pi, or any other computer not running Windows to try plugging it into?

Actually, that said I don’t know what the boot procedure is when lacking an SD card. It may be that no ID pin shenanigans are required.