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

Reply
  •     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

Children
  • Last question.

    So there is also a function to enbale DLE? Or MTU size just need to be increased?

    Best regards,

    Rytis

  • Test the ble_app_mtu throughput example. If you write config print, you should have these settings, which gives the maximum throughput:

    Note that this is between two nRFs. You will not get the same throughput to a phone. And by the way. The Samsung J7 looks like it has Bluetooth 4.1, not 4.2.

    Look at the test description for how to test the throughput example to see how to use putty to run the commands. You want to set both the MTU and Data length to maximum. 

    If you test the ble_app_uart example, this already requests these parameters, but as I mentioned, I don't think the Samsung J7 supports these features. And even if it is 4.2, many of the features that are added in Bluetooth are optional, so it still may not support increased data length. 

  • Hello,

    as suggested using ble_app_att_mtu_throughput example with Iphone 7 i managed to get only ~350000 b/s rate. This is only half theoretical 4.2 1M ble speed. I used 15ms connection interval, enabled DLE and Event Length extension.

    Could it be that iOS devices limits BLE speed?

    Also nRF board sends only 3 packets per connection interval to Iphone 7, and i think this is reason why throughput to iPhone 7 is not as big as could be theoretically.

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

  • 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.

Related