Documented API commands.

This commit is contained in:
Fabian Schlenz 2019-11-29 05:36:22 +01:00
parent 5fe66fdaef
commit d4c9a6d582

View File

@ -145,3 +145,28 @@ will play. On December 2nd, track 2 followed by track 1. On
December 3rd, tracks 3, 1 and 2. From December 24th on, track December 3rd, tracks 3, 1 and 2. From December 24th on, track
24 followed by tracks 1-23. So your kid will get the "daily track" 24 followed by tracks 1-23. So your kid will get the "daily track"
first, followed by all previous tags in the right order. first, followed by all previous tags in the right order.
#### API
You can send commands to ESMP3 using three different ways:
* Through a websocket connection to `ws://<IP>/ws`.
* Through the serial console using an USB cable.
* Via HTTP POST request to `http://<IP>/cmd`, having the
command in the variable `cmd`.
Supported commands are:
| Command | Action |
|---------|--------|
| `play <PATH>` | Starts playing the given path. Path may be a path on the
sd card or a http(s) URL of a webstream (direct links to mp3/4/ogg streams,
PLS files, M3U files or podcast XML feeds are supported). |
| `play` | Continues playing the previously played thing. |
| `stop` | Stops playing. |
| `volume=<X>` | Sets the volume to X (0-255). |
| `track_prev` | Starts the previous track, if available. |
| `track_next` | Starts the next track, if available. |
| `track=<X>` | Starts playing track no. X of the currently playing album. |
| `reset_vs1053` | Resets the VS1053 audio chip. |
| `reboot` | Reboots ESMP3. |
| `add_mapping=<ID>=<PATH>` | Adds a mapping between RFID card <ID> and path
<PATH>. See `play` for valid path formats. |
| `update` | Runs an update check. |