Do anyone know how to count the distance between beacon and beacons/phone?

i would like to ask how to count the distance between beacon and beacons/phone?

also do there have any way to import SDK to UNITY3D?

thanks!~

In Estimote Android SDK, you can use the computeAccuracy method:

http://estimote.github.io/Android-SDK/JavaDocs/com/estimote/sdk/Utils.html#computeAccuracy-com.estimote.sdk.Beacon-

Not that this value is usually too inaccurate to pinpoint the exact distance—but it’s good enough to know a more-or-less proximity to the beacon. (i.e., are you very close to it? or somewhat further away)

What would you want to use the distance estimate for?

There is a couple of ways to calculate this and the best way I have found is:

var n = 2.25;
return Math.Pow(10d, ((double)Power - rssi) / (10 * 2)) * n;

and

if (rssi == 0 || Power == 0) return -1;
var ratio2 = Power - rssi;
var ratio2_linear = Math.Pow(10, ratio2 / 10);
double y = 0;
var r = Math.Sqrt(ratio2_linear);

double ratio = rssi * 1.0 / Power;
if (ratio < 1.0)
{
    y = Math.Pow(ratio, 10);
}
else
{
    y = (0.89976) * Math.Pow(ratio, 7.7095) + 0.111;
}
return y*10;

actually i am going to build a AR game app and need to use beacon to check the player move

Do you mean like, move from point to point? (e.g., from one base to another base) The best way would be to just use two beacons for that, and compare RSSI or computeAccuracy (the lower it is, the closer to the beacon you are) to check which beacon is closer.

what is unit of the value we get from the above formula ?

It’s metric meters (:

I’m getting a huge difference while calculating distance.

Keep in mind this is very rough estimation. It’s based on the signal strength with which the phone detects the beacon (RSSI = Received Signal Strength Indicator), and the nature of the signal strength is inherently unstable. There’s interference which can occasionally strengthen or weaken the signal; multi-path propagation where the signal can take may paths before it reaches the phone (e.g., bounce of walls or ceilings), and each path means different strength; polarization, where how you hold your phone might change the characteristics of the received signal, etc.

Use beacons for more-or-less proximity estimation (i.e., “near” or “far”), not for precise distance math. If you need more precision, consider using our Indoor Location technology—although sadly, it’s only available on iOS at this time.