Rfid card reader

Im trying to get Volume to work with a Rfid card reader. The card reader works fine and managed to get socket.io to work also for things like Volume up, pause etc…

I haven’t managed yet to play a track or playlist from Spotify with a card, I can’t figure out how to edit io.emit command for that. Would be very grateful for any help, if possible in Python please :slight_smile:

The below example works to rise the volume,

from socketIO_client import SocketIO

with SocketIO('localhost', 3000) as socketIO:
        socketIO.emit('volume', '+')

But to play a Spotify playlist?? the below line doesn’t work and I have no idea how to write it…

socketIO.emit(‘playPlaylist’, ‘spotify:user:b123456:playlist:7KQZBjITKdcPvRjX5OXf6U’)

I yet had not the time to check if it works but to me this looks like a promising direction…
replace the second uri with your desired url

addToQueue {'uri:uri'}

maybe this helps?
https://volumio.github.io/docs/API/WebSocket_APIs.html

in the upcoming days/weeks I will try to get “local/nas” playback running via usb rfid reader…

I’m trying to do something similar, but trying to install phoniebox or some other pre developed package. Have you had a look at anything like this? I’m sure it’s far more bloated than your system but might give you some insight into what they’re doing, they have an option to play a spotify playlist via RFID.

I have wired up a card reader to my Raspberry Pi and have released the software and instructions on Github: github.com/tinkerthon/volumio-rfid

With this, you can link RFID cards to Spotify URLs hand have them played whenever you put a card on the reader. The card id/URL pair is managed in a (free) Airtable CMS.

Enjoy,
– OIav