So we have BLE devices inside cars to lock/unlock them, my own phone and all dev phones that I have do connect pretty nicely to them (<5 seconds)... I very rarely have to wait >30 seconds before it finally finds the device inside the car... But some people do have this issue more often, sometimes even to the point where the device inside the car is never even found...
Even though my phone does work fine, it does work even better when I'm inside the car...
The only theory I can come up with after extensive testing is that the signal strength of some phones is too weak, maybe some "battery saving state"? Which prevents the phones signal from penetrating the cars exterior? Is there a way to check this in the Sweetblue library? And if such "low energy state" exists, to force it out of this state?
ryanbis last edited by
While there is a low energy scan API, SweetBlue doesn't use it by default. Note that that option is only available on Lollipop and above. You can look at BleScanPower for more information. This option gets set via BleManagerConfig.scanPower.
But yeah, some devices have really bad BLE radios, or they are placed in such a way inside the phone that the signal strength just sucks.
Thanks for your answer, I have found this feature shortly after posting this message Time will tell if it works.... I also implemented a reset button, to reset the BLE manager if it takes too long (BLEManager.reset()), are there more things you would recommend to reset if scanning for a device, or connecting to a device takes longer than 5 seconds?
ryanbis last edited by ryanbis
That's about it. Some phones just have bad BLE radios. You'll never get every device to connect in 5 seconds on Android. We do our best to make things as consistent as possible, but there's really only so much that can be done with software (especially at the java level). If anything we do what we can to ensure you DO get a connection.
EDIT: Do you know if the device (peripheral) is advertising on all 3 channels? Do you know if the peripheral is using full transmit power? Those are possible things to look into as well, as I suspect the main problem is the phone being able to find the device in a reasonable time.
`Well, the Sweetblue library does already make a big improvement on connection time, and the amount of phones even being able to connect... I'm mostly worried about the phones that sometimes don't connect at all, but so far, I've only seen that on a Sony in my small test team... Too bad the guy doesn't want to test again to see if my latest fixes work for that issue :S