This is basically a frame to connect the two halves of an IKEA Dragan box (the bigger one) with a magnetic door latch:
(The magnet mount is called "flap" in the SCAD file, current size is 12x38mm with a hole distance of 27mm, feel free to customize this for your own magnets ... )
My speaker cover I used for this project can be found here:
I put a Raspberry Pi Zero W with Pimoroni's Phat Beat in it,
added a chinese RFID reader (less than 4 Eur),
a membrane button pad (less than 1 Eur),
a Visaton FRS8 M speaker (about 10 Eur) and made use of the wonderful piCorePlayer (with some home-grown Python scripts...):
Voilá, a small Squeezebox with RFID-card-selectable playlists!
Feel free to take the OpenSCAD file and modify as needed!
Now you're entering the experimental section - the uploaded scripts are made up of some hacked-together stuff that was extracted from another project ... and I am currently not able to setup the whole thing from scratch (without breaking the current installation).
The "backend" is a python script which connects to the Squeezeserver and sends "play", "pause", etc. commands to it. On top there are two scripts, one is responsible to detect button activity and the other reads input from the USB RFID reader to change the playlist.
RFID reader source code is based on this: https://github.com/MiczFlor/RPi-Jukebox-RFID/blob/master/scripts/Reader.py
Your Squeezeserver needs to have playlists prepared to have a matching ID in angle brackets. For example if you have an RFID card with ID "1234567890", you should create a playlist named "My cool playlist <12345678990>".
Available playlists are read by the scripts only at startup - or when a specific "service" ID is read. This ID needs to be defined as "SERVICETAG" in the beginning of script "squeezy.py".
You also need to modify /usr/share/squeezeboxserver/IR/Default.map (adapt for your installation...) on the Squeezeserver to let "pause" switch to play mode when off:
In section [off] change from
pause.* = dead
pause.* = modefunction_off->play
Basically, these are the steps to get everything up and running (I assume that you have the Logitech Media Server aka Squeezeserver already running on your local network):
- install picoreplayer on SD card
- resize filesystem via web gui
- configure picoreplayer audio output via webgui (select Hifiberry DAC Zero and then sysdefault:CARD=sndrpihifiberry as output setting)
- install tiny core extensions (via web gui or from commandline tce-ab) :
- Create (as root / via sudo) a workspace directory on /mnt/mmcblk0p2
- Change workspace owner to tc:staff
- create (as user tc) a folder "radio" in /mnt/mmcblk0p2/workspace
- copy my Python scripts to /mnt/mmcblk0p2/workspace/radio
Build evdev module (to access the RFID reader)
- download (and unzip) python-evdev from https://github.com/gvalkov/python-evdev to /mnt/mmcblk0p2/workspace
- run "python3.6 setup.py build" in the unzipped directory
- copy new module folder evdev from "build" to /mnt/mmcblk0p2/workspace/radio
Test it ...