First - Lovely looking project, I had the idea to build a NFC story / radio player for my kids using ESP and then came across this and was very happy to see other had led the way!!
My desired setup will not use wired audio at all (no 3.5mm socket) I need to send the audio via bluetooth, I also need the ability to stream from m3u on my network - which I understand is a problem (using both bluetooth and wifi at the same time).
I was hoping for guidance on the minimal hardware setup needed to achieve bluetooth sending while also using web radio / network streaming?
Would it be possible to just use 2x ESP32 (and 1 microSD board)? - One ESP configured with the ESPuino firmware to perform NFC reading and web radio stream, then somehow send the audio to the second ESP32 (via i2s?) which then broadcasts the stream via bluetooth?
I’m not sure if that’s possible or how the two ESP32s would connect, but I’d like to keep the hardware requirements as minimal as possible so avoiding DACs / AMPs etc if possible.
Any tips on how to achieve this would be appreciated!
You need a device that’s able to stream to ESPuino via A2DP. Due to memory limits it’s not possible to have ESPuino running in parallel with BT + WiFi.
Interesting question! @tueddy - we need your assistance
Sorry, gave a wrong answer previously.
In order to let ESPuino stream via A2DP from a source, that’s from the network (internet), it’s necessary to use an external BT-chip. Like you already proposed a bit later.
In order to connect this BT-chip you need a DAC. At least as there’s no BT-chip around that has i2s-support.
If BT is enabled on that ESPuino, WiFi can’t be enabled in parallel.
But that’s only true if you want to use ESP32’s builtin support for BT. If you make use of an external BT-chip, ESPuino wouldn’t know anything about that.
Thanks - I had thought that was the case, but wasn’t sure if @tueddy somehow worked around this for the headphone implementation.
I would be really interested to know if using 2x ESP’s is a feasible solution as I have a bunch laying around already and then (I assume) that I also wouldn’t need a DAC since they could talk i2s.
Eg:
Hi, that’s correct. DEV_Branch can work completely without SD card.
If BT is enabled on that ESPuino, WiFi can’t be enabled in parallel.
BT/WiFi coeexistencedoes does not work due to memory limitation. In theory it should be possible, see here
So if you want to stream from web to bluetooth i would recommend additional hardware like KCX_BT_EMITTER shown here
Thanks for the comments, I spent some time today with a few Esp32 and managed to get everything hooked up and sending some audio via Bluetooth.
I used 2 ESP32, one running espuino and another using a modified version of https://github.com/pschatzmann/arduino-audio-tools/blob/b15cbd9fb3fa93cf4b763421a7e05011ee62f780/examples/examples-stream/streams-i2s-a2dp/streams-i2s-a2dp.ino
The audio is sent via i2s from espuino to the second ESP32 where transmission over Bluetooth happens.
I can hear the sounds over Bluetooth and can make out the words but there is some noise, I think I could be due to clock rate or sample rate but I need to spend some time further looking at this…
So you use ESPuino as BT-Source (Audio Sender) and the other ESP32 as BT-Sink (Audio Receiver)?
To find the noise issue i would replace one device, for example use a mobile phone and stream music to the 2. ESP32.
Thanks for he tips, but my setup is a little different - espuino doesn’t handle BT at all (since I need the WiFi), it is outputting audio via I2S connected to the second ESP32 (via 3 wires).
The second ESP32 reads the audio data from I2S and then broadcasts it to the BT speaker.
See my image a few posts back, that’s pretty much how I have it configured
Maybe you have run into this issue ?
Do you compile with Arduino or PlatformIO? Crackling sound with I2S has been fixed in Arduino 2.0.13, this version is not yet available for PlatformIO yet, PIO package ist still on 2.0.11.
Maybe PSchatzmann can help, he is the real I2S audio expert.
Thanks for the link to that issue, I had not seen that. I am compiling with platformio but I am using master branch which from what I can tell is using an older version of espressif framework?
I did however try the dev branch but for some reason WiFi does not appear to work correctly - the log shows it reads the WiFi from Nvs and says it’s connected but gives an mdns error and the web UI is unavailable.
I tried to wipe the board and reflash so it published the adhoc AP but I cannot connect to the AP
Hopefully I will have more time tomorrow to test further.
Yes, sorry I should have said I was always using just IP anyway, but after the webui wasn’t available I figured maybe the web service didn’t start due to the logged mdns error.