Instructables

RFID Controls for Spotify on OSX using hacked Mir:ror.

Picture of RFID Controls for Spotify on OSX using hacked Mir:ror.
Crappy weather in Paris... So this weekend is RFID weekend !

My Spotify account is used by my kids on a regular basis now and not all of them are old enough to read. A few lines of script later, and Spotify is accessible to all of them (which seems to already cause healthy fights, but let's stay focused...).

I used Mir:ror in a previous Instructable: it is a RFID reader that used to need a web service from a now dead company (Violet).

Said RFID reader can be accessed locally by simple scripts (including osascript).


What you will need for this project:

- a Mir:ror from violet (about 10 / 15 euros on ebay / in a garage sale these days)
- compatible RFID cards (any ISO14443A card, ebay is your friend)
- a Mac running OSX (mine is running 10.6.8). [minimum Intel-mac, running 10.5]
 
Remove these adsRemove these ads by Signing Up

Step 1: OSX

Picture of OSX
[note: I used to use node.js here but due to incompatibility with 10.5.8, I ended up modifying a hidapi example instead.]


Hidtest is a program that opens the device and reads from it. It is a modified example of the hidapi package. Details in step 4.


Copy the attached hidtest and spotify_osx.sh files into your home directory.
Then, in a terminal:

bash-3.2$ chmod 777 spotify_osx.sh
bash-3.2$ chmod 777 hidtest

start the script in a terminal

bash-3.2$ ./spotify_osx.sh

Step 2: Configuration / Usage

Picture of Configuration / Usage
1. Configuration

Basic commands (learn, lock, playpause, volUp, volDown) are stored in the script itself. You need to update tag ids with your own.

## RFID tags
cat > $tmp2 << EOF
00000462e6580c00000000000000 learn
000004a2e55b0c00000000000000 lock
000004f27a5f0c00000000000000 playpause
00000432f7620c00000000000000 volUp
000004e27d610c00000000000000 volDown
EOF



2. Usage

- lock/unlock the device using the lock card.

- playpause, volUp and volDown just do what they say.

- learn: with this card on the reader, the script will pair the next card with the current song. If the current song is paused, then the current location is also stored.


Voila...