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

Expectable data rates with NUS in multilink application

Hello,

we developed an application with a nRF52840DK as central and a custom board with a nRF52832 chip as peripheral. The peripheral sends data via NUS with a data rate of 40.8 kBit/s to the central. The code on the central is based on the ble_app_uart_c example and the code on the peripheral is based on the ble_app_uart example. This works fine.

Now we have to expand this application. We want to use one central with as much peripherals as possible. So we want to achieve the architecture which is shown in the following picture (e.g. with 3 peripherals):

To achieve this, we already found this multilink example code for our central (https://github.com/NordicPlayground/nrf52-ble-app-uart-c-multilink). It works well with the nRF52840DK as central and multiple Development-Boards based on nRF52832 chips as peripherals. Each peripheral can send data via NUS to the central at low data rates (e.g. 0.5 kBit/s).

We want to achieve a 40,8 kBit/s data rate between every peripheral and the central.

So here are our questions:

1. Is it possible to achieve this data rate between each peripheral and the central?

2. What are the correct connection parameters to achieve this? (The exact time when the NUS pakets are sent or received is not really important, each NUS paket is timestamped anyways)

3. Do you have any suggestions or tips, how to evaluate the maximum amount of peripherals properly?

Thank you very much in advance.

  • Hello,

    first of all, thank you very much for your quick reply.

    How many peripherals is the central connected to when you see this issue?

    Only 1. So the Central continues scanning.

    Is the central doing scanning at the same time?

    Yes.

    what is the scan window and scan interval?

    I use this parameters:

    #define NRF_BLE_SCAN_SCAN_INTERVAL 160
    #define NRF_BLE_SCAN_SCAN_WINDOW 80

    This are the default values of this multilink example. Do you recommend to adjust them?

    I assume that the peripheral, once connected, is no longer advertising.

    That is correct.

    You could try set the hvn_tx_queue_size directly

    I add this code snippet to my project. I set the hvn_tx_queue_size to 30 and made the required changes to the RAM parameters. (I have a lot of unused RAM)

    It looks like that the first data link between central and peripheral works now. But I need to do further testing to verify this (e.g. check if the hvn_tx_queue_size gets emptied fast enough). I will also try it with the other peripherals. I will let you know my results. But it looks promising at the moment. Thank you so much for this.

    Best regards,

    Michael

  • Michael01101 said:
    But it looks promising at the moment. Thank you so much for this.

     Great!

     

    Michael01101 said:
    This are the default values of this multilink example. Do you recommend to adjust them?

     For optimal performance, you want to avoid scheduling conflicts on the central between scanning activity and the BLE links. Since you are using connection interval=40ms, then I think setting the scan interval to 40ms would be a good choice For the scan window, if you are connected to 1 link with NRF_SDH_BLE_GAP_EVENT_LENGTH= 10 -> 12.5ms, you basically have 40ms – 12.5ms= 27.5ms left for scan window, for 2 links it’s 15ms left for scan window. I assume that you are not scanning when you have 3 links connected. So easiest is then to set scan interval to 40ms, and scan window to 15ms. Scanning window/interval is in 0.625 units, so try this:

    NRF_BLE_SCAN_SCAN_INTERVAL 64

    NRF_BLE_SCAN_SCAN_WINDOW 24

Related