This demo demonstrates the coexistence of Wi-Fi, A2DP and BLE.
This demo creates several gatt services and starts ADV. The ADV name is BLUFI_DEVICE, then waits to be connected. The device can be configured to connect the wifi with the blufi service. When wifi is connected, the demo will create http stream module. It can play music with http url.
The classic bluetooth A2DP part of the demo implements Advanced Audio Distribution Profile to receive an audio stream. After the program is started, ohther bluetooth devices such as smart phones can discover a device named ESP_COEX_EXAMPLE
. Once a connection is estalished, use AVRCP profile to control bluetooth music state.
This example is will run on boards marked with green checkbox. Please remember to select the board in menuconfig as discussed is section Usage below.
Board Name | Getting Started | Chip | Compatible |
---|---|---|---|
ESP32-LyraT | |||
ESP32-LyraTD-MSC | |||
ESP32-LyraT-Mini | |||
ESP32-Korvo-DU1906 | |||
ESP32-S2-Kaluga-1 Kit |
make menuconfig
-
Enable bluetooth dual mode for a2dp and gatts.
-
Enable ble auto latency, used to enhance classic bt performance while br/edr and ble are enabled at the same time.
-
Enable PSRAM for coex-demo.
The sdkconfig.defaults
is recommended.
- Connect with Bluetooth on your smartphone to the audio board identified as
ESP_COEX_EXAMPLE
. - Conect with
ESPBlufi
APP on your smartphone to the ble device named "BLUFI_DEVICE", then configure the ssid and password to connect the Wi-Fi. - Press button
mode
to enter BT mode or WIFI mode, the audio board can play the music from http and a2dp stream.