This summer, I wanted to buy a new AirPlay receiver for my back deck. For some reason, you can’t buy a simple device anymore, so I decided to build my own. Here’s how I did it…
We’re going to use a Raspberry Pi Zero W, and shairport-sync, to turn it into an AirPlay receiver.
Along the way, I’ll walk through how to install the OS, enable SSH and wifi, set a custom hostname, and change the default password..
Once we’re done, the Raspberry pi will appear as an option in the iOS AirPlay list, just like any “official” AirPlay device.
The Raspberry Pi Zero W is the smallest, cheapest wifi enabled member of the Raspi family. Reviews of the Zero W mentioned it had poor sound quality, so I decided to add on a Digital audio converter (DAC). This meant I’d need to do some soldering, but the finished result has worked out great.
This is what I purchased, feel free to improvise.
You’ll also need a computer with an SD Card slot to setup the OS.
Using the header pins, solder the DAC to the Pi, per these instructions.
The end result should look similar to this:
Nothing fancy here, we’re going to install a headless version of Raspbian (the standard flavor of linux for Raspberry Pi)
On your computer (not on the Pi), insert the SD card.
Install OS with these steps:
Before booting up our new Raspberry Pi, we need to enable SSH. We do this by adding an empty file to the
boot folder on the SD card.
Once Etcher finishes installing Raspian on your SD card, run the following: (this is from my mac, your directory path may vary)
You can now insert the SD card in the Pi, and power it on.
To configure the Pi for your wireless network, we’re going to connect initially over the USB port labeled “data”. This allows us to SSH over USB using OTG networking network connection. More background here.
ssh email@example.com #default password is `raspberry`
NOTE from now on all commands will be run in the SSH session we just created above.
Now that we can SSH into the running Raspberry Pi, lets update the default password/hostname, and enable wifi.
Change the default password for
pi by running
Your Airplay selection menu will display the hostname your Pi, so lets choose a memorable name. I’m naming mine
Update the hostname by running
- 127.0.1.1 raspberrypi
+ 127.0.1.1 airplay_pi
We can manually set the router’s network name and password by adding it to
sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
Shut it down with
sudo poweroff and disconnect it from your laptop.
NOTE: If you change your wifi password in the future, you’ll need to connect over USB and update this file accordingly
Ok, you can now connect to the Raspberry Pi on your wireless network by running
ssh pi@airplay_pi.local 🤘🤘
In this section we’ll use our new wifi connection to install the DAC drivers, and the airplay server.
Install the DAC software
curl https://get.pimoroni.com/phatdac | bash
See more at the official setup guide.
Install airplay software
sudo apt-get install shairport-sync
At this point we should be able to see our Pi as an option from the airplay menu on your iOS device.
Plug the Pi into some speakers, connect to
airplay_pi and enjoy your new Airplay speakers! 🤘🤘🤘
© 2020 Mike Vormwald. All rights reserved.