I have designed an internet radio using the new ESP32 TTGO T-Display and controlled by bluetooth from an android phone.
To make this work I had to use the external HC-05 bluetooth module as simultaneous wifi and bluetooth on an esp32 is problematic.
The sound is from a DAC module UDA1334A connected to an amplifier.
The url's for the radio are held in 6 different categories Trance, Lounge, UK, Talk, Dance, and Disco located in header files. Edit these as you wish or if some Url's fail to work.
The streaming is quite processor demanding and successive rapid button presses may crash the android app or the Arduino. Just close the app and reopen it. Also a few URL's may crash the Arduino causing it to reboot. Note the problem URL and remove it from the header file. This is a problem with the audio library not being designed to handle stream errors.
You need to edit the ino putting in your own router information, router SSID and Password before you compile the code.
Download and install the android pkg to your phone, it may complain that it could be malicious.. I promise you it is not.
Before opening the app turn on the phone bluetooth, connect the phone to the Arduino default ID is HC-05 password 1234. Then open the app and select HC-05 from the list.
The app can be closed at any time, you just need to re-open and reconnect the bluetooth.
The specific libraries I have used are
ESP32-audioI2S :: GitHub - schreibfaul1/ESP32-audioI2S: Play mp3 files from SD via I2S
ESPSoftwareSerial :: GitHub - plerup/espsoftwareserial: Implementation of the Arduino software serial for ESP8266
This overwrites the original SoftwareSerial library and supports ESP32
As i update the Arduino code i may also need to update the Android apk. I will give them the same version numbers so not to confuse. Try to use the ones with the same version numbers (uninstall the app.. reflash the TTGO).. if not the app may hang (nothing serious).
I've noticed that the new Android phone update will close the app saying it lacks permission. In that case, open the app settings on your phone and change the 'nearby device' setting to allow.
Comments
Please log in or sign up to comment.