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

How to increase BLE data transfer speed between 52840 and android mobile devices?

Objective: I want to read 64MB data stored in external flash (interfaced with nrf52840) from android mobile App (specific: One  Plus 7T)

SDK: nRF5 SDK v16.0.0 

Soft Device: s140_nrf52_7.0.1_softdevice.hex

BLE Parameters:

#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247

#define NRF_SDH_BLE_GAP_EVENT_LENGTH 6

#define MIN_CONN_INTERVAL 6  //7.5ms

#define MAX_CONN_INTERVAL 6  //7.5ms

#define NRF_SDH_BLE_GAP_DATA_LENGTH 27

preferred PHY rate: 2Mbps

Current Data Rate: Approx 4KBps which takes approx 4.6 hours to read 64MB data.

Is there any way I can achieve a higher data rate to decrease the read time. All the suggestions and guidance will be highly appreciated.

Please let me know if any other data is required.

  • By setting your maximum connection interval to 7.5ms you essentially told the Central that if you cannot get a 7.5ms connection interval you don't care what you get. Most likely you've gotten >100ms connection intervals. 

    You also need to extend your NRF_SDH_BLE_GAP_DATA_LENGTH to 251.

    And you will have to verify what connection parameters are actually negotiated. 

    I suggest you read one of the following guides:
    https://www.novelbits.io/bluetooth-5-speed-maximum-throughput/
    https://punchthrough.com/maximizing-ble-throughput-on-ios-and-android/

  • Hi Haakonsh,

    Thanks for your response.

    "Most likely you've gotten ->100ms connection intervals." I am able to get 11.25ms connection interval.

    You also need to extend your NRF_SDH_BLE_GAP_DATA_LENGTH to 251 -> I have done this but there is no change in throughput.

    And you will have to verify what connection parameters are actually negotiated-> from nrfConnect app I am able to check that:

    MTU Size: 247

    PHY(TX/RX): 2M

    Connection Interval: 11.25ms

    Can you please suggest what is the maximum MTU size I can use for nrf52840 as in nrfConnect mobile app I can see that it supports up to ~517. But when I am setting MTU size to 400 my firmware is being crashed upon data transfer (#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 400)

  • Max MTU is 247.

    The connection interval you're given is dependent on the current load of the mobile device's Multimodem. You might have gotten lucky when you were given a 11.25ms connection interval with the nRF Connect app. You need to log what connection parameters you are given during your throughput test, a connection parameter from another link is not valid data. 

    I also suggest that you compare your notification scheme with that of the ble_app_uart and throughput example, as these two examples try to maximize the throughput of a link. 


    Also, note that in a noisy RF environment a larger packet size will be more likely to be affected by transient noise than a smaller one, leading to lost packets and re-transmissions, lowering your throughput. 


Related