Bluetooth only hardware with web streaming ability

Hi all,

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!

Cool, first post in the international corner :+1:

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 :slight_smile:

Thanks for the reply.

Just to be 100% clear, I want to stream from the ESPuino to a speaker via A2DP (it’s actually an Amazon echo speaker).

I saw some external bluetooth boards (KCX_BT_EMITTER) but I think to use this I’d also need an external DAC board ?

That’s possible currently. @tueddy developed it in order to use BT-headphones.

Yes, because without DAC there’s no analog output. Maybe have a look at UDA1334 breadboards.

Thanks and just to check, that „BT headphones“ mode also requires that Wifi is disabled to allow the BT connection to work?

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:

Am I correct in understanding that MicroSD is mandatory even if I do not intend to use it for any audio files (everything is streamed) ?

ESP1 => I2S-DAC => BT-Chip ==> ESP32
So in fact ESP32 wouldn’t know anything about streaming via BT

@tueddy You changed this behaviour, right? When I remember right at dev-branch meanwhile it’s possible to disable SD completely with outcommenting ESPuino/src/settings.h at 97e536424a8f16571c88567c7878507322fd5e4c · biologist79/ESPuino · GitHub (and line 67 as well).

2 „Gefällt mir“

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

Ah OK, i understand now, nice setup!

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 :thinking:

Hopefully I will have more time tomorrow to test further.

mdns is crappy, have you tried the ip direct? or the hostname alone?

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.