Raspberry Pi Set up Headless Mode on a Mac
22 Oct 2020
Efficiently setting up a Raspberry Pi is always a bit tricky. But it doesnt have to be.
Today, I set it up rather easily, adapting from Desertbot.io
Here are the steps I followed:
Step 1
Step 2
Plug in the SD card, and using the Raspberry Pi imager, flash an operating system of your choice. I just used the recommended Raspberry OS.
Step 3
Wifi settings are always tricky, so I initially set up my zero using SSH over USB, following the instructions here, and repeated concisely below.
Check the volumes:
ls -ls /Volumes/
which should show a boot directory.
Step 4
Enable ssh:
touch /Volumes/boot/ssh
Step 5
Edit /Volumes/boot/config.txt and append to the bottom:
dtoverlay=dwc2
Step 6
Edit /Volumes/boot/cmdline.txt. After rootwait, append this text leaving only one space between rootwait and the new text (otherwise it might not be parsed correctly):
modules-load=dwc2,g_ether
If there was any text after the new text make sure that there is only one space between that text and the new text
Step 7
Put the SD card into the Zero
Plug the zero to the computer using ONLY the usb cable (no power cable)
Monitor System Preferences Network panel RNDIS/Ethernet Gadget status to check if the IP address is assigned to the zero.
Step 8
Once booted, log in
ssh pi@raspberrypi.local
password: raspberry
Step 9
Set up the wifi connection (from inside the raspi ssh)
sudo raspi-config
Done
This should be enough to having it set up correctly. No wpa_supplicant needed!
To power off the raspi safely, simply run
sudo poweroff