Installs raspotify and displays cover art and song information for the currently playing song on a Pirate Audio display.
I wrote some code to display album cover art and song information for the currently playing song on a Pirate Audio display. This code is to be used in conjunction with raspotify (a project I have no affiliation with). The key advantage of this over mopidy is that my solution is lightweight, which results in better performance, especially, on a raspberry pi zero. Text that is too long to fit on the display scrolls, as can be seen in the two still images above.
The Python packages required to run
spotipy
os
time
Pillow
requests
io
ST7789
-
Attach pirate audio to raspberry pi (I used pirate audio with headphone out and a raspberry pi zero)
-
Connect raspberry pi to internet and ssh onto it (or control with GUI)
-
Set a new password
passwd
- Install all updates
sudo apt-get update
sudo apt-get upgrade
- Install the required apt packages
sudo apt-get install python3-rpi.gpio python3-spidev python3-pip python3-pil python3-numpy
sudo apt install libopenjp2-7 libopenjp2-7-dev libopenjp2-tools libatlas-base-dev
- Install the required Python packages
pip install st7789 numpy Pillow spotipy os time requests io
- Set the following parameters at the bottom of the /boot/config.txt file
sudo vi /boot/config.txt
dtparam=audio=off
dtoverlay=hifiberry-dac gpio=25=op,dh"
- Install raspotify
curl -sL https://dtcooper.github.io/raspotify/install.sh | sh
- Download this project and enter the project directory
git clone https://github.com/jb10181/spotify_zero
cd spotify_zero
- Create your .credentials file
spotify_pirate_zero_create_credentials.py
If you are not using a GUI to control the raspberry pi, you should run this command on another computer that has a GUI and copy the .credentials file into the spotify_zero directory of the raspberry pi afterwards.
- Set up the systemd service to run automatically and reboot
sudo cp spotify_pirate.service /lib/systemd/system/spotify_pirate.service
sudo systemctl daemon-reload
sudo systemctl enable spotify_pirate.service
sudo reboot now
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
James Burch - LinkedIn
Project Link: https://github.com/jb10181/spotify_zero