Raspberry Pi Zero W: Headless Bring-up (Raspbian)
In this post we set up a Raspberry Pi Zero W the simplest way and connect it to a WPA2 Wi-Fi network.
Preparation
We download the image and unpack it:
wget -O raspbian-stretch-lite.zip https://downloads.raspberrypi.org/raspbian_lite_latest unzip raspbian-stretch-lite.zip
Then we mount the image in the local filesystem:
Enabling the SSH server
Configuring the Wi-Fi interface
We set up wlan0 so that the interface comes up automatically and gets its address via DHCP:
source-directory /etc/network/interfaces.d + +auto wlan0 +allow-hotplug wlan0 +iface wlan0 inet dhcp + wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Next we create the file wpa_supplicant.conf and open it:
There we configure wpa_supplicant to match our Wi-Fi network:
Cleaning up
We unmount the partitions of the image and clean up:
Writing the image to the microSD card
We put the microSD card into the computer and search the systemd journal for the matching device node:
With dd we write the image to the card:
Careful, dd does not ask before it overwrites! The output file (of) must be the device node of the microSD card!
Now we put the microSD card into the Raspberry Pi and connect the power supply. The Pi needs a little time to boot.
Connecting to the Raspberry Pi
We search the local network for the Raspberry Pi:
Finally we log in via SSH: