This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Suddenly I'm seeing spontaneous disconnects in my iOS 7 app from my nRF51822 peripheral

Suddenly my app, running on iOS 7, is reporting lots of spontaneous disconnects by the peripheral device, an nRF51822, indicating a timeout:

didDisconnectPeripheral: Peripheral with UUID = 2F82C038-59AF-FA33-1963-644155D9CD09 disconnected, error = Error Domain=CBErrorDomain Code=6 "The connection has timed out unexpectedly." UserInfo=0x176d88c0 {NSLocalizedDescription=The connection has timed out unexpectedly.}

Also seeing lots of cases of service discovery reporting unknown error: didDiscoverServices: Error code was Error Domain=CBErrorDomain Code=0 "Unknown error." UserInfo=0x16d48850 {NSLocalizedDescription=Unknown error.},

This is a recent phenomenon, and I'm looking for some way of finding out what caused Core Bluetooth to report these. In the case of the timeout, what timed out? I assume this is coming from the interaction going on between CB and the peripheral, and CB possibly didn't get a response it was expecting? In the case of the service discovery error, it would help to know more about what CB is reporting with the unknown error code. Is there any way to get some additional feedback from CB? This is more a question for Apple and has been posted on the CB forum there, but maybe someone here has some insights.

  • I have a sniffer log file from a ComProbe sniffer that shows a termination happening, initiated by the peripheral. I could provide that, or a printout of a section of the trace, or a screenshot. Is there a way to upload files associated with this thread? (the editing tools plug in URL's but this file isn't available via URL)

  • Never mind part of that last post, that particular disconnect occurred because the device had not seen any traffic in 15 seconds and disconnected on it's own. The earlier disconnect described occurred spontaneously.

  • It's hard to be specific on issues like these, but having access to the sniffer trace and/or source code would be useful. Have you tried recreating the problem with Master Control Panel?

    Anyway, it seems that this isn't a good fit for this kind of question-and-answer site, so maybe it would have been easier if you could post this as a regular support case. Please include the sniffer trace when you do.

  • Hi Ole,

    I'll let Don address creating the support case and providing the sniffer trace.

    I can answer your question regarding Master Control Panel. I use the Master Control Panel extensively as I develop our embedded FW. The problem does not appear with the Master Control Panel. It appears to be some sort of interaction between the iOS Core Bluetooth and the Soft Device Stack. One observation I have made is that the Master Control Panel and Core Blue tooth have different methods to read out the services and characteristics immediately after the connection request/response.

  • Was this issue resolved? I have a similar situation where the connection disconnects when it is trying to discover the services. It seems to be connected to using an active oscillator from another processor. But all the bluetooth connection works once the service discovery completes.

Related