Every time I receive a new Raspberry Pi, I go through the same error prone discovery process of creating my personal development environment. I know its going to be Python based with Flask, Paho MQTT, Adafruit modules, my own Python models and a standard pi user file structure. I also setup a “systemd” init configuration and modify the .bash_aliases file with “status”, “restart”, “stop”, etc. to manage the process started by the boot sequence.
Since I don’t have the space to add a USB keyboard and mouse to my already crowded desk, I’ve settled on headless servers. IMHO a headless Raspberry Pi server is also an ideal Internet of Things host. This “how to guide” is for Mac OS users like myself.
Go to the Raspberry Pi download page, select the latest “lite” image. You will need to unpack or unzip the file. Raspian Lite Image
Use Etcher to copy the img file to your SD card. It is usually /dev/disk2. Use Etcher to burn the img to the SD card
Ok, now the fun begins. A headless server needs SSH enabled. Simply create an empty file call “ssh” on the boot level.
If you can’t see /Volumes/boot try reinserting the SD card. You should see the boot volume on Finder.
I’ve standardized on Wi-Fi for most of my devices, which is a must for the Raspberry Pi Zero W. The next step is to configure your local Wi-Fi access point.
Insert the following into the blank file on the boot level. NO SPACES!
Eject the SD card using finder. Insert it into your Raspberry Pi, power it up and cross your fingers!
First Login to Pi Zero
Special instructions for the Raspberry Pi Zero are needed to attach a Wi-Fi dongle to the USB port. First connect your Pi Zero to your network with a RJ45 connector. Boot the Pi Zero and update/upgrade the OS to support USB/Wi-Fi.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
If you get a command not found error on the rpi-update then simply install it with apt-get. Some earlier distributions did not include this command.
sudo apt-get install rpi-update
The latest kernel has changed the /etc/network/interfaces file to use /etc/network/interfaced.d files. What I found that works is to add the following lines to the end of the /etc/network/interfaces file.
sudo vi interfaces
Add the following to the end of the file.
iface wlan0 inet manual
iface wlan1 inet manual
This may mess up dhcp but I’ve just started working with the Pi Zero USB/Wi-Fi.
First login to Pi Zero W
Login the new server and run raspi-config to set password, hostname and enable I2C.
- Change the password and hostname
- Expand memory
- Enable the camera and I2C bus
Update the operating system with latest.
sudo apt-get update
Configure the Apple Bonjour service and Apple networking
sudo apt-get install avahi-daemon
sudo apt-get install netatalk
Edit the .bashrc file to enable ll and other aliases. See systemctl
Reboot and test your installation.