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

Ble_nus slows down after 30 seconds.

I am sending task notification from nus_data_handler when in get BLE_NUS_EVT_TX_RDY event

In a seperate task , i am sending  ble packets (244bytes) by using ble_nus_data_send...

It works up around 22000bytes/second for the first 30 seconds after that , BLE_NUS_EVT_TX_RDY event lagging and transfer speed reduces to the around 2000bytes/sec.

I am using nrf52832 ,SES , android samsung note 9.

Where should i look at ? 

Max and min conn interval settings are 47.5ms both.

but it seems android phone only allows 100ms intervals because if i sent only one packet at a time BLE_NUS_EVT_TX_RDY comes after 80-100ms after calling ble_nus_data_send.

Best regards.

Parents
  • Hi,

    The central decides the connection parameters, and all the peripheral can do is request changes. I assume the android phone adjusted the connection parameters after 30 seconds? You can verify that by checking for the BLE_GAP_EVT_CONN_PARAM_UPDATE event or using a sniffer. You could try to request a connection parameter update if the connection parameters are changed to using a longe connection interval than you want. But you can never be guaranteed that the phone will allow it (it would depend on the implementation in the phone, and could even vary between the same phones in case the phone also has to schedule a lot of activity with other devices, which you may not have control over in an end product out in the field).

  • I just add BLE_GAP_EVT_CONN_PARAM_UPDATE  in to ble_evt_handler but it never called.

    Here is my sender task , it sends some sort of data until NRF_ERROR_RESOURCES


    And here ; i give task notification after i receive BLE_NUS_EVT_TX_RDY

    The result is like this;

    Before the slowdown there was 5 consequent data event for each 30-40ms interval .after slowdown issue there is again 5 consequent data event but now interval become 407ms between them.

  • Hi,

    I see. Then I do not have any immediate suggestions. Can you make a sniffer trace and upload it to this case so that we can see what actually happens on the link?

    Do you see the same behavior if testing with something other than Samsung Note 9?

  • I just ordered a sniffer, I don't have it yet. 

    But I tried with a different phone (Xiaomi redmi 5+), the problem is the same. I have also tried with the different android terminal app, the behavior is exactly the same. 

    There is one more thing here ;

    if I disconnect BLE and connect it again, it starts with the highest speed then falls to a low level after 16-30 sec. So I don't reset nrf52, I don't close the android app, the only thing that I do is pushing the disconnect button in-app then reconnect it again.

Reply
  • I just ordered a sniffer, I don't have it yet. 

    But I tried with a different phone (Xiaomi redmi 5+), the problem is the same. I have also tried with the different android terminal app, the behavior is exactly the same. 

    There is one more thing here ;

    if I disconnect BLE and connect it again, it starts with the highest speed then falls to a low level after 16-30 sec. So I don't reset nrf52, I don't close the android app, the only thing that I do is pushing the disconnect button in-app then reconnect it again.

Children
No Data
Related