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

How to achieve the maximum transmission rate through ble_app_uart with IOS nrfconnect app

Excuse me:

                      I want to achieve the maximum transfer speed between ble_app_uart and IOS NRF connect app,How to modify the example to achieve the maximum transfer speed with the app,Can we achieve a speed of more than 50kb / s?

  • Hi 

    How have you set the core BLE settings in sdk_config?

    // <i> Requested BLE GAP data length to be negotiated.
    
    #ifndef NRF_SDH_BLE_GAP_DATA_LENGTH
    #define NRF_SDH_BLE_GAP_DATA_LENGTH 251
    #endif
    
    // <o> NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links. 
    #ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1
    #endif
    
    // <o> NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links. 
    #ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
    #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 0
    #endif
    
    // <o> NRF_SDH_BLE_TOTAL_LINK_COUNT - Total link count. 
    // <i> Maximum number of total concurrent connections using the default configuration.
    
    #ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT
    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 1
    #endif
    
    // <o> NRF_SDH_BLE_GAP_EVENT_LENGTH - GAP event length. 
    // <i> The time set aside for this connection on every connection interval in 1.25 ms units.
    
    #ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH
    #define NRF_SDH_BLE_GAP_EVENT_LENGTH 6
    #endif
    
    // <o> NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. 
    #ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE
    #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247
    #endif

    In order to maximize throughput you need to set GAP_DATA_LENGTH to 251 and the GATT_MAX_MTU_SIZE to 247. 

    Then you can send up to 244 bytes of user data in every notification in order to maximize throughput. 

    Secondly you might want to request 2M phy, which will increase the throughput even further, but I would focus on increasing the data length first. 

    Also, you should use 15ms connection interval for optimal throughput on both iOS and Android. 

    In our testing you can get up to around 600kbps on iPhone, but depends on the settings used, and on how you upload data on the peripheral side. 

    Best regards
    Torbjørn

  • I set the core BLE settings in sdk_config.

    // <i> Requested BLE GAP data length to be negotiated.
    
    #ifndef NRF_SDH_BLE_GAP_DATA_LENGTH
    #define NRF_SDH_BLE_GAP_DATA_LENGTH 251
    #endif
    
    // <o> NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links. 
    #ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1
    #endif
    
    // <o> NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links. 
    #ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
    #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 0
    #endif
    
    // <o> NRF_SDH_BLE_TOTAL_LINK_COUNT - Total link count. 
    // <i> Maximum number of total concurrent connections using the default configuration.
    
    #ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT
    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 1
    #endif
    
    // <o> NRF_SDH_BLE_GAP_EVENT_LENGTH - GAP event length. 
    // <i> The time set aside for this connection on every connection interval in 1.25 ms units.
    
    #ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH
    #define NRF_SDH_BLE_GAP_EVENT_LENGTH 24
    #endif
    
    // <o> NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. 
    #ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE
    #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247
    #endif
    

    After the peripheral is connected to the IOS nrfconnect app, the MTU is only updated to 182 bytes Automatically,However, Android NRF connect app can update MTU to 244 bytes.Does the IOS NRF connect app need to set the size of the MTU? How to set it?

  • Hi Helen

    Most likely 182 is the maximum that the phone allows. Remember that not all BLE devices support MTU up to 244, this is different from device to device. 

    Can you let me know which model of iPhone you are testing on, and which iOS version it is running?

    Best regards
    Torbjørn

  • Excuse me:

                       The model of iPhone is iphone12,iOS version is IOS14.5.thanks!

  • Hi Helen

    Apparently this is a limitation from Apple:
    https://developer.apple.com/forums/thread/93007

    The reason they mention 185 in the thread and not 182 is that you lose three bytes in the packet to the attribute header, so only 182 bytes is free for user data. 

    Best regards
    Torbjørn

Related