A Python + Node.js music player driven by NFC or RFID tags.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Annika Backstrom 684eb1448b Update project for new NFC-EXPLORE build 4 months ago
bin Update project for new NFC-EXPLORE build 4 months ago
init Add systemd init file with hardcoded path 2 years ago
jukebox Update project for new NFC-EXPLORE build 4 months ago
static attempt client reconnection of closed websockets 2 years ago
templates Let templates handle their own dependencies 2 years ago
.gitignore Move media player path into config 2 years ago
LICENSE Add MIT License 2 years ago
README.md Update project for new NFC-EXPLORE build 4 months ago
Vagrantfile Add Vagrantfile 2 years ago
config.json.sample Move media player path into config 2 years ago
config.json.vagrant Filter out @F messages from mpg321 2 years ago
nodemon.json Create web UI for sending tags 2 years ago
package-lock.json Add package.lock 4 months ago
package.json Create web UI for sending tags 2 years ago
player.js Add checks for RFID error codes 2 years ago
requirements.txt Update project for new NFC-EXPLORE build 4 months ago

README.md

Rasperry Pi RFID Jukebox

Disclaimer: this is a perpetual work in progress!

This is a personal project of Annika Backstrom for using a Raspberry Pi as an RFID-controlled “jukebox”. Given an RPi with attached MFRC522, UIDs from 1K MIFARE tags can be associated with media (MP3 files) and actions (currently, STOP and PAUSE).

Components

  • Jukebox app with web frontend (node.js)
  • RFID tag reader (Python)
  • MP3 player (mpg321, not included)

Setup

This section is incomplete (of course) and parts are tuned to my setup and for my own convenience:

  1. Clone project
  2. Copy config.json.sample to config.json
  3. Edit config.json for your setup
  4. Install Node.js
  5. npm install (node.js dependencies)
  6. virtualenv lib # make a python virtualenv
  7. lib/bin/pip install -r requirements.txt

TODO: Can this be streamlined? Maybe move Makefile commands into npm commands.

config.json

The following keys are available:

  • port -- web server port
  • tag_reader -- path to tag reader script. jukebox expects the tag reader to spit out a unique string for each tag (e.g. 10 character hex UID)
  • mpg321 -- path to mpg321 executable. should be run in “remote control” mode (-R), reading commands from stdin.
  • stop_id -- id of the card that stops playback
  • pause_id -- id of card that pauses playback