The “music by cards” project has gone from an arduino-based ip card reader to a complete solution that allows storing and playing music, controlling this process with the help of mifare ultralight RFID cards.
The device was intended as a gift to a friendly child and his parents, so the article was built in the genre of instructions for three categories of users: children, adults and programmers. For those who are interested only in the internal structure of the box, it is better to go straight to the third part of the article. ')
Children's version
Attach the card to the flower on the box. Music will start playing. People older than 3 years at this moment usually experience stormy joy.
Adult version
How to tie a new card.
1. Open the network folder \\ rfidmusic \ music 2. Bring a new card to the reader. 3. A file named card_id.xxxxxxxx will appear in the music folder, where xxxxxxxx is the unique card number. 4. Create a folder named xxxxxxxx, record music there.
How to record a new music or remove old.
1. Copy the new music to the existing catalog corresponding to the card number or to the new catalog created as described in the “How to link a new card” section. 2. Create an update directory in the folder \\ rfidmusic \ music. Within 5 minutes, new music will be indexed and will be available for playback. The update directory will then be automatically deleted.
Version for programmers
Iron
The box is a Raspberry Pi microcomputer with RFID card reader and WiFi dongle connected. There were no problems when connecting peripherals to RPi, everything worked immediately and without problems, it was enough to register the SSID and password from the WiFi network. The connection scheme of the RFID reader is described in [3].
Soft
consists of three modules:
1. Samba server. A music catalog is available on the home network at \\ rfidmusic \ music. Music is stored on the same SD card from which the system is loaded.
2. Music server. This is MPD (http://en.wikipedia.org/wiki/Music_Player_Daemon) in the standard configuration. To this music server there are clients under everything that moves, in particular, there are programs for android (mpdroid) and iphone (MPaD). Those. You can control music not only with cards, but also in the usual way, from a phone, a computer, etc.
3. Card reader. Each card has a unique number. If in the folder with music there is a directory with the same name as the card number, then the music from this directory will start. In any case, a file with the name card_id.xxxxxxxx is created in the music folder, where xxxxx is the unique number of the last card brought to the reader. The reader is started from / etc / inittab by the instruction
RF:23:respawn:/home/pi/rfid/run.sh
4. Indexer of new music. Once every 5 minutes, check for the presence of a directory named update in the folder with the music. If it is there, then MPD rereads all the music (with the mpc update command) and deletes the update directory. The indexer is launched from the crown of user pi.
Links
(the first version of the "music on the cards" ran Squeezebox player th)