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 F8 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 OpeCAD file and modify as needed! Python Scripts 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 itallation). 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 respoible 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: Squeezeserver 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 "". You also need to modify / (adapt for your itallation...) on the Squeezeserver to let "pause" switch to play mode when off: In section [off] change frompause.* = dead topause.* = 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): Base Itall itall 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) Prepare System itall tiny core exteio (via web gui or from commandline tce-ab) : python3.6 python3.6-dev
compiletc
"Itall" Scripts 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 to /mnt/mmcblk0p2/workspace run "python3.6 build" in the unzipped directory copy new module folder evdev from "build" to /mnt/mmcblk0p2/workspace/radio Test it ...
try to run everything manually -> go to /mnt/mmcblk0p2/workspace/radio and run
very likely to fix a lot at this point... there might be further Python module dependencies I've forgotten. Or woe... Autostart
Add startup command to /opt/: cd /mnt/mmcblk0p2/workspace/radio && . > /home/ &
Run "sudo -b" to backup this file to SD. Reboot the Pi