The firmware provides the ability to connect an mp3 player and play files from it.
Pleer management can be implemented by calling events from the script, Telegram, and possibly the application and web interface (you need to try)
Connecting to the module:
I tested it on the DFPlayer mini module. The module is powered by 3.3 V and Gnd, as well as an RX and TX connection. RX and TX must be included in the module description in the configuration (see figure).
Operation script for starting and stopping from the app:
if var1 == 1 then mp3.randomAll();
if var2 == 1 then mp3.stop();
if var3 == 1 then mp3.playFolder(11,004);
if var4 == 1 then mp3.disableLoop();
if var5 == 1 then mp3.enableLoop();
On Yandex. Disk, you need to create a folder structure marked with numbers. Inside the folders are digital file names 01-99. mp3
You can run a separate file from the desired directory, for example with var3, or run a random file. Playback may be looped.
Commands available from the script:
MP3. enableLoop (); — enable looping
MP3. disableLoop (); — off looping
MP3. randomAll (); - randomly launch a file from the SD card
MP3.stop () — - stop playback
MP3. playFolder(folder number, file number); - start playing a specific file
MP3. volume (volume value); - set the volume level
View of this scenario from the app: