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

How to achieve higher throughput in Piconet using Nordic UART Service?

I have created a Piconet using nrf52840(s140). The 'Central' application was built on ble_app_uart_c example, which is now successfully connecting up to 7 peripherals. The Peripherals are also using NUS service to send data with(ble_nus_string_send) to Central.

I am generating some random data in peripherals. Data ranges are from 12kB/s to 10B/s in different peripheral device. I want to send total 15kB/s of data from 7 peripherals to Central.

My problem is- ALL the peripherals are only successfully sending data while I am sending limited amount of data. The central can receive upto 1kB/s in total, but the connection drops while I want to introduce a peripheral with a higher data rate(more than 1kB/s).The Central cannot maintain that connection in that case any longer.

I kept all the Connection Parameters same as examples. My question is- How I can achieve higher throughput in that system? Please feel free to ask additional questions. Thanks in advance.

PS: I am not sending/receiving any data via UART.

  • Difficult to pinpoint what kind of improvements you can make when I don't know what you have done. Have you tuned the ATT MTU? Are you doing DLE? Have you tuned the connection event length? Your question looks similar to this. Maybe you can have a look and explain a bit more about what you have done.

  • I was trying DLE by by EXACTLY following this and this . According to the recommendation for multiple connection from your link- I have set the connection event length around 50ms. But, the connection is still dropping in case of higher data throughput. Max data length achieved is 155. I tried only for one connection by setting connection event length to 400. It is still the same problem. if I try to #define NRF_BLE_GATT_MAX_MTU_SIZE 247 in sdk_config, the central device doesn't scan at all.

  • You are not able to achieve higher throughput with only one connection? Then I would recommend to try to fix that first. What do you mean by connection is dropping? You get a disconnect? Why? Have you check the disconnect reason? Are you one of the devices resetting because of an returned error code?

  • Hi Petter, sorry for late reply. I have solved few problems. I could achieve maximum 92k Bytes/s with single connection. Also with multiple connection, I could achieve higher data rate. When I am sending like this:

        do{
        err_code = ble_nus_string_send(&m_nus, data_array, data_len);
        if( err_code == NRF_SUCCESS ){
            total_bytes += data_len;
        }
        else if( err_code == NRF_ERROR_RESOURCES){
            data_not_sent += data_len;
           }
         }while( err_code == NRF_ERROR_BUSY ); 
    

    Otherwise, I get the disconnect reason 'NRF_ERROR_RESOURCES' while sending data via nus.

    But in this situation, I cannot really control to achieve 'desired' data-rate. I need very fixed data/rate in sending/receiving end. But now I have to wait till the BLE_GATTS_EVT_HVN_TX_COMPLETE.

    Would you please suggest what is the reason NRF_ERROR_RESOURCES and how I can achieve fixed data throughput? Thanks!

  • 736 kbps is close to the theoretical maximum, so that's good.

    As you can see from the documentation of sd_ble_gatts_hvx() the NRF_ERROR_RESOURCES error will be returned when it is not possible to queue more notifications.

    I don't quite understand what you mean by control the data rate. Could you elaborate? Do you want higher throughput? If you are, that is not possible.

Related