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

Why too much data is lost when there is 11 peripheral connected to 1 central via NUS connection

Hello, I have a big problem now. I set up a BLE network with 11 peripheral boards connected to 1 central board via NUS protocol. the peripheral board is based on NRF52840 and the central board is NRF52840 DK board. The peripheral board read the sensor at 50Hz and 16 bytes per reading. Every 14 readings, the sensor board will send the data as s packet to the central board, and the central board transfers data to the laptop via the UART port. When there is only one peripheral, it is fine.

But when the peripheral boards increase, the data will be lost and most data cannot transfer to the laptop. What causes the problem? Thanks. Any help will be appreciated.

  • Please let me know your complete configuration. The relationship between connection interval, event length, packet length and number of connections is essential as you can see here. Also, what is the cause for the reset?

  • Hi Einar, I understood what you said in your poster. Which parameter should I change for correction?  I changed the APP_ADV_INTERVAL from 64(default setting) to 600 and the number of peripherals can add up to 15. But the central board will reset every 6 or 7 second as shown below.

    ...

    Which other parameter can be changed to cancel the regular resetting? Thanks.

  • Hi, here is the configuration for connection in central board.

    // <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 6
    #endif
    
    // <o> NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL - Determines minimum connection interval in milliseconds. 
    #ifndef NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL
    #define NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL 7.5
    #endif
    
    // <o> NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL - Determines maximum connection interval in milliseconds. 
    #ifndef NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL
    #define NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL 30
    #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 6
    #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 0
    #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 16
    #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 16
    #endif

  • Is the packet length parameter defined as below?

    // <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
    

    BTW, there is no error code shown for the resetting. How can I program to send debug information when resetting occurs?

  • Hi,

    If you have very rapid advertising that will cause problems when things are tight, so that is an important adjustment. See SoftDevice timing-activities and priorities.

    If you use a connection interval of 7.5 ms and a event length of 6 * 1.25 ms  = 7.5 ms then that means that your connection parameters are suited for a single connection. You should make sure that you can fit all events in a connection interval as shown here. That means that if you have set the event length to 6, and want say 15 peripherals, you should have at least 6 * 1.25ms * 15 = 112.50 ms connation interval. That said, if you only need to send one long packet every event, you could reduce the event length to 3 (3.75 ms) or possibly even 2 (2.5 ms), and reduce the connection interval accordingly.

    Regarding the cause for the reset I assume you can start searching in your code for "SYSTEM RESET". I do not find that string in the SDK (17.0.2), but clearly you log something before resetting so that should be possible to find.

Related