HRG
HRG

Reputation: 192

BLE loss of Data packets in smartphone

Am working on a BLuetooth Low energy module embedded in a custom board . whenever i press an interrupt (push button) the ble module advertises some number once and goes to sleep ,again when interupt given it advertises the next number(incremented value) once and goes to sleep .These values are scanned in a custom android app running in nexus 5.Though the phone is scanning most of the packets ,sometimes it fails to capture some datapackets.the custom board advertises once and goes to sleep ,the phone must be able to capture this advertisement packets,but some times it miss the data packets. So my question is Is it normal that the BLE compatible phones cannot capture all datapackets from a pheriperal device i.e there may be loss of some data packets.Or is it the problem with smart phone nexus 5 ble hardware.

Upvotes: 1

Views: 6640

Answers (2)

Jeremi Wójcicki
Jeremi Wójcicki

Reputation: 11

I had a similar problem, that only some data packets were arriving. It seems that enabling the SCAN_MODE_LOW_LATENCY mode with ble scanner helps - your device will keep listening continously, so no data will be missed (unless there is clutter, bad range etc. like Timmmm suggested).

https://developer.android.com/reference/android/bluetooth/le/ScanSettings

hope this helps

Upvotes: 1

Timmmm
Timmmm

Reputation: 96556

BLE is transmitting with low power on in a crowded spectrum. Some packet loss is to be expected (though I agree it is more than I'd like).

A higher level protocol will detect packet loss and request retransmission. In the case of BLE, instead of using advertisments for data you can actually connect to the device and then use notifications. These are far more reliable and shouldn't be dropped. The downside is most devices only support connecting to a handful of peripherals, usually 7. Listening for advertisments doesn't require connection and therefore there's no fixed limit to the number of advertisers you can listen to.

The packet loss also depends on what is listening. A nRF51822 trasmitting to my Nexus 4 with Android 5.0 at zero range gets >50% PLOS. When transmitting to another nRF51822 it gets around 20% PLOS. I guess the Nexus 4 tries to save power so maybe it doesn't listen continously.

Upvotes: 1

Related Questions