I recently was working on getting the Raspberry Pi Zero W set up, a tiny computer with a Wi-Fi chipset built-in. I run these headless, so I need to manually configure these to be available via SSH right out of the box. This will be a short overview of what I did, as it took way too long and I plan on setting up many of these over the coming years.
flashing Raspbian lite
The first step is to download the Raspbian OS Lite image from the Raspbian
website. Unzip that and keep the
.img file accessible. You can use
dd or a tool like Balena Etcher for OSX systems to flash the image
to your formatted SD card.
boot up the pi
Boot up the Pi using the PWR micro USB port, and give it a few minutes to initialize for the first time.
configuring the OS
After the pi boots up, power it off and stick the SD card into your computer once more. Once the SD card is mounted, we’ll make a few modifications to add WiFi credentials and enable SSH access.
# run rasp pi zero setup to configure Wi-Fi and enable ssh
$ inv rasp-pi-zero-setup
Once those steps are complete, the SD card can be ejected and added back to the Pi. The Pi Zero is now ready to boot and should be able to connect to your Wi-Fi without issue. Give it a few minutes to fully boot up, and then you can find the IP on your router device list and connect.
# default user is pi and password is raspberry
$ ssh pi@<fake_ip>
These are some simple instructions that outline configuring a Pi Zero with little to no extras added. I plan on adding Ansible playbooks to setup docker and various other utilities sometime in the near future.