{"id":971,"date":"2023-10-06T05:42:01","date_gmt":"2023-10-06T05:42:01","guid":{"rendered":"https:\/\/iotmanager.org\/?p=971"},"modified":"2023-10-06T05:42:01","modified_gmt":"2023-10-06T05:42:01","slug":"%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%b0-%d1%81-mp3-%d0%bf%d0%bb%d0%b5%d0%b5%d1%80%d0%be%d0%bc","status":"publish","type":"post","link":"https:\/\/iotmanager.org\/en\/2023\/10\/06\/971\/","title":{"rendered":"Working with an mp3 player"},"content":{"rendered":"<p>The firmware provides the ability to connect an mp3 player and play files from it.<\/p>\n\n\n\n<p>Pleer management can be implemented by calling events from the script, Telegram, and possibly the application and web interface (you need to try)<\/p>\n\n\n\n<p>Connecting to the module:<\/p>\n\n\n\n<p>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).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/iotmanager.org\/wp-content\/uploads\/2023\/10\/image-40.png\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"450\" src=\"https:\/\/iotmanager.org\/wp-content\/uploads\/2023\/10\/image-40.png\" alt=\"\" class=\"wp-image-972\" srcset=\"https:\/\/iotmanager.org\/wp-content\/uploads\/2023\/10\/image-40.png 800w, https:\/\/iotmanager.org\/wp-content\/uploads\/2023\/10\/image-40-300x169.png 300w, https:\/\/iotmanager.org\/wp-content\/uploads\/2023\/10\/image-40-768x432.png 768w, https:\/\/iotmanager.org\/wp-content\/uploads\/2023\/10\/image-40-18x10.png 18w, https:\/\/iotmanager.org\/wp-content\/uploads\/2023\/10\/image-40-600x338.png 600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/figure><\/div>\n\n\n<p>Operation script for starting and stopping from the app:<\/p>\n\n\n\n<p>if var1 == 1 then mp3.randomAll();<br>if var2 == 1 then mp3.stop();<br>if var3 == 1 then mp3.playFolder(11,004);<br>if var4 == 1 then mp3.disableLoop();<br>if var5 == 1 then mp3.enableLoop();<\/p>\n\n\n\n<p>On Yandex. Disk, you need to create a folder structure marked with numbers. Inside the folders are digital file names 01-99. mp3<br>You can run a separate file from the desired directory, for example with var3, or run a random file. Playback may be looped.<\/p>\n\n\n\n<p>Commands available from the script:<br><br>MP3.enableLoop(); &#8212; \u0432\u043a\u043b \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u0432\u0430\u043d\u0438\u044f<br>MP3.disableLoop(); &#8212; \u0432\u044b\u043a\u043b \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u0432\u0430\u043d\u0438\u044f<br>MP3. randomAll (); - randomly launch a file from the SD card<br>MP3.stop(); &#8212; \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u0435<br>MP3.playFolder(\u043d\u043e\u043c\u0435\u0440 \u043f\u0430\u043f\u043a\u0438, \u043d\u043e\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430); &#8212; \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<br>MP3.volume(\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438); &#8212; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438<\/p>\n\n\n\n<p>View of this scenario from the app:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/iotmanager.org\/wp-content\/uploads\/2023\/10\/image-41.png\"><img decoding=\"async\" loading=\"lazy\" width=\"320\" height=\"379\" src=\"https:\/\/iotmanager.org\/wp-content\/uploads\/2023\/10\/image-41.png\" alt=\"\" class=\"wp-image-973\" srcset=\"https:\/\/iotmanager.org\/wp-content\/uploads\/2023\/10\/image-41.png 320w, https:\/\/iotmanager.org\/wp-content\/uploads\/2023\/10\/image-41-253x300.png 253w, https:\/\/iotmanager.org\/wp-content\/uploads\/2023\/10\/image-41-10x12.png 10w\" sizes=\"(max-width: 320px) 100vw, 320px\" \/><\/a><\/figure>","protected":false},"excerpt":{"rendered":"<p>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) Connection to the module: Tested 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 should be included in the description \u2026 <a title=\"Working with an mp3 player\" class=\"read-more\" href=\"https:\/\/iotmanager.org\/en\/2023\/10\/06\/971\/\" aria-label=\"More on \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 mp3 \u043f\u043b\u0435\u0435\u0440\u043e\u043c\">Read more<\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[76],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/posts\/971"}],"collection":[{"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/comments?post=971"}],"version-history":[{"count":1,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/posts\/971\/revisions"}],"predecessor-version":[{"id":974,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/posts\/971\/revisions\/974"}],"wp:attachment":[{"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/media?parent=971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/categories?post=971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/tags?post=971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}