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!

  • Just a quick notice. The connection interval I use is not 8 msec. It is 10msec (8 * 1.25msec).

    A Bluetooth radio can only serve one peer at a time, typically the radio will need to acquire the radio for severval ms each time it want to communicate with a peer device. So if you try to configure 8ms there simply isn't time to handle them all.

    Please tell me if I understand correctly the following

    1. A connection interval is the time between two connection events where the two peers can exchange data.

    2. A connection interval of 10 msec corresponds to the communication of one peripheral and the central. You mean that this amount of time is not enough for the central to communicate with one peripheral and it should be >=20 msec.

    3. A connection interval of 10 msec corresponds to one peripheral. So for 5 peripherals the central device must give 50 msec of its time to serve all five devices. Why do you say that the central cannot handle them all in 10msec since it is only for one device and not all of them?

    4. The connection event length extension is the time added at the end of one Connection Interval before the next connection event of the peripheral taking place in the communication

    5. How do I calculate the event length extension time and should I activate it somehow in firmware?

    Thank you

  • You are missing one important point, and that is that it take time to exchange data, let's assume ~3ms. This means that if you configure a 8ms connection interval, then the radio resources in the phone will be allocated already 3/8*100%=37.5% for that specific link. If you add 2more peripherals then you it's (3+3+3)/8*100%=112.5%, which does not compute, so it will start losing packet. Adding more devices (e.g. 5 in total) will make it even worse.

    Kenneth

  • 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

Reply Children
No Data
Related