I have built a project with Pi Zero-W, Scroll-pHAT, pHAT DAC, and Mopidy-Spotify.
I am interested in taking the currently playing tracks from Spotify and displaying this information (any any other cool information) on the Scroll-pHAT.
Making a client connection to this API will result in any change on the Mopidy end being pushed as a notification to the client, so Python could connect to the WebSocket API.
You can sudo pip install websocket-client on your Mopdify Pi and then run the below example to see what data you get out of your Mopidy install:
I’ll give this a go this evening and let you know how I get on.
Just as an aside, from watching some of the Bilge Tank episodes you guys seem to push Volumio a lot.
From purely a Spotify (and maybe connecting a NAS) perspective - what would you recommend for handling the audio?
Volumio was something we were playing with at the time, but it was a little too rough and ready for our radio kit. We’re keeping an eye on it though!
Mopidy + Spotipy is a really nice setup if you use Spotify. Just need to get the VU meter up and running properly, since I’ve been testing this code over the network rather than directly on the Mopidy Pi!
Hi @gadgetoid after a bit of playing about I did a fresh build of Mopidy again, I didn’t get to try the Python code yet.
Can you point me in the right direction to change the hostname of my Pi, in Sandys example he has it set to pirateradio.local:6680/iris, whereas I’m using my IP_address:6680/iris.
If you type sudo raspi-config, then select option 2, Hostname, then you’ll be able to change your hostname to whatever you’d like. You’ll need to reboot with sudo reboot after doing that.
Hi Sandy,
I’ve done that but and when I echo $HOSTNAME I get the correct hostname.
However, when I browse hostname:6680/iris or hostname.localhost:6680/iris I get an error saying the site can’t be reached…
Edit: Just to clarify, I’ve set the hostname to a unique name (no conflicts with other devices), I’ve also set the unique name in the [http] hostname = hostname then tried to connect to hostname.local on both my phone and laptop.
Ican connect via the IP but not the hostname.