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

nRF 52 Throughput with different phones

Hello,

I'm using BT840XE module and ATT_MTU Throughput Example with S140. My goal is to measure maximum data transfer speed between module and different phones. Module acts as peripheral and phone as master. For phones, I use nRF Connect app. 

Problem is that i get different data transfer speed with different phones. I measure how many data packets are send per connection interval. Every time BLE_GATTS_EVT_HVN_TX_COMPLETE arrives GPIO pin is toggled. And i see that some phones accept more packets per connection interval than others. Please see attached pictures. Samsung J7 accepts only 5 packets per connection interval and Google pixel a3 accepts packets in whole connection interval.

Settings:

Connection interval: 100ms

NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247

NRF_SDH_BLE_GAP_EVENT_LENGTH 300

My question is what could cause that huge differences in delivering data packets to phone? Maybe phones has some kind of limitation?

Best regards,

Rytis

Parents
  • Hi Edvin,

    Thank you for fast response.

    Is there some function in SoftDevice API to request increasing Event Length?

    If phone accept larger MTU this means DLE is enabled?

    My goal is to deal with phones with at least Bluetooth 4.2 (My Samsung has 4.2). I tested iPhoneX also and it behaved similar to Samsung J7.

    Have a nice day,

    Rytis

  •     ret_code_t err_code;
        ble_opt_t  opt;
    
        memset(&opt, 0x00, sizeof(opt));
        opt.common_opt.conn_evt_ext.enable = 1;
    
        err_code = sd_ble_opt_set(BLE_COMMON_OPT_CONN_EVT_EXT, &opt);
        APP_ERROR_CHECK(err_code);

    I copied this from the ble_app_att_mtu_throughput example. I normally don't recommend this example as a starting point, because it is quite complex, and can act as both a peripheral and central during runtime. However, you can see how the different settings are being set based on the incoming CLI commands. 

    when you write a command, you typically get a response on the CLI. search for this response in the project, and you will find the function that will set the configuration.

    Best regards,

    Edvin

  • Rytis said:
    Could it be that iOS devices limits BLE speed?

     Indeed it does. But that is understandable. The phone doesn't want to use the radio 100% for Bluetooth. It has a lot of other things to handle as well. The theoretical limit when you use 1Mbps is roughly 750kbps. 

    In order to get higher throughput, you must increase the connection interval, and on phones this is not up to the application to decide. You can try to change to 2MBPS (if supported). That will increase the throughput, but other than that, the speed you are seeing now is probably the most you will get out of a BLE link with that phone.

     

    Rytis said:
    If phone has Bluetooth 4.2 doesn't what mean that maximum BLE 1M throughput(~700000b/s) should be reachable?

     A phone doesn't give you 700kbps even though it has Bluetooth 4.2. Only if both devices (central and peripheral) can agree on connection parameters that will maximize the throughput it will give you closer to the theoretical maximum. 

    I think a connection interval of 50ms would be more ideal in your case, but I don't think Apple supports that. 

  • I did some tests and best throughput results are with 15ms connection interval. nRF receives 3 BLE_GATTS_EVT_HVN_TX_COMPLETE events in one connection interval. As i understand that means 3 notification packets are sent in connection interval?

    If connection interval is bigger than 15ms same 3 BLE_GATTS_EVT_HVN_TX_COMPLETE  events occurs. So increasing connection interval doesn't help in this case.

  • What example are you working from?

    What is your NRF_SDH_BLE_GATT_MAX_MTU_SIZE?

    What is the length of the notifications you are sending?

    When gatt_evt_handler() is called, what is the p_evt->params.att_mtu_effective - OPCODE_LENGTH - HANDLE_LENGTH? It should be printed in the log:

    m_ble_nus_max_data_len = p_evt->params.att_mtu_effective - OPCODE_LENGTH - HANDLE_LENGTH;
            NRF_LOG_INFO("Data len is set to 0x%X(%d)", m_ble_nus_max_data_len, m_ble_nus_max_data_len);

  • 1. I'm working with ATT_MTU Throughput Example.

    2. NRF_SDH_BLE_GATT_MAX_MTU_SIZE  247

    3. I'm sending 244 length uint8_t array

    4. p_ctx->max_payload_len =
                p_gatt_evt->params.att_mtu_effective - OPCODE_LENGTH - HANDLE_LENGTH;

    after that line max_payload_len set to 244.

Reply Children
No Data
Related