BLUETOOTH (Classic and BLE)

I was wondering if anyone can share their observations if they have been involved in BLE/ Android development?

We have finally got OTA (Over the Air Updates) working from an Android phone to our BLE device. We have not developed this for iPhone as yet. What we have found is that the Android to BLE device data transfer speed is chronically slow. From Windows it is not lighting fast but Android takes at least 6 times longer. Windows 4mins vs Android 20mins (And this is only a small dummy test file).

Is it a generalized problem with Android?
Is it the Delphi/ FMX BLE implementation?

Any clues/ strategies/ observations/ clarification/ suggestions would be very welcome.

Google says “The actual /practical transfer rate for BLE are around 100 – 250 Kbps as compared to roughly 2 Mbps for Classic Bluetooth.”

You didn’t say what throughput you were seeing, or whether, ‘something else’ might be changing between Windows and Android.

I wish. We’re only getting 200bps which is ridiculous. It’s way faster from Windows but still slow. We are connecting to an ESP32. Our normal low bandwidth communications are working well but OTA is a killer.
We notice on various forums that there are some BLE parameters that can be tweaked like MTU and Connection Interval but this level of access doesn’t seem to be available in Delphi (TBluetoothLEManager etc). In our case, the phone acts as the client and the device is the server. It is possible that the ESP32 can negotiate some of these settings with the client but we haven’t tested this as yet. It’s surprising to us the the Windows implementation is faster.

Further testing has shown that from Windows the upload speed to the BLE server reaches a reasonable limit of 2.9Kbps. Strangely, the download speed of both Windows and Android is similar and acceptable.
The VERY slow upload from Android still exists. I will report the solution to this issue when we find out what it is even if it turns out to be something stupid on our side.

Is anyone else doing BLE development for IOS and Android using Delphi? It would be good to be cross check our many findings, observations and pitfalls.

I’ve been doing quite extensive BLE and BT Classic development with Delphi over the years.

What I’ve found with BLE and data speeds, it is also really dependent on the radio chipset used.
Since BLE doesn’t have an official standard for Serial Port mode as BT Classic has, it is dependent on how the chipset manufacturer have implemented the Serial Port Service.
For instance, Nordic Semi takes a quite different approach to coordinate data transfers than Microchip does.

Thanks Glenn. We are performing OTA from an Android phone to an ESP32 device using BLE with the standard maximum MTU size of 512. This is extremely slow. Reading between the lines, are you or would you suggest that we should resort to BT Classic for the OTA only?
Also, we have beaten ourselves up many times over in our quest to master the Delphi BLE implementation. I would say that after we have resolved many issues we have realized that our lack of understanding and knowledge of BLE is usually the cause of our frustration. How would judge the Delphi BLE implementation? I ask this because i see a lot of criticism online but this is usually due to the complainants misuse or misunderstanding.

Gerard Hook

https://developer.android.com/guide/topics/connectivity/bluetooth/ble-overview
Didn’t find answers for yourself in this article?