Reputation: 1280
I'm working on a Cordova mobile application that scan for Beacon signals and the application reacts to the beacon address and RSSI (distance) values. I use Cordova plugin BluetoothLE by Rand Dusing to read the Beacon signals and I use Estimote Beacons. I get the responses, but is there a way to estimate an approximate distance from the RSSI value? Can someone help me with an approx RSSI value range for FAR, NEAR and IMMEDIATE?
Upvotes: 1
Views: 2458
Reputation: 64941
In order to get a distance estimate, you also need to be able to read the TxPower reference value transmitted by the beacon. This indicates what the RSSI should be at one meter. You can read more about this here: Understanding ibeacon distancing
If the plugin does not provide access to this value, you may hard code it in your app if you know the value is fixed for all the beacons your app will see. The default value is typically -59. You can then try using the formula referenced in the link above.
You can then convert the distance to immediate, near and far with numerical ranges. The exact numbers are not published by Apple, but immediate is about 0.5 meters or less and far anything above 3 meters. Near is anything in between.
You will note that the RSSI jumps around a lot with radio noise, which will cause your distance estimates to vary, too. You can smooth this out by calculating a running average over 20 seconds or so, which is similar to what iOS does.
Finally, note that each Android device has a different RSSI to distance conversion. The formula linked above works well for iPhone and the Nexus 4. A different formula is required for a Nexus 5, Galaxy S3/S4/S5 and other Android devices.
Upvotes: 4