Recently we started facing BLE disconnect issues between our BLE peripheral (microphone) and iOS app that we're having trouble solving.
iOS App: Ionic Capacitor using @capacitor-community/bluetooth-le Microphone Peripheral: esp32 board using ESP-IDF Apache NimBLE stack
App use case: Our app records a sound clip using the BLE microphone and sends data via a characteristic. The sound clip is broken up into several packets and all sent over ( over 1600 packets ). The microphone has an antenna and boosted signal as well.
The Issue: Recently, we've been facing consistent disconnects between the microphone and the iOS app that we think we've narrowed down to the iOS device is disconnecting due to too many dropped packets. It seems the phone can't get further than roughly 10 feet before we see packet loss. Up until recently we had little to no range issues with transferring data and settings disconnected from the microphone while being much further away. Nothing has changed on our end on either the app or microphone firmware side.
We use the same microphone firmware and app on Android and have no issues with range or dropped packets.
It also seems like we can transfer a couple recording , like 2 or 3 ( each with its own connection i.e scan and connect , subscribe to characteristic and gather all the packets , do some processing then disconnect and start over ), without issue than every attempt at gathering the packets starts failing because of disconnects.
Does anyone have any idea what might be going on?
Do we need to fix our connection parameters? This seems to be mostly an issue since the newest iOS updates ( 18.3,18.3.1 ) however we've tested on previous versions and are now seeing same ble range issues.
Any help or guidance on tracking down what's going on is appreciated.
Relevant logs:
`32mI (273409) Task_send_audio:: esp_ble_tx_power_get(ESP_BLE_PWR_TYPE_DEFAULT) = 255[39m
[31mE (286869) main:: No MBUFs available from pool, retry..[39m[23;1H
[31mE (287519) main:: No MBUFs available from pool, retry..[39m[23;1H
[31mE (287769) main:: No MBUFs available from pool, retry..[39m[23;1H
[31mE (287919) main:: No MBUFs available from pool, retry..[39m[23;1H`
...
...
...
31mE (1622829) Task_send_audio:: send_audio_ble, couldn't send the audio totally, ***** unsubscribe from charactaristic[39m[23;1H
Peripheral connections parameters: