Problem with disconnects - can I improve this?

Hello, 

I have a device that I want to operate on the lower range of RSSI (but still around -80dBm  and have problems with disconnect. I would like to understand if there is any software change I can change to improve connection reliability. See attached source file for my BLE class.

Much appreciated!

Jens

FILE: 


s10_ble.cpp

Parents
  • Hi Jens,

    There are some generic things you can do to improve performance under low signal conditions. Different products has different needs though, so all may not be auitable.

    • Use a long supervision timeout compared to the connection interval to allow for more retransmissions before supervision timeout occurs. This means that both reducing the connection interval and increasing the supervision timeout (or both), will reduce the likelyhood of disconnect due to supervision timeout.
    • Consider using Coded PHY (the 125 kbps variant) instead of 1 Mbps. This not as compatible though, particularily not with phones.
    • Consider using shorter packets, as with 1 Mbps PHY (and 2 Mbps for that matter), there is no forward error correction. So the longer the packet, the higher the likelyhood of an error within the packet.
    • Use higher Tx power (I see you are allready using 8 dBm so you will not be able to increase that without adding an external PA to the HW). Note that this will not help as much if the peer is using lower Tx power, as packets are going both ways (even if data is primarily going in one direclty, there are acknowledgment packets).

    Einar

  • Thanks for quick reply:

    1) OK - I think i have maxed out supervision timeout according to Apple spec (18sec)

    2) OK - Coded PHY is not compatible with iOS as I understand it.

    3) FOLLOW UP - How can I shorten the package size even further? The payload is only 4 bytes. What setting are you refering to?  When analyzing the packages in NRF Sniffer the "send handle value notification" is 38 bytes (from peripheral).

    4) FOLLOW UP - NRF52840 max at 8db as you say, do you know what iPhone is transmitting at? The reason for my question is that it would bring some light on wether or not a relay device could fix the problem.

    Other questions:

    5) I have tried listening to music using airpods at the exact same position that my device is, and that seems to work. Perhaps this implies that when the iphone is communicating with airpods, they increase TX power?

    Note I am using a Raytec based NRF52840 board, so the antenna config should be OK.

  • Hi,

    jber1 said:
    1) OK - I think i have maxed out supervision timeout according to Apple spec (18sec)

    That is good. But note that the relationship between supervision timeout and connection interval is important. If you shorten the connection interval and keep the same supervision timeout, that means that there are more connection events within the spervision timeout, so more packets has to be lost in order to trigger a timeout (there are more chances to get a packet successfully transfered).

    jber1 said:
    3) FOLLOW UP - How can I shorten the package size even further? The payload is only 4 bytes. What setting are you refering to?  When analyzing the packages in NRF Sniffer the "send handle value notification" is 38 bytes (from peripheral).

    If the actual data is 4 bytes this is allready wery short, so there is not much you can gain here. If packets were much longer you could have considered splitting the data and seding as two notifications instead.

    jber1 said:
    4) FOLLOW UP - NRF52840 max at 8db as you say, do you know what iPhone is transmitting at? The reason for my question is that it would bring some light on wether or not a relay device could fix the problem.

    I do not know, unfortunately. I suspect Apple may be changing the Tx power dynamically to optimize range and power consumption, but I do not know the details. Note that there is a limit to how high it can be though, as for instance in Europe the regulatory limit is 10 dBm (20 in the USA).

    jber1 said:
    5) I have tried listening to music using airpods at the exact same position that my device is, and that seems to work. Perhaps this implies that when the iphone is communicating with airpods, they increase TX power?

    Yes, that could be. But I assume the Airpods are using Bluetooth classic for Audio, which is very different for BLE (it also includes a simple forward error correction). Maybe there is also some propritary stuff on top that improve this further when using Apple devices in both ends, but that I do not know.

Reply
  • Hi,

    jber1 said:
    1) OK - I think i have maxed out supervision timeout according to Apple spec (18sec)

    That is good. But note that the relationship between supervision timeout and connection interval is important. If you shorten the connection interval and keep the same supervision timeout, that means that there are more connection events within the spervision timeout, so more packets has to be lost in order to trigger a timeout (there are more chances to get a packet successfully transfered).

    jber1 said:
    3) FOLLOW UP - How can I shorten the package size even further? The payload is only 4 bytes. What setting are you refering to?  When analyzing the packages in NRF Sniffer the "send handle value notification" is 38 bytes (from peripheral).

    If the actual data is 4 bytes this is allready wery short, so there is not much you can gain here. If packets were much longer you could have considered splitting the data and seding as two notifications instead.

    jber1 said:
    4) FOLLOW UP - NRF52840 max at 8db as you say, do you know what iPhone is transmitting at? The reason for my question is that it would bring some light on wether or not a relay device could fix the problem.

    I do not know, unfortunately. I suspect Apple may be changing the Tx power dynamically to optimize range and power consumption, but I do not know the details. Note that there is a limit to how high it can be though, as for instance in Europe the regulatory limit is 10 dBm (20 in the USA).

    jber1 said:
    5) I have tried listening to music using airpods at the exact same position that my device is, and that seems to work. Perhaps this implies that when the iphone is communicating with airpods, they increase TX power?

    Yes, that could be. But I assume the Airpods are using Bluetooth classic for Audio, which is very different for BLE (it also includes a simple forward error correction). Maybe there is also some propritary stuff on top that improve this further when using Apple devices in both ends, but that I do not know.

Children
No Data
Related