From d4c9a6d58295b4a321b24ebfbf5084234d1b5b24 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Fri, 29 Nov 2019 05:36:22 +0100 Subject: [PATCH] Documented API commands. --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 202c904..b1c51b2 100644 --- a/README.md +++ b/README.md @@ -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 24 followed by tracks 1-23. So your kid will get the "daily track" 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:///ws`. +* Through the serial console using an USB cable. +* Via HTTP POST request to `http:///cmd`, having the + command in the variable `cmd`. + +Supported commands are: +| Command | Action | +|---------|--------| +| `play ` | 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=` | Sets the volume to X (0-255). | +| `track_prev` | Starts the previous track, if available. | +| `track_next` | Starts the next track, if available. | +| `track=` | Starts playing track no. X of the currently playing album. | +| `reset_vs1053` | Resets the VS1053 audio chip. | +| `reboot` | Reboots ESMP3. | +| `add_mapping==` | Adds a mapping between RFID card and path +. See `play` for valid path formats. | +| `update` | Runs an update check. |