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

How to increase notification throughput on nRF52840?

Hello there,

I'm developing a C++ application on the BLE654 development bord which shall be able to generate and send 100+ BLE notifications per second on a single BLE connection.

On my first try it managed 5.

After some digging, I found that the soft device (s140, Ver 6.1.0) got a BLE_GAP_EVT_CONN_PARAM_UPDATE event, which set the minimum and maximum connection interval to 200 ms, wich was the defined MAX_CONN_INTERVAL (the code burrowed from the blinky example). After setting this to 20 ms I could get (close to) 50 notifications per second, but further decreasing the value again reduced the throughput (maybe the Android on the 'other side' of the BLE connection prohibited a further decrease).

I read somewere that soft devices from s120 up were able to process up to 6 notifications in a 7.5 ms connectipon interval, but here it looks as is the sd only does one notification per interval. What can/must be done to further increase the througput to reach at least 100 notifications per second?

Notes:

-in our application, we send the notifications with sd_ble_gatts_hvx(). I don't have exact numbers, but the internal queue of the soft device seemd rather small and we got a NRF_ERROR_RESOURCES error quickly, after wich we wait for a BLE_GATTS_EVT_HVN_TX_COMPLETE until we call sd_ble_gatts_hvx() again. I am certain the soft device at all time had notifications in its queue.

-as recipient of the notifications we used two tablets with Android 6.0.1 and 7.0, respectively. Both showed similar throughputs, and the final application shall also run on an Android device.

Regards,

     Lasse

  • Hello Edvin,

    Your test_app_2.hex' application produced the following output:

    <info> app: Connected
    <info> nrf_ble_gatt: server_rx_mtu = 247, p_link->att_mtu_desired = 247
    <info> app: Data len is set to 0xF4(244)

    My application gave me

    ATT MTU exchange completed. central 0xf7 peripheral 0xf7

    Best regards,

         Lasse

  • Ok. So then we know that the phone supports more than MTU = 247 bytes, and it is actually updating to it.

    In the part that you have imported from the ble_app_uart example, can you see if you can find out where it complains after 20 bytes? Do you get the return value NRF_SUCCESS (=0) if you try to send more than 20 bytes?

    If it does, can you try to set a breakpoint on sd_ble_gatts_hvx() and look at the parameters that you are sending? Is the array larger than 20? Is p_len larger than 20?

    Is it possible to do a sniffer log of the connection?

    BR,

    Edvin

  • Hi Edvin,

    it doesn't complain. It always returns NRF_SUCCESS.

    p_len is 86 Byte (I'm trying a fixed string at the moment), the array is fine.

    I can't sniff the BLE connection. I've tried to get the sniffer software running on two different PCs, but each time anything didn't work (usually the sniffer wasn't visible in wiresharks main window).

    I willl try a third time.

    Best regards,

         Lasse

  • The nRF Sniffer is a bit buggy if everything isn't correct with the segger versions. Did you remember to flash the sniffer-DK with the firmware for nRF Sniffer?

    If it still doesn't show up, try to close it and open it again (Wireshark), and it usually shows up after a few tries. Also remember to reset the DK after programming. Turn it off and on to be sure.

    Sorry that this description isn't very good. I usually have to close and open Wireshark a couple of times myself, but because it works eventually, I haven't looked into why it doesn't show up.

    You can try to update to the latest version of nRF Connect. Have you tested the nRF Connect app for mobile by the way? It looks ilke your screenshots is from nRF Toolbox, is that correct?

    BR,

    Edvin

  • Hi Edvin,

    we have tried to get the sniffer working on three PC by now, but we had no success. We have followed the instructions as well as the steps in the troubleshooting chapter, but we couldn't find an error. And yes, we tried multiple times.

    The screenshot was from the Toolbox, yes. I also have the Connect app, though.

Related