By default, Amazon Echo cannot receive music over WiFi using the Airplay or Upnp protocol. As nothing can be done in terms of software changes, using a simple external setup, we can now stream music to Amazon Echo through Airplay.
The heart of the project is Mike Brady's shairport-sync so a word of thanks before we start.
For this project, we need a simple single board computer capable of running shairport-sync and that has an audio port as well. On doing some digging, i found the Orange Pi Zero to be the most ideal board for our project. The audio from Orange Pi Zero will be sent out to the Echo through a Bluetooth audio transmitter.
So the logic is simple.
Shairport-sync--->Orangepi--->Bluetooth Audio transmitter--->Amazon Echo
After burning the Armbian image on to the SD card, you can get started.
How to do it1. Setup your Pi:
sudo apt-get update
sudo apt-get upgrade
2. Setup Wifi:
sudo nano /etc/network/interfaces
3. Paste the following lines:
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
4. Setup Wifi credentials:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
5. Copy and paste the following and set your SSID and PASSWORD:
network={
ssid="Your_Wifi_SSID"
psk="Your_wifi_password"
}
6. Turn Wifi ON:
sudo ifup wlan0
7. Update Time Zone:
sudo dpkg-reconfigure tzdata
8. Change the config file to set on board audio as default card.
sudo nano /etc/asound.conf
9. Paste the following and save:
pcm.!default {
type hw card 0
}
ctl.!default {
type hw card 0
}
10. Reboot:
sudo reboot
11. Enable avahi.
systemctl start avahi-daemon
systemctl enable avahi-daemon
12. Install dependencies:
apt-get install build-essential git autoconf libtool \
libdaemon-dev libasound2-dev libpopt-dev libconfig-dev \
avahi-daemon libavahi-client-dev \
libssl-dev
13. Clone shairport sync, move into project directory and auto-configure shairport:
git clone https://github.com/mikebrady/shairport-sync.git
cd shairport-sync && autoreconf -i -f
14. Configure installation:
./configure \
--with-alsa --with-stdout --with-pipe --with-avahi \
--with-ssl=openssl --with-metadata --with-systemd
15. Install:
make install
16. Adding shairport to groups:
groupadd -r shairport-sync
useradd -r -M -g shairport-sync -s /usr/bin/nologin -G audio shairport-sync
17. Enable auto start of shairport-sync on boot:
systemctl enable shairport-sync
systemctl start shairport-sync
18. Change Name of the Shairport-sync:
sudo nano /usr/local/etc/shairport-sync.conf
19. Reboot:
sudo reboot
ConclusionsAfter verifying the working of shairport-sync, plug in the Bluetooth audio transmitter to pi and pair it with Amazon Echo like any other Bluetooth pairing process.
Now you have an Amazon Echo with multiroom audio streaming capability.
Comments
Please log in or sign up to comment.