Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to improve Android Bluetooth Low Energy GATT throughput?

I am having performances issues when doing several consecutive GATT read using the Android BLE API.

I can read about 10 packets per second just for about 5 or 6 seconds. After I read the ~65's packet the throughput decreases to about 1 packet each 1.5 second.

I did several tests and it seems that the internal BLE is getting really slow. On that case it takes about 750ms from the Java GATT read call to the peripheral (there is no bottleneck in the peripheral) and about the same, 750ms, back to the Java API callback.

It seems to me to be poor BLE stack implementation, because when I disconnect from the device (probably some resources are cleaned up) and then reconnect back I can reproduce the same issue: It reads about 10 packets/s for the first 5 or 6 seconds (~65 packet reads) only, then it becomes slow.

I tested it with Galaxy S4 and Nexus 4 devices. Same with both.

Any suggestions on how to improve it?

like image 765
Felipe Tonello Avatar asked Oct 01 '22 15:10

Felipe Tonello


1 Answers

I hope since the Jun 5 2014, you find a solution to your problem. I also have the same issue. The first 2 ~ 3 seconds, I receive data in ~100ms. After, I receive data each ~2000ms. I test on 4.3 and above device.

I found for Lollipop version and above the requestConnectionPriority on BluetoothGatt. I have't find solution for 4.* version. If any one have suggestion.

Hope this help someone with bluetooth trouble on data transfer !

like image 94
Kevin Ménager Avatar answered Oct 04 '22 22:10

Kevin Ménager