To get Kosters Shairport-Sync Implementation I have used the following:
- Raspberry Pi 3 B Starterkit (https://www.sossolutions.nl/starterkit3bc-compleet) (about 58 euro at the time of writing)
- Behringer UCA 202 Soundcard (https://www.bax-shop.nl/externe-audio-interface/behringer-uca-202-usb-geluidskaart?gclid=CjwKEAjwutXIBRDV7-SDvdiNsUoSJACIlTqlOT9Xsdn_RSRH-XZfrDbUwIPPu_8-EZcwRDPnG7bJzxoCNw3w_wcB) (About 27 euro at the time of writing)
- IQaudIO Shairport-Sync Image (http://www.iqaudio.com/downloads/IQ_ShairPortSync.img.zip) (free, thanks guys!)
- Win32DiskImager (http://www.raspberry-projects.com/pi/pi-operating-systems/win32diskimager) (free, thanks guys!)
First I assembled the Raspberry (put the Raspberry in it’s case and close the case) and connected the USB-Audiocard.
Then I wrote the image to the SD-card using Win32Diskimager.
After booting, I changed the rights on the following files to enable the user ‘pi’ to write to these files:
I created a LSB-enabled bootscript that does the following:
- Check if there is a file reboot.cmd -> If there is, reboot the raspberry with the ‘sudo reboot’ command.
- Check if there is a file wifiscan.cmd -> If there is, scan for wifi-networks using the ‘sudo iwlist wlan0 scan’ and output the info to a file wifi.list
After that I have installed an FTP-server on the raspberry and made it listen to port 35643 (randomly chosen). The password for the user pi was changed to a long password to prevent evil takeover of your home-speakers 😉
After that I have created a small program using PureBasic that does the following:
- Get the IP-address(es) of the computer it is running on and scan the network using the first 3 characters of the IP-Address (so IP-address 192.168.178.30 would result in a scan of all IP-addresses from 192.168.178.1 to 192.168.178.254)
- If port 35643 is open (and connected within 100ms) open a FTP-connection to the raspberry and download the files /etc/shairport-sync.conf and /etc/wpa_supplicant/wpa_supplicant.conf
- Read the data (Airport-name and Wifi-Networkinformation) from these files and show on the screen
The screen can look like this:
The connected KSSI-nodes can now be reconfigured quite simply;
- Click on the node
- Change the PlayerName (into e.g. Toilet)
- If you want to connect it to Wifi, click ‘Scan’ and (after scanning) select the correct Wifi-network and enter the Wifi Password
- Click ‘Save settings’
The program will now log into the raspberry and change the configuration and reboot the device. The new settings apply.