Skip to content

A Python software engine to run a child friendly Jukebox that enables swiping RFID chips to trigger songs.

License

Notifications You must be signed in to change notification settings

thomashrabe/PyJukeBox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyJukeBox

Inspired by Toniebox but too cheap to buy one. Can not resist building your own? Could not get the installtion for Phoniebox to work so , bored by COVID19 lockdown here is a simple Python engine for RFID card enabled MP3 players on a Raspberry Pi. Jukebox in use

Requirements - Hardware and Software

Here's a list of required hardware with Amazon links that I purchased. They can vary I think, especially the Raspberry Pi and the speaker. Raspberry Pi, RFID Reader, Speaker

  1. Raspberry Pi 4
  2. RFID Reader
  3. USB Speaker I was reading the 3.5 Rasbperry output usuall had a hum, so I opeted for the digital USB speaker solution.
  4. MicroSD
  5. PI Cover
  6. RFID Cards , I think you can also use RFID FOBs ans attach them to stuffed animals. But we opted for cards because you can paint on them.
  7. A box / container for the final Jukebox. We used a old gift box because of COVID19 lockdown, but planned to go through antigque shops for nicer solutions. Jukebox interior RFID cards allow to customize the cards in any way you like. Printed RFID cards with Disney, RockNRoll and other favorite tunes.

Setup

Download the headless Rasbian Buster release and follow the instructions how to flash the iso onto the MicroSD card. On a Mac, Etcher ran without any issue.

Next, enable Wifi connectivity on installed operating system.

Run touch /Volumes/boot/ssh to enable ssh on the headless Rasbian.

Copy

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="NETWORK_ID"
    psk="PASSWORD"
}

into

/Volumes/boot/wpa_supplicant.conf

(Note, the above path is for Macs, the mounted MicroSD might be in a different location if you are on Windows or Linux)

The Rapsberry with the now configured MicroSD should now be accessible through the your Wifi. Connect through ssh pi@REPLACE_PI_IP_HERE. The default pi password on Buster is raspberry.

Now, on the PI install the dependencies

sudo apt install vim
sudo apt install ipython3
sudo apt install python3-pip
sudo apt install evtest
sudo pip3 install evdev
sudo pip3 install python-vlc

How to determine device path for USB RFID reader

Run evtest and lsusb. If no other USB device is plugged to the PI, evtest will output the RFID device path.

Setup Media db

Create a JSON file of the format

{
    "RFID_CODE" : "/path/to/a/audio/file.mp3"
}

Start JukeBox

<install_path>/jukebox.py --db <your_db>.jdbd -i /dev/event/rfid_reader_id

About

A Python software engine to run a child friendly Jukebox that enables swiping RFID chips to trigger songs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published