This is the software for version 2.0 of my contactless music player for kids. I built the first version in 2016 and the second version in 2023. For the second version, I rewrote the software in Python and added proper Spotify support.
The player uses MPD (Music Player Daemon) for local music playback and the Spotify API for streaming music. gpiozero is used for handling button presses and RPi.GPIO for LED control.
- Install requirements:
pip install -r requirements.txt
- Install a spotify client, e.g. Spotifyd
- Install and setup MPD and MPC
- Setup environment variables in env.py (see example config)
- Run the script with
python main.py
The original version of the software supported local music playback with MPD. It used a simple shell script for reading RFID cards and handling audio playback. Button presses were sent to the Raspberry Pi via infrared using lirc. The original version written in Bash can be found here.