###Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)
More details - http://blog.gbaman.info/?p=791
For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian full or Raspbian Jessie onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. Finally, open up the cmdline.txt. Be careful with this file, it is very picky with its formatting! Each parameter is seperated by a single space (it does not use newlines). Insert modules-load=dwc2,g_ether after rootwait. To compare, an edited version of the cmdline.txt file at the time of writing, can be found here.
4. That's it, eject the SD card from your computer, put it in your Raspberry Pi Zero and connect it via USB to your computer. It will take up to 90s to boot up (shorter on subsequent boots). It should then appear as a USB Ethernet device. You can SSH into it using raspberrypi.local as the address.
-
Star
(647)
You must be signed in to star a gist -
Fork
(87)
You must be signed in to fork a gist
-
-
Save gbaman/975e2db164b3ca2b51ae11e45e8fd40a to your computer and use it in GitHub Desktop.
As others have stated, I also could not get this working with Raspbian Stretch Lite on a Pi Zero W. Would love to get some help.
I had this working with the pi zero W and stem. But now im getting the same 'Connection refused' after updating.
I might be wrong but to access the pi the SSH using the pi stem (https://www.sparkfun.com/products/14526) should not require any internet, therefor the IP address is irrelevant?
I have a solution for Windows 10 . the driver is on in my website : [http://domotique.caron.ws/cartes-microcontroleurs/raspberrypi/pi-zero-otg-ethernet/]
Sorry for my english :(.
Merci! Merci beaucoup!!
Le noveau link -->> [https://caron.ws/diy-cartes-microcontroleurs/raspberrypi/pi-zero-otg-ethernet/]
Is OTG, what these are intended for?
https://www.buyapi.ca/product/solderless-zero-dongle-for-raspberry-pi-zero/
Has anyone managed to get the Wifi &/or Blue Tooth working on the new RaspberryPi Zero W
I certainly haven't and have followed every piece of advice I can read - PiHut says Sorry don't know how??
I've tried all the drivers in the world but my pi zero keep showing up as a COM device and not as an ethernet device.
I found a fix for the Windows 10 driver issue: https://gist.github.com/jdoubleu/048bd96971164ada3737e0964bb810f3
Windows users should be able to use the powershell script here https://github.com/freemansoft/pi-ethernet-gadget to make the changes to a fresh SD card that can then be inserted into a Pi Zero W. I tested with the current latest Windows 10
I've tried all the drivers in the world but my pi zero keep showing up as a COM device and not as an ethernet device.
I am running latest Windows 10 v20H2.
The RNDIS driver was there when I clicked on Optional drivers when I ran Check for Updates. It is an Acer driver.
https://www.catalog.update.microsoft.com/Search.aspx?q=USB+RNDIS%20Gadget
.
Hardware: Pi Zero w/o WiFi, Pi Zero USB Stem (Adafruit)
Pi OS: 2021-03-04-raspios-buster-armhf-lite.img
Host OS: Ubuntu v20.10 (Groovy Gorilla)
I needed to perform a few more steps to ssh into the Pi.
After waiting for the Pi to boot...
- run
nm-connection-editorfrom the Host OS - select the appropriate "Wired connection #" under Ethernet, then click the gear. (device name will be something like
enxbed891078ed1) - select "IPv4 Settings", then Method: "Link-Local Only"
- run
ssh [email protected], password:raspberry
It still amazes me that its possible to get a Pi up and running without a keyboard and mouse.
Hardware: Pi Zero w/o WiFi, Pi Zero USB Stem (Adafruit)
Pi OS:2021-03-04-raspios-buster-armhf-lite.img
Host OS: Ubuntu v20.10 (Groovy Gorilla)I needed to perform a few more steps to
sshinto the Pi.After waiting for the Pi to boot...
- run
nm-connection-editorfrom the Host OS- select the appropriate "Wired connection #" under Ethernet, then click the gear. (device name will be something like
enxbed891078ed1)- select "IPv4 Settings", then Method: "Link-Local Only"
- run
ssh [email protected], password:raspberryIt still amazes me that its possible to get a Pi up and running without a keyboard and mouse.
I am curious whether you are able to SSH into a 2nd Raspberry Pi Zero.
I found that if I connect two Pi Zero, only the first one is accessible using .local addressing.
I run Linux Mint 20.1
I am curious whether you are able to SSH into a 2nd Raspberry Pi Zero.
I found that if I connect two Pi Zero, only the first one is accessible using .local addressing.
The default hostname for the pi is raspberrypi. If you plug in two devices without changing the defaults, you will have two devices with the same hostname. The Host OS will not be able to differentiate between them. Use IP addresses instead of the hostname, or change the hostname of each device through raspi-config.
I am curious whether you are able to SSH into a 2nd Raspberry Pi Zero.
I found that if I connect two Pi Zero, only the first one is accessible using .local addressing.The default hostname for the pi is
raspberrypi. If you plug in two devices without changing the defaults, you will have two devices with the same hostname. The Host OS will not be able to differentiate between them. Use IP addresses instead of the hostname, or change the hostname of each device throughraspi-config.
I did change the hostname.
Whichever Pi is plugged in first is the only one with which the local addressing will work.
I am just wondering if anyone has run into this.
.
Trying to do this on a Macbook Air with Apple Silicon. The RNDIS Gadget doesn't show up anywhere (tried in Network preferences and also in System Information).
Also tried g_serial - doesn't show up as well.
Any ideas?
Thank you.
Hello everyone,
Somehow my Rasperry Pi Zero is messed up with my Fedora 34 running on my Dell Latitude laptop.
The error is like this
[liveuser@localhost-live ~]$ avahi-browse -art
+ enp0s20f0u1 IPv6 DE85DEC0B0C5@Kodi (retropie) _raop._tcp local
+ enp0s20f0u1 IPv6 Kodi (retropie) _xbmc-jsonrpc._tcp local
+ enp0s20f0u1 IPv6 Kodi (retropie) _xbmc-events._udp local
+ enp0s20f0u1 IPv6 Kodi (retropie) _xbmc-jsonrpc-h._tcp local
+ enp0s20f0u1 IPv6 Kodi (retropie) _http._tcp local
+ enp0s20f0u1 IPv6 RETROPIE _device-info._tcp local
+ enp0s20f0u1 IPv6 RETROPIE _smb._tcp local
Failed to resolve service 'DE85DEC0B0C5@Kodi (retropie)' of type '_raop._tcp' in domain 'local': Timeout reached
Failed to resolve service 'Kodi (retropie)' of type '_xbmc-jsonrpc._tcp' in domain 'local': Timeout reached
Failed to resolve service 'Kodi (retropie)' of type '_xbmc-events._udp' in domain 'local': Timeout reached
Failed to resolve service 'Kodi (retropie)' of type '_xbmc-jsonrpc-h._tcp' in domain 'local': Timeout reached
Failed to resolve service 'Kodi (retropie)' of type '_http._tcp' in domain 'local': Timeout reached
Failed to resolve service 'RETROPIE' of type '_device-info._tcp' in domain 'local': Timeout reached
Failed to resolve service 'RETROPIE' of type '_smb._tcp' in domain 'local': Timeout reached
You guy could try to reset the USB port and it worked again!!!
sudo ./usbreset /dev/bus/usb/001/044
usbreset program can be found at here
==================================================
Since above method uses "Link-Local Only" and I couldn't get Internet access from my Pi Zero v1.3 (2005), no Wi-Fi running on Debian 10 (Buster).
I found another method to use IPv4 only and finally got Internet access from Pi Zero!!!
Firstly, just add the following line after rootwait in /boot/cmdline.txt
modules-load=dwc2,g_ether ipv6.disable=1
Of course, the /boot/config.txt file should be updated as the first post.
Secondly, use option "Shared to other computers" in IPv4 tab of USB Ethernet setting. To get the IP address of Pi Zero, just use this command
arp -a
The result may be this
[liveuser@localhost-live ~]$ arp -a
.
? (10.42.0.229) at <incomplete> on enp0s20f0u1
Thirdly, on Linux machine, please use this command to enable Pi Zero Internet access
echo 1 > /proc/sys/net/ipv4/ip_forward
Finally, you can SSH to Pi Zero by using direct address
ssh pi@[PI_ZERO_IP]
Happy hacking!!!
Note: Actually, I'm not sure this whether arp command affects by avahi-tools or not, you guy could try to use "Link-Local Only" option first and then "Shared to other computers" option later!!!
References:
- [raspberrypi.com] Raspberry Pi Zero v1.3 (OTG does not work)
- How to connect to the internet over USB from the Raspberry Pi Zero
My retropie's information
pi@retropie:~ $ uname -a
Linux retropie 5.4.72+ #1356 Thu Oct 22 13:56:00 BST 2020 armv6l GNU/Linux
pi@retropie:~ $ cat /etc/*release*
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@retropie:~ $ cat /proc/cpuinfo
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 997.08
Features : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7
Hardware : BCM2835
Revision : 900093
Serial : 0000000033297549
Model : Raspberry Pi Zero Rev 1.3
You could try this way. I'm sorry I don't have M1 Macbook.
The reference link is
run nm-connection-editor from the Host OS
select the appropriate "Wired connection #" under Ethernet, then click the gear. (device name will be something like enxbed891078ed1)
select "IPv4 Settings", then Method: "Link-Local Only"
run ssh [email protected], password: raspberry
Thank you! This is what needed to happen to get my pi to connect under Ubuntu.
On Windows you have to install the "USB Gadget" driver to be able to see the PI in dwc2 mode.
But that driver is just mapping the USB VID/CID/Class to the already existing RNDIS driver preinstalled in Windows since Windows 7.
If the PI would expose the HW ID: USB\Class_EF&SubClass_04&Prot_01 there would be no need to any additional driver.
Does anybody have an idea how to change the USB Class on the PI to this?
One usecase is very simple: With this change the PI would work with the Hololens2 that does not allow installing any new driver - including the "Gadget" Mapper .INF
My Raspberry Pi Zero W was detected as "serial device", not a RNDIS Gadget adapter, got it fixed by installing the
It looks like you can do this now using the windows optional updates which offer up the Acer driver. https://joe.blog.freemansoft.com/2022/11/installing-rndis-driver-on-windows-11.html
It is important to note that since the April 2022 update, there is no longer a default user and password on Raspberry Pi images.
So you must define the user and password prior to the first headless boot (either using the imager tool or by editing the boot files). Details on how to do this:
https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022/
I just tried it with a fresh image from today but for me it doesn't work. The windows host is not recognizing anything on the usb port where I stucked in the raspberrypi. Any ideas or has somebody observed the same issue?
Hi again.
I found the issue (it's always in front of the PC ;-)).
The housing is not compatible. It has an own usb-c-power connection without datalines on it.
Sorry.
i am having a error with my raspberry pi zero w where i am using Raspberry Pi OS lite and the pizero usb stem but it is not showing up in my device manager or anything
hit the windows key and type view optional updates. choose that and dropdown the menu and choose the one with RNDIS, install it, done.
hit the windows key and type view optional updates. choose that and dropdown the menu and choose the one with RNDIS, install it, done.
This is no longer an option in Windows 11
i am having a error with my raspberry pi zero w where i am using Raspberry Pi OS lite and the pizero usb stem but it is not showing up in my device manager or anything
Do you see a Com3 device under Ports(COM % LPT) ?



Actually, I found it better to set it to "Link-Local Only". In Linux go to the network connections editor and in the "IPv4 Settings" tab, set Method: to "Link-Local Only". This was the only setting that let me do ssh [email protected]. Once I was on the Pi Zero console, I could access the internet. This was on a Pi Zero (non-W) so it was getting internet of the PC over the USB.