periodic BLE disconnects with iOS11

We have a BLE system in which our iPad mini App connects (using CBCentralManager) to a Nordic embedded BLE peripheral which we have also developed. The peripheral detects pressure and sends it to the App at around 10hz. This has all worked great for a couple of years.

We recently upgraded the iPad mini to iOS11, and we are seeing a strange thing: every minute or two it disconnects spontaneously. We see this on iOS11, not iOS10 (all else equal). While debugging I see that our handler is called:


- (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error


with NSError data seemingly code=0. I'm kind of at my wit's end, not even sure how to troubleshoot... is there any tracing or call stack examination that can give me a clue as to why this is happening?

Replies

Is this thing on?

I am getting the same problem with iOS 11.1, 11.2 (beta) and a Nordic BLE embedded device. I am observing a periodic disconnect, approximately every 3 minutes. Can also confirm I do not see this behaviour with iOS 10 or on Android. Initially suspected incompatibility between iOS 11 and Qt 5.8 BLE QLowEnergyController library. When the disconnect occurs I get " [CoreBluetooth] XPC connection invalid" message, which seems to originate from CoreBluetooth and not the Qt libs. Have also tested without Qt library using https://github.com/NordicSemiconductor/IOS-nRF-Toolbox.git app, compiled with XCode Version 9.2 beta (9C32c) and run on iPhone6+ and iPad Pro with iOS 11.2 beta. Connects to the Nordic BLE device with UART service, but after 3 minutes I get "[Callback] Central Manager did disconnect peripheral Error Code: Unknown error",but with iOS 10 the connection is stable.

I'm seeing the same issue with an app I developed which connects to a digital model racing track. On iOS 11 the disconnect happens every ~90 seconds (didDisconnectPeripheral) reproducibly. The same implementation works perfectly fine on iOS 10 and Android. I already tried to play around on my end with adding delays for polling the data and so on - everything to no avail until now...

@mrappledev, could you maybe measure the time until the disconnect happens? As I said, for me it is reproducibly always the same time (I didn't measure it exactly, but it's around 90 seconds).

@qpwr, it is not *exactly* 90 seconds but it is in that ballpark. It varies, I believe it ranges from a little over a minute to over two minutes. Next time I;m wired up I will time it next chance I get.


@CRoets funny that we are both using nordic. I'm trying to learn about "connection parameters" which I wonder have changed their acceptable ranges on one side or the other. I read that a mismatch doesn't necessarily prevent connection, but could make it unstable. Have you looked into the connection parameters? Maybe the ranges have changed in iOS11.

I am not getting any periodic disconnect on iOS 11.2 (beta) running on iPhone 7, using a Dialog Semiconductor IC. If possible you should try and use an air sniffer device to see which device is initiating the disconnect (or if it is just a packet timing issue for example).

@mprappledev changing the connection parameters is definitly the solution , we changed our device connection parameters to within the recommended intervals for establishing and holding a connection successfully , and this seems to work, not sure if these ranges have changed for iOS11 or are just now more apparent , also I do not think this issue is isolated to nordic BLE... https://developer.apple.com/library/content/qa/qa1931/_index.html

That's great news! Can you point me in the right direction? Do you change these on the nordic side or the iOS side? Where in code are they set? (On both ends the framework protects verty well you from needing to understand these details, until they don't. 🙂)

@mprappledev connection parameters was changed on the nordic side, our engineer had to modify his firmware and changed; the advertising interval to 40ms, minimum connection interval to 20ms and maximum connection interval to 75ms. I did not have to make any changes on the iOS side, hope this will help.

I'm getting the same disconnects on iOS 11.2 Beta.

Thanks! Two things: you're right the disconnects were *exactly* 90 seconds. And I was able to fix it too just by adjusting my max_conn_interval on the Nordic side. I'm a little fuzzy on the rhymes and reason here, hoping to gain insight from the Nordic folks (who are very very helpful).

Excellent that is good news, now for the next challenge DFU!

Did you ever solve this? I have a peripheral running on TI CC2640 that used to work just fine, but in iOS11 disconnects after ~90sec. I have changed the connection parameters as mentioned in this thread, to to no avail.