Getting the New Pi Zero W Talking to WiFi Without a Monitor

Getting the New Pi Zero W Talking to WiFi Without a Monitor

Tutorials diy pi-zero-w raspberry pi tutorial wifi

I spent about forty minutes of my Saturday afternoon hunched over the kitchen table with a microSD card in one hand and a forum thread open on my phone, trying to get a ten dollar computer to join my WiFi network without ever plugging it into a screen. That's the new Pi Zero W for you.

Quick background if you missed it: the Raspberry Pi Foundation put out the Zero W last week, which is basically the same board as the original $5 Pi Zero but with WiFi and Bluetooth soldered on, for $10. Doesn't sound like a huge deal until you remember the whole point of the Zero line is being tiny and cheap enough to bury inside some other project, and now you don't need a USB WiFi dongle hanging off it like a growth. Great idea. Getting one was another story - my local reseller had them gone in under a day, and I ended up ordering through Pimoroni and waiting almost a week. One per customer, obviously, because the second these things go up somebody tries to buy forty of them to flip on eBay.

Anyway. It showed up Thursday and I finally had time to mess with it this weekend. If you don't have a spare HDMI monitor and USB keyboard lying around (I don't, mine's all packed in a closet from when I moved), you can set the whole thing up headless, which sounds fancier than it is.

What you actually need to do

Flash Raspbian Lite onto the SD card with Etcher, same as always. Before you eject it, don't unmount it yet, because you need to drop two files into the boot partition:

  1. An empty file literally just named ssh, no extension, nothing inside it. Its existence is what tells the Pi to enable SSH on first boot instead of making you set it up through the desktop GUI you don't have access to.
  2. A file named wpa_supplicant.conf with your WiFi details in it, something like:
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="yournetworkname"
    psk="yourpassword"
}

Save both onto the boot partition, eject the card, put it in the Pi, plug in power. No HDMI cable touches this thing at any point.

Here's the part that always makes me feel like it's 2003 again: finding the IP address it grabbed. There's no screen telling you, obviously. I ended up just logging into my router's admin page and scrolling through the connected devices list looking for something named "raspberrypi." Found it, SSH'd in with [email protected], password raspberry (change it immediately, please), and I was in. Whole thing probably would've taken ten minutes if I hadn't spent half the time googling why my first wpa_supplicant file didn't work, which turned out to be a stray smart-quote character my text editor had helpfully swapped in for a regular quotation mark. Not the Pi's fault. Mine.

I don't have a grand use for it yet, honestly. I keep telling myself it's going to be a little WiFi weather display for the hallway, the kind of project every Pi owner claims they're doing and then never finishes. We'll see. My friend Dave, meanwhile, spent this same week refusing to talk about anything except trying to track down a Switch, since apparently every store within twenty minutes of him sold out on launch day and he's been refreshing a stock tracker site like it's a part time job. Between his Switch hunt and mine for a $10 board, it's been a rough week for anyone trying to buy small electronics around here.

One thing I'll say for the Zero W: for something the size of a stick of gum, having WiFi built in changes what's actually practical to build. No more running a dongle off a cheap USB hub just to get five bucks of hardware onto the network. Whether I actually finish the weather display project is a separate question entirely.