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

keeping connection alive for long times

Hello,

I am using the nRf8001 and successfully connecting to an android device, but I still have some doubts related to the BLE protocol itself, specifically to the connection interval.

Suppose I want to send some data to the central device once per minute. According to what I understood, if I spend more time than what is in "Connection supervision timeout" field the connection will be dropped. So I should constantly reconnect to the device from the app side, is that correct? Is there any more elegant way to keep the connection alive without sending data at smaller intervals from the peripheral? (my application has tight power requirements).

That said, I've noted that even with "Connection supervision timeout"=100ms the device keep connected for 7~8 min before the connection is dropped, even without sending any data (Does the BLE have any link-layer keepalive mechanism?). But sometimes it disconnected after only a few seconds. And in another android device it always disconnect after a few seconds.

I've also noted that when the device goes out of range, the disconnection error code is 0x08 (timeout). So, when the device disconnects after a few seconds, I can´t be sure if I have a hardware problem in my RF circuit or a software problem. Is there some flag to indicate my disconnection was caused by a signal loss?

In summary, whats the best way to keep the connection alive and what is the expected behavior so I can I find out if I am having a hardware or a software problem?

Thanks in advance,

Parents
  • Hi Jaciroscar,

    Could you give me more information on the connection parameters (connection interval, slave latency, connection timeout) that you used for your device ?

    If you have connection timeout = 100ms and if you have connection interval = 35ms for example, the connection may be timed out if there are 3 packets drop. This could very easily happens if there is some interference. If you can provide a sniffer trace, it would be useful.

    I do agree that it's not very stable on some Android phones to keep the connection for a long time, but I'm talking about several hours or days not just few minutes as in your case.

Reply
  • Hi Jaciroscar,

    Could you give me more information on the connection parameters (connection interval, slave latency, connection timeout) that you used for your device ?

    If you have connection timeout = 100ms and if you have connection interval = 35ms for example, the connection may be timed out if there are 3 packets drop. This could very easily happens if there is some interference. If you can provide a sniffer trace, it would be useful.

    I do agree that it's not very stable on some Android phones to keep the connection for a long time, but I'm talking about several hours or days not just few minutes as in your case.

Children
No Data
Related