Auto Reconnect from Pipeline_A2DP_Sink Stream
Posted: Fri Jul 11, 2025 11:14 pm
Hello,
I have built and successfully run the Pipeline_A2DP_Sink_Stream ESP-ADF project onto my ESP32 WROOM compatible board. I can connect via Bluetooth and play music and respond to button presses so everything seems to be working fine. My problem is that I would like the ESP32 board to auto reconnect to the last known A2DP source that completed pairing when it is available. I have been able to make this work using esp-idf example code, I can't figure out what I'm doing wrong in the ESP-ADF code.
When my application code receives a connection indication from the Source device I save its BDA address. Then when it disconnects, it attempts to reconnect periodically using a call to:
esp_a2d_sink_connect(&priorBDA[0]);
This function returns with an ESP_OK status, but in the BT_GAP event handling I get a notice that the connection has failed due to a timeout. I can't figure out what I'm doing wrong. I have set up the Bluetooth stack to use SSP Just Works authentication, but for somereason, it isn't able to complete the authentication.
I was wondering if anyone has insight into what I might be missing,
Thanks in advance.
I have built and successfully run the Pipeline_A2DP_Sink_Stream ESP-ADF project onto my ESP32 WROOM compatible board. I can connect via Bluetooth and play music and respond to button presses so everything seems to be working fine. My problem is that I would like the ESP32 board to auto reconnect to the last known A2DP source that completed pairing when it is available. I have been able to make this work using esp-idf example code, I can't figure out what I'm doing wrong in the ESP-ADF code.
When my application code receives a connection indication from the Source device I save its BDA address. Then when it disconnects, it attempts to reconnect periodically using a call to:
esp_a2d_sink_connect(&priorBDA[0]);
This function returns with an ESP_OK status, but in the BT_GAP event handling I get a notice that the connection has failed due to a timeout. I can't figure out what I'm doing wrong. I have set up the Bluetooth stack to use SSP Just Works authentication, but for somereason, it isn't able to complete the authentication.
I was wondering if anyone has insight into what I might be missing,
Thanks in advance.