Estimote / Android-Fleet-Management-SDK

Estimote Fleet Management SDK for Android
https://developer.estimote.com
MIT License
836 stars 451 forks source link

Scanning for configurable devices takes a lot of time #278

Closed wrightX closed 6 years ago

wrightX commented 6 years ago

Hello, I am trying to connect to beacon and change its gpios. But when I am scanning to find my configurable device I can connect to it's taking a lot of time and often doesn't find it at all. Is it some way to make it work better? It is working great when I shake my beacon but eventually it will be placed stationary and I wouldn't be able to do that.

wafel82 commented 6 years ago

Hi @wrightX

Phone - to be able to connect to the beacon - needs to "hear" the connectivity bluetooth packet first. It is often more complicated than people might thing. First - when the power beacon is using to advertise the connectivity packet is to small or the distance from beacon to the phone is to big then bluetooth signal simply not propagated correctly to the phone bt antena. Second - when there is a many active Bluetooth devices nearby then we potentially have lot of "packet collision" in the air, This effectively slows down the data transfer and connection process. Last but not least - Beacon advertises its data in discrete moments of time (eg. once a second). From the other side phone listens connectivity packets in discrete time-windows (eg. 500ms each second). As a result it is possible that packets advertised by the beacon simply mist the Phone's "listen window" Long story short - establishing BT connection is pretty complicated :)

You mentioned that connection work smoothly when you shake your beacon (shaked beacon temporary increases advertising poser and advertises more frequently). So - my proposal is to permanently edit your beacon settings by increasing the connectivity packet power and decreasing advertising interval. To do so:

  1. go to estimote cloud, select beacons you'd like to update settings for, click Edit button and switch to the Connectivity.
  2. in Interval field put some smaller value in Broadcasting Power (dBm) field select some bigger value
  3. Save settings
  4. Connect to each of your beacons to apply the settings you just set up.

IMPORTANT - you have to remember that increasing advertising power and/or decreasing advertising interval manes you beacons batteries live shorter. So you need to find sweet spot between beacon responsiveness and battery live.

Hope this will help you :) Regards Wojtek

wrightX commented 6 years ago

Thank you for your answer. Can I somehow change connectivity settings from your android app? I can't see option to do it there

Poberro commented 6 years ago

It is not supported right now, but it you change that setting in Cloud, it will be synchronised when you connect to the beacon.