This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

BLE transmission data loss from 5 peripherals to 1 central device

Hi,

I have a configuration of five nRF52840 custom devices transmitting sensor data to a central device (laptop)

The devices can be connected and send data to the central but the central very frequently loses data

coming from the peripherals. This occurs randomly between peripherals during one connection session meaning that data

loss is noticed for example in peripheral 1 and 3 and after lets say two minutes in peripherals 2 and 5.

By saying data loss I mean that in a series of 100 data packets I notice approximately 10 lost packets from a peripheral.

The data loss is verified by the timestamp that is attached in each peripheral packet that is transmitted

Also, when I tried to connect the central to one peripheral device instead of 5 the all packets are transmitted without issues

Any ideas why this can happen?

Thank you for your time

Parents
  • Can you provide the connection parameters used for the various connections and also the scanning parameters while scanning/establish connection?

    Also read this if you haven't:
    https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/multilink_scheduling/multilink_scheduling.html

    In specific check out:
    https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/multilink_scheduling/suggested_intervals_windows_s132.html 

    Kenneth

  • Hi Kenneth,

    all peripheral devices have the same connection parameters.

    #define APP_BLE_OBSERVER_PRIO           3                            

    #define APP_ADV_INTERVAL                       256

    #define APP_ADV_DURATION                      0 //18000                       

    #define MIN_CONN_INTERVAL                     MSEC_TO_UNITS(8, UNIT_1_25_MS)            
    #define MAX_CONN_INTERVAL                    MSEC_TO_UNITS(11, UNIT_1_25_MS)           
    #define SLAVE_LATENCY                            0                                         
    #define CONN_SUP_TIMEOUT                     MSEC_TO_UNITS(4000, UNIT_10_MS)  

             
    #define FIRST_CONN_PARAMS_UPDATE_DELAY  APP_TIMER_TICKS(5000)                   
    #define NEXT_CONN_PARAMS_UPDATE_DELAY   APP_TIMER_TICKS(30000)                    
    #define MAX_CONN_PARAMS_UPDATE_COUNT    3 

    -------------sdk_config.h-----------------------------

    #ifndef NRF_SDH_BLE_GAP_DATA_LENGTH
    #define NRF_SDH_BLE_GAP_DATA_LENGTH 251
    #endif

    // <o> NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links.
    #ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1
    #endif

    // <o> NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links.
    #ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
    #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 0
    #endif

    // <o> NRF_SDH_BLE_TOTAL_LINK_COUNT - Total link count.
    // <i> Maximum number of total concurrent connections using the default configuration.

    #ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT
    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 1
    #endif

    // <o> NRF_SDH_BLE_GAP_EVENT_LENGTH - GAP event length.
    // <i> The time set aside for this connection on every connection interval in 1.25 ms units.

    #ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH
    #define NRF_SDH_BLE_GAP_EVENT_LENGTH 18
    #endif

    // <o> NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size.
    #ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE
    #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247
    #endif

    Thank you for your help!

  • Ok, I think I got it. Also I think I figured out one more misconception of mine. I thought that in case of multiple peripherals the central serves only one device per connection interval and then the next peripheral on the next connection interval and so on. But from your explanation I understand that the central tries to serve all peripherals in one connection interval. I thought that graph 1 was correct while graph 2 is the correct one

  • Also, How can I activate the Connection Event Length Extension?

  • Nice illustration, your understanding is correct.

    Kenneth

  • The connection event length extension will have no effect in this case, it will only adjust the amount of time that should be allocated locally,  it will have no effect on the peer (phone).

    Kenneth

  • Thanks!

    One last question.

    In theory, for one peripheral the LE data packet transmission time (@2Mbps) is 1.4msec. Let's say 2msec for convenience. So for five devices the Connection Interval should be minimum 10 msec.

    In a previous post, you suggested me to set minimum and maximum interval to 20msec, and gap event length to 3. Would it be wrong to make the connection interval somewhere closer to 10 msec?

    It is not a problem for me to set it to 20msec I just want to understand the reason you suggested 20 msec in case I think of something the wrong way

    Thank you for your time!

Reply
  • Thanks!

    One last question.

    In theory, for one peripheral the LE data packet transmission time (@2Mbps) is 1.4msec. Let's say 2msec for convenience. So for five devices the Connection Interval should be minimum 10 msec.

    In a previous post, you suggested me to set minimum and maximum interval to 20msec, and gap event length to 3. Would it be wrong to make the connection interval somewhere closer to 10 msec?

    It is not a problem for me to set it to 20msec I just want to understand the reason you suggested 20 msec in case I think of something the wrong way

    Thank you for your time!

Children
No Data
Related