Spotify now playing on an OLED screen, with a volume dial
Added controls to skip or go to previous track will be added in an upcoming version.
- Raspberry Pi (or similar) with an internet connection
- I2C or SPI OLED display
All Spotify API requests are made through Spotipy, a lightweight Python library for the Spotify Web API, where all methods in this library require user authorisation.
So, you will need to register yourself and create an app on the Spotify My Dashboard to get the credentials necessary to make calls (a client id and client secret).
Log into this dashboard with your Spotify account and note the credentials shown.
- python3
sudo apt-get install python3
- pip3
sudo apt-get install python3-pip
- libopenjp2-7
sudo apt-get install libopenjp2-7-dev
- Connect OLED & configure rpi settings to enable it. External guide for this here.
- Use pip3 to install the following Python libraries
- Modify config.txt with your app credentials from the Spotify developer dashboard.
Note: You may now wish to modify screen variables in Spotify_Oled_Control.py to suit resolution, I2C/SPI, etc values for your OLED display.
- Copy spotify-oled.service from the repo to /etc/systemd/system/ and run
sudo systemctl enable spotify-oled.service
(You can also replaceenable
withstart
orstatus
for manual starting/stoping the service)
Note: It maybe be necessary to run
sudo chmod +x Spotify_Oled_Control.py
for autostart to work in some cases...
Big Credit to Alex, my housemate, for getting the ball rolling for this project, creating the services file and collab'ing on this project.
- Alex Hockly - @alhockly