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

Dropped packets

Test Setup:

SD 6.1.0

SDK 15.2.0

Peripheral:  nRF52840

Central: iOS 13.1

Central is connected to two peripherals, each peripheral is sending 50 pkt/s, each packet has 13 bytes of payload. Connection interval is 30ms. Over hundreds of hours of testing this setup works great and we see no packet loss, however we now have one device which fails *sometimes*. We have three recordings where one peripheral is normal but the other peripheral shows  this pattern:

pkt-1, pkt-2, DROP, pkt-4, pkt-5, DROP, pkt-7, pkt-8, ...

We detect the drops by checking a continuity counter (cc) in the packet on the central device. The cc is an 8-bit value which increments for each packet sent by the peripheral. On the central we check each packet to make sure the cc value is equal to the previous packet +1.  

So.. any thoughts how to debug this? 

My first thought was to check error counters in the Nordic SD but could not find any nack counters or retransmit counters. iOS gives you nothing. 

Parents
  • Another data point:  I enabled debug logging in the GATT module and I see this in the logs:

     nrf_ble_gatt: Updating data length to 53 on connection 0x0.
     nrf_ble_gatt: Data length updated to 53 on connection 0x0.
     nrf_ble_gatt: max_rx_octets: 53
     nrf_ble_gatt: max_tx_octets: 53
     nrf_ble_gatt: max_rx_time: 2120
     nrf_ble_gatt: max_tx_time: 2120

    The data length is correct. However max_tx_time is 2120us which seems very short given that I set NRF_SDH_BLE_GAP_EVENT_LENGTH to 100 which equates to 125ms. By my calculations 2120 is almost exactly the time required to transmit 4 packets with a payload of 49B.  

    49B Tx Time = 8 * (49 + 17) / 10^6 = 528us

    2120us / 528us = 4.01

    Therefore my code changes are not having the desired affect. In fact increasing the GAP event length to 200 had no effect on the max_tx_time. 

Reply
  • Another data point:  I enabled debug logging in the GATT module and I see this in the logs:

     nrf_ble_gatt: Updating data length to 53 on connection 0x0.
     nrf_ble_gatt: Data length updated to 53 on connection 0x0.
     nrf_ble_gatt: max_rx_octets: 53
     nrf_ble_gatt: max_tx_octets: 53
     nrf_ble_gatt: max_rx_time: 2120
     nrf_ble_gatt: max_tx_time: 2120

    The data length is correct. However max_tx_time is 2120us which seems very short given that I set NRF_SDH_BLE_GAP_EVENT_LENGTH to 100 which equates to 125ms. By my calculations 2120 is almost exactly the time required to transmit 4 packets with a payload of 49B.  

    49B Tx Time = 8 * (49 + 17) / 10^6 = 528us

    2120us / 528us = 4.01

    Therefore my code changes are not having the desired affect. In fact increasing the GAP event length to 200 had no effect on the max_tx_time. 

Children
Related