-
1Setup Raspberry Pi Spotify Connect Device
- Install raspberrypi os https://www.raspberrypi.com/software/
- install raspotify https://dtcooper.github.io/raspotify/
- configure raspotify for username/password auth (/etc/raspotify/conf)
- configure raspotify for playback settings
- (optional) configure DAC
- restart raspotify
Hints:
xz -d < 2022-09-06-raspios-bullseye-armhf-lite.img.xz | sudo dd of=/dev/sdg bs=4M conv=fsync status=progress touch /run/mediaXXX/boot/ssh openssl passwd -6 vi /run/media/xxx/boot/userconf.txt
Headless rpi setup: https://www.raspberrypi.com/documentation/computers/configuration.html#setting-up-a-headless-raspberry-pi
Setup user: https://www.raspberrypi.com/documentation/computers/configuration.html#configuring-a-user
SSH enable by adding `ssh` file to boot partition: https://www.raspberrypi.com/documentation/computers/remote-access.html#ssh
sudo apt-get -y install curl && curl -sL https://dtcooper.github.io/raspotify/install.sh | sh
sudo vi /etc/raspotify/conf sudo systemctl restart raspotify.service
#LIBRESPOT_AUTOPLAY= #LIBRESPOT_DISABLE_CREDENTIAL_CACHE= LIBRESPOT_DISABLE_DISCOVERY= LIBRESPOT_BITRATE="320" LIBRESPOT_FORMAT="S24" LIBRESPOT_USERNAME="<username>" LIBRESPOT_PASSWORD="<password>" #TMPDIR=/tmp
HiFiberry DAC already included in upstream Raspberry Pi OS, but needs configuration. Note the kernel 5.14+ instructions.
https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/
-
2Configure Network
I assume the Spotify Connect device is functional and visible as a "device" in the Spotify interface (or API).
This is for NFC reader portion.
Factory reset if need:
- Remove power
- Hold down button A (or both if you don't know)
- Apply power
- Release button A
- Press button 0 (boot select button on PCB next to ESP32 module)
- Release button 0
- Wait 10 seconds
- Remove power
- Apply power and you are in factory reset state
Configure Network:
- Apply power
- Join WifiManager SSID with PSK `tayfunulu`
- Navigate to http://192.168.4.1
- Select SSID
- Enter WLAN PSK
- Submit
-
3Configure Spotify API
This requires a client which supports mDNS addresses. Most major web browsers and operating systems support mDNS. I have tested with Firefox on Fedora 36.
- Navigate to Spotify config address of device indicated on OLED
- Enter Spotify API client id: 4efe77ff069f45a79d7cc3279e2ba870
- Enter Spotify Secret: 8d52b8bd5e8f48ed96987d07d76adf37
- Submit
- Wait for device to reboot (~10-20 seconds)
- Web browser may timeout
- Click "retry" on web browser after 10 seconds
- Select Spotify Connect device
- Submit
-
4Configure Tag Data Source (optional)
- Hold down both play control buttons
- Navigate to IP address indicated on OLED
- Enter full API JSON URL of airtable sheet
- Ignore other fields and links
- Submit
Airtable URL example:
https://api.airtable.com/v0/<app id>/<table id or name>?api_key=<api key>
if your URL in your browser looks like https://airtable.com/appaHNgIJQBNzJHh4/tbl0sgem3IxeTgFw0:
appid = appaHNgIJQBNzJHh4
tableid = tbl0sgem3IxeTgFw0api_key is from https://airtable.com/account page.
NB: this is a privileged key. -
5Program NFC Tags
TODO
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.