Connect to your Raspberry Pi Zero via USB (no otg cable).
The USB Virtual Gadgets makes it super easy to emulate a virtual ethernet allowing local connection over one cable to SSH, SFTP, ect. You can tunnel with ssh for internet, and forward x to your desktop!
I just got a Raspberry Pi Zero V.1.3 in the mail. I was excited to finally get it and just ripped open the packet, skipping all instructions and was booting and playing the Pi Zero within 5 minutes. Setup could not be easier!
I wanted to get started on a litle idea; so I had to figure out how to get a connection going since I don’t have a usb wifi device. I was thinking of how this would work while my mind kinda went into auto drive. I plugged in the USB cable to the USB port on the Pi Zero and directly to my computer. I then opened a terminal and tried to adb into the Pi zero. 🙂 I realized then that I wasn’t on my Android phone(s) or tablet, just did it out of habbit I guess. However, this is when I noticed the Pi zero was booting? I looked in the /dev/ to see if I could see anything on usb. I didn’t. However, while I waited for the light to stop flashing I started looking around the internet and found out that gbaman and some others have been working on this for awhile. It just happened to be included in the distro I picked for my first bootup ( 2016-05-10 release of Raspbian ).
USB Virtual Gadgets have been included but needs two very simple changes to two files on the boot of the sdcard. Once you add these two lines you simply ssh,sftp,vnc, or forward x with the address ‘raspberrypi.local’!
<strong>dtoverlay=dwc2</strong> add to config.txt
<strong>modules-load=dwc2,g_ether </strong>add to the end of cmdline.txt
I’m including the instructions from gbaman’s blog:
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 Jessie full or Raspbian Jessie Lite 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
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
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.
SSH works great this way! I’m going to test this out on Android with XSDL and let you guys know if this works! Regarding my computer, it works great. Just ssh with raspberrypi.local. You can change this in the host conf if you need too.