SSH into Pi Zero using only a single USB cable!

You can now SSH into you Pi Zero using nothing but a single USB cable. With 2016-05-10 release of Raspbian, all the required modules and kernel version were included on the stock Raspbian images. Earlier process included lots of steps and were a little messier. Adafruit has a detailed explanation of the earlier process that was used.

Although its very simple but you still need to configure 2 files (config.txt & cmdline.txt). Editing the files can be done on Windows as the configuration files are located on the /boot partition, which is formatted FAT32 and readable on Windows/Mac/Linux.

Prerequisites:

1. 2016-05-10 release of Raspbian
2. SD Card
3. Standard Micro USB Cable
4. Windows: iTunes installed, Linux: Avahi Daemon installed

Setup:

Step 1: Step 1 is pretty obvious. You need to flash Raspbian onto the SD card. You can use win32diskimager for this.

Step 2: After flashing is complete, navigate to the boot partition. Open "config.txt" file and add "dtoverlay=dwc2" at the bottom of the file on a new line. Save the file and close it.



Step 3: Next open "cmdline.txt" file and add "modules-load=dwc2,g_ether" after rootwait. Make sure that there is a single space gap in between the parameters. Do not alter the format! . Save the file and close it.


Step 4: Boot your Pi Zero using the configured SD card. The first time you boot your Pi Zero connected to your your Windows machine, one of two things will happen. You'll either see a new RNDIS network device, or you won't. If  the drivers are not installed it's will not work and will show a yellow exclamation mark on top of "USB Ethernet/RNDIS Gadget".


If you are on Windows 10 right-click on it and select "Update Driver Software"..., then "Browse my computer for driver software" and then "Let me pick from a list of device drivers on my computer" and finally choose "Remote NDIS Compatible Device". This should install the Microsoft RNDIS 5.1 driver (shows "Acer" as the manufacturer).


Step 5: If you have Bonjour Service running you should be able to SSH into you Pi Zero using raspberrypi.local as the address.


0 comments