iosreact-nativebluetooth-lowenergycore-bluetoothios-bluetooth

iOS BLE unstable connection


I'm currently developing a react native app in combination with a device. The device and the app communicate via BLE. So far everything works as expected but I'm having issues with the connection stability of the iOS app and the device. What would happen is that the device would connect and I can update some characteristics but it would regularly either disconnect with a CBErrorDomain 7 or the response for a write would timeout. The implementation on the app or device side does not seem to be the problem as Android works stable and the device also disconnects when connecting with the LightBlue app.

I've already updated the BLE connection parameters as suggested here: https://developer.apple.com/library/archive/qa/qa1931/_index.html. This has increased the stability but did not resolve the problems completely. I've tried playing around with the values but so far no luck.

The current set of parameters we are using are:

conn_min_interval: 15
conn_max_interval: 15
conn_latency: 0
supervision_timeout: 2000
adv_min_interval: 1285
adv_max_interval: 1285

My question now would be if somebody has an idea what other things I could check or which parameter to tune?


Solution

  • Finally, I've found the answer to my problem. The problem was that the pairing procedure of the BLE server was faulty and thus iOS was unable to have a stable connection. Now that this is fixed the connection is very stable.

    I'm still unsure why iOS was able to have any communication at all without the pairing but I hope that this helps some people in the future.