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

Improve BLE throughput in react-native-ble-plx mobile app

We are developing a React Native mobile application for iOS and Android, making use of the react-native-ble-plx library to interface with the BLE UART service from the examples as a communication method. We transmit the contents of a csv in 24B chunks, and when transmitting to the nRF Connect mobile app, we can send about 37KB in around 14 seconds with our current sdk_config settings.

However, when we are sending data to our mobile application, it takes closer to 19 seconds to do the same transfer, pushing the results into an array.

I set up an LED on our board to turn on once we send the final line of the CSV via ble_nus_string_send(), and after this LED turns on, it still takes about five seconds for the react native app to finish receiving all of the transmitted data.

Does anyone have any experience with this, or suggestions for improving our throughput to the mobile app? I can't help but think that if the nordic app is able to receive at full speed, then there must be some way to improve what's going on via the react-native-ble-plx library handling our transmissions in our custom mobile app.

  • Hi,

    There are several factors that determine the effective throughput. Some of them depends on the app, others on the BLE stack and chipset. Here is a good blog post that sums it up: Bluetooth 5 speed: How to achieve maximum throughput for your BLE application.

    The three most prominent factors are the MTU size, connection intervals, Data length extension, and the 2Mbps mode. Some of this is handle behind the scenes by the nRF Connect app and/or in the FW in our SDK. After skimming through the react-native-ble-plx documentation there seems to be little you can do to tweak these factors in the API. The only tweakable thing seems to be the MTU size, and the rest is left to the underlying BLE stack. So if it is possible I would advise you to try increasing the MTU size. Don't expect any radical increases in throughput though, because increasing MTU isn't that effective unless you can enable data length extension and adjust connection interval accordingly. 

    Note also that different phones and OSs ship with different chipsets and BLE stacks, and different chipsets and stacks don't necessarily support all the features required for optimal throughputs. So one can never expect to get the same throughput on all devices, no matter how much you optimize your device firmware and mobile application. 

Related