This project is similar to my previous project https://www.hackster.io/abouhatab/if-the-allegations-are-not-legit-you-m-aws-t-edukit-326d38. In this project we're using the same Wi-Fi manager to make the project portable. When we power on the device, it will connect to the last known Wi-Fi. If it is not available, the device will start it's own Wi-Fi and wait for us to connect and tell it which Wi-Fi to connect to.
Once online, the device will automatically play the latest episode. We can then swipe the screen to the left to listen to previous episodes.
The list of episodes came from https://anchor.fm/s/6859654c/podcast/rss which is RSS link found at https://anchor.fm/arduino. Data about episodes including mp3 file location are in XML format so we couldn't use JSON parser which we used in the previous project. We could have used a parser for XML, but it was a lot easier to just grab the information we needed from HTTP response.
Unlike the previous project, we will not use any cloud service. To further simplify things, we will use Arduino IDE instead of PlatformIO.
First, we need to add ESP32 Board (M5Stack will not work here) in Arduino IDE. Details on how to do that are here. In summary, the correct URL to add in File > Preferences is:
https://dl.espressif.com/dl/package_esp32_index.json
We can now install the board in Board Manager.
Next we need to install couple of libraries. The first one is WiFiConnect Lite which can be installed from Library Manager.
The second library needs to be downloaded as zip file from https://github.com/schreibfaul1/ESP32-audioI2S/archive/refs/heads/master.zip. Once downloaded, we can go to Sketch > Include Library > Add.ZIP Library... to add it. With this new library we don't need to make any modification after download like we did in the previous project. We also don't need to keep rebooting the device after playing every mp3 file.
Finally, the bottom right corner must show the correct Port and Board before we click Ctrl+U to upload the code.
Demo
Comments
Please log in or sign up to comment.