Muhammad Hamza
Muhammad Hamza
DIIDevHeads IoT Integration Server
Created by Muhammad Hamza on 6/19/2024 in #edge-networking
working on a project which involes esp32 works as an Audio source, connects to Bluetooth
Hello everyone, I'm working on a project which involes esp32 works as an Audio source, connects to Bluetooth (bt) headset/speaker. The requirement is that, esp32 first scans and pairs to bt headset then transfers the audio source. After that, it will need to automatically reconnect to headset in either ways: - esp power reset - headset power reset - headset is put into the case, close the lid and then open the lid and take it out to the ears - ... The idea for reconnection is that, after pairing and the headset is in the bonded list, I use esp_bt_gap_set_scan_mode and set to connectable and discoverable My code is working fine with various of manufacturers such as Samsung, Sony, Realme, Google Pods. It auto reconnects to headset successfully in any situations listed above. Except Airpods Pro, It only gets connected first time in pairing mode. After that, rarely it gets reconnected and mostly nothing happens. At first I thought the airpods auto connects to other Apple's devices, so I did the factory reset on Airpods to remove all paired devices. However, it does not solve the issue. To reconnect, I need to put the Airpods to pairing mode and scan again. This is a stand-alone source code to reproduce the issue as below: https://github.com/tanmanh0707/esp32-bt-source I have 2 questions: 1. What is the reconnection mechanism? Wheather headset/client finds and initiates the reconnection to the source (esp) OR the source needs to initiate the reconnection? 2. Does anyone test esp32 bluetooth source with Airpod Pro before? And do you encounter this issue?
7 replies