KBM RFID HTTP API

GET /cmd.cgi

Parameters:

play

Play/stop audio file or HTTP audio stream, specified by file handle [1-32, or 0 for stop], file name [max. 120 characters], or stream URI [internet radio or local audio server].

GET /cmd.cgi?play=1
GET /cmd.cgi?play=sound.mp3
GET /cmd.cgi?url=http://mp3.live.tv-radio.com/fip/all/fiphautdebit.mp3

vol

Set volume [0-100].

GET /cmd.cgi?vol=50

autoplay

Enable/disable automatic start of stream playback.
If an audio stream is defined with the url command, it will be automatically opened when the RFID reader is powered up, or will resume playing after a local audio file is played with the play command or after a tag is detected.

GET /cmd.cgi?autoplay=on
GET /cmd.cgi?autoplay=off

rfid

Enable/disable RFID reader.

GET /cmd.cgi?rfid=on
GET /cmd.cgi?rfid=off

rfidurl

Set URL for RFID notification. The scanned RFID is added to this url and then a HTTP GET request is executed.
The response to the request may be a play command (e.g. play=slurp.mp3), which will then trigger the playback of a audio file.

GET /cmd.cgi?rfidurl=http://192.168.1.1/rfid/

tag

Tag audio file with RFID.
After this command, the reader will wait for up to 5 seconds until a RFID tag is detected. The audio file specified by its file handle will then be tagged with this RFID. It will be played whenever this RFID tag is detected.

GET /cmd.cgi?tag=1

anytag

Set default audio file.
The audio file specified by its file handle will be played when any RFID tag is detected.

GET /cmd.cgi?anytag=1

untag

Untag audio file.
The RFID tag attached to the audio file specified by its file handle will be removed.

GET /cmd.cgi?untag=1

del

Delete audio file.
The audio file specified by its file handle will be removed. If all is specified as file handle, all files will be removed.

GET /cmd.cgi?del=1
GET /cmd.cgi?del=all

led

Set default LED state.
The LED will be normally on or off, depending on this value. When a RFID tag is detected, the LED will momentarily reverse its state for a duration of 500 ms. When an audio file is playing, the LED will reverse its state for the duration of the file.

GET /cmd.cgi?led=on
GET /cmd.cgi?led=off

flash

Enable/disable LED flashing while the RFID reader is enabled.
The LED will flash at a rate of 1 Hz with a duration of 100 ms when set and the RFID reader is enabled. If the default LED state is on, the LED will flash off.

GET /cmd.cgi?flash=on
GET /cmd.cgi?flash=off

save

Save settings in non-volatile memory.

GET /cmd.cgi?save=true

Response:

'ok' on succes.

POST /audio.htm

Request headers:

[example]

Content-type: audio/mpeg or audio/x-wav
Content-dispostion: form-data; name="audio" filename="sound.mp3"
Content-length: 21384

Body:

Formatted according to RFC2388 as multipart/form-data.

This type of request is used for uploading audio files. It is typically transmitted by a <input type="file" name="audio" /> element in a HTML <form>.
The audio files should be mono, in either mp3 (max 320 kbit/s) or wav (max. 16 bits @ 22kHz) format. Make sure the audio level is normalized to 0dB (maximum volume).