I found this post but I do not know if my understanding is correct on the matter and where (if I) missing: I use an app with two distinct lib, one with the sdk estimote and am trying to calculate the distance based on this formula and the other using the lib Alt Beacon.
Formula:
double getDistance(int rssi, int txPower) {
/*
* RSSI = TxPower - 10 * n * lg(d)
* n = 2 (in free space)
*
* d = 10 ^ ((TxPower - RSSI) / (10 * n))
*/
return Math.pow(10d, ((double) txPower - rssi) / (10 * 2));
}
Alt Beacon returns me a value close to correct, but when trying to use the formula of this post according to my understanding the value of this distance very different.
My Estimote formula:
double getDistance(int rssi, int txPower) {
/*
* RSSI = TxPower - 10 * n * lg(d)
* n = 2 (in free space)
*
* d = 10 ^ ((TxPower - RSSI) / (10 * n))
*/
return Math.pow(10d, ((double) beacon.getMeasuredPower() - beacon.getRssi()) / (10 * 2));
}
Sample beacon estimote values:
beacon.getMeasuredPower() = -65
beacon.getRssi() = -66
Distance value returned by Alt lib = + - 4 meters.
Distance value returned by the formula = + - 20 meters.
What are the actual amounts to be placed in the formula so that I can have the distance to the beacon, and if you can learn in a plane x, y position as a radar.