Raspberry Pi-powered display to view and control Spotify playback.
Features:
- View current playing song title and artist, liked status
- Play / Pause
- Like / Unlike
- Previous / Next song
Clone the repository: git clone https://github.com/jedclarin/spotipy-display
Turn on SPI after attaching e-paper display to Pi via GPIO.
- Open Raspberry Pi config:
sudo raspi-config
- Choose Interfacing Options -> SPI -> Yes Enable SPI interface
- Save config changes
- Reboot Pi:
sudo reboot
- Go to Spotify for Developers
- Log in / Make a spotify developer account
- Navigate to dashboard and create a new application
- Complete form, set Redirect URI to:
http://localhost
- Select Web API
- Save app
- Go to app settings
- Copy Client ID and Client Secret
- Open terminal in folder:
cd spotipy-display
- Create a
.env
file based on.env.example
with your Spotify Developer Application client ID and secret - Set up virtualenv:
python3 -m venv --system-site-packages venv
- Activate virtualenv:
source venv/bin/activate
- Install dependencies:
pip3 install python-dotenv RPi.GPIO Pillow spotipy numpy
Before configuring spotipy-display
to run automatically, test it first.
- Activate virtualenv:
source venv/bin/activate
- Run:
python3 main.py
- After confirming that it works quit with CTRL+C
- Add systemctl service:
sudo nano /etc/systemd/system/spotipy.service
# This assumes your username is also `pi`. Update accordingly. # /etc/systemd/system/spotipy.service [Unit] Description=Spotipy Service After=network.target [Service] ExecStart=/home/pi/spotipy-display/venv/bin/python3 /home/pi/spotipy-display/main.py WorkingDirectory=/home/pi/spotipy-display Restart=always User=pi Group=pi Environment=PATH=/home/pi/spotipy-display/venv/bin:/usr/bin:$PATH [Install] WantedBy=multi-user.target
- Reload systemctl:
sudo systemctl daemon-reload
- Enable
spotipy-display
:sudo systemctl enable spotipy.service
- Start
spotipy-display
:sudo systemctl start spotipy.service
- Monitor logs:
sudo journalctl -fu spotipy.service
- Reboot Pi to ensure everything works :)