How to connect to a Raspberry Pi Zero W using nothing but a single micro USB cable.

General support for the Pi-Star System
Post Reply
KE7FNS
Posts: 222
Joined: Wed Apr 17, 2019 11:11 pm

How to connect to a Raspberry Pi Zero W using nothing but a single micro USB cable.

Post by KE7FNS » Fri Aug 16, 2019 4:52 am

So, while I was playing around with a new RPi Zero W I ran into some difficulty getting it to connect to my N network. I've noticed my other RPi 3 B+'s are also experiencing the same issue with connecting to the N network too, so I'll need to figure out what that issue is at a later date. I normally use wired connections it isn't very important right this second.

I ran into the issue where the only OTG cable I had has a 90 degree bend to the right that conflicted with the power input. So I had no way of connecting a keyboard and monitor to the RPi so I could access the command line.

I tried the whole auto access point and used my phone to configure it with my network settings but it refused to connect after entering the correct network details, so I was stuck with no way access this RPi and figure out what was going on.

This is the solution I came up with.

I loaded the SD card in a windows machine and edited the following two files.

open config.txt and add the following line at the end of the file

Code: Select all

dtoverlay=dwc2
What this does is selects the dwc2 USB controller driver


open cmdline.txt and add "modules-load=dwc2,g_ether" after rootwait

Code: Select all

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_ether quiet noswap ro
You must keep the exact order and formatting separating the parameters with a single space and make sure it is all on one line.

After that you simply take the RPi Zero W and insert the SD card with the changes you just made. Then plug in a normal usb Micro to A cable to the USB port on the RPi Zero W, DO NOT CONNECT ANYTHING TO THE POWER micro usb port, and then connect the other end of that USB cable into a USB port on a computer.

The computer will power up the RPi Zero W and it will begin booting. After a minute or two your computer should detect a new network device. Mine labeled it as "USB Ethernet/RNDIS Gadget"
Then all you do is open a web browser and type in "http://pi-star/" and then configure your RPi Zero as normal.

to return everything back to normal you can either insert the SD card into a computer or ssh in and edit the files back. (if you ssh in make sure you run rpi-rw)

simply insert a # in front of dtoverlay=dwc2 or remove that line and save.

and remove modules-load=dwc2,g_ether and save.

I hope someone finds this useful and interesting, I know I sure did.

Post Reply