Estimote / Android-Fleet-Management-SDK

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

Value of Utils.computeAccuracy changes with Transmission Power/Measured Power #148

Closed scailbc closed 7 years ago

scailbc commented 8 years ago

Hello everybody, I'm using the SDK with an Android device to calculate the distance from the beacons, I'm using the method Utils.computeAccuracy(beacon). I know that beacons are not accurated while calculating the distance, but I saw that beacons at the same distance with different value of transmission power (also called Tx and returned as Measured Power) give different results. Here are some values:

Of course the results change, but more or less a beacon with transmission power of -76dB gives a distance that is half of a beacon with trasmission power of -70dB. By changing the transmission power from -76 to -70, the beacons give more or less the same results, so is not a problem of the device. I'm not using only Estimote beacons, I have different values of UUID and major, I tried with the SDK 0.9.7 and with the new 0.10.1 and results are the same. The correct result is about 10 meters but I'm not worried about precision, I simply expect that beacons at the same distance give more or less the same result independently of transmission's power or frequency. Or maybe the computeAccuracy is based on the default transmission power of Estimote beacons, that is -74?

Thanks for your help

martinklimek commented 8 years ago

Hi @scailbc,

Just looking at your issue. As you mention there are some issues with distance calculations based on bluetooth. In your case data provided shows that you have very weak signal from the devices (RSSI < -90 dB). To improve measurement you can improved signal strength. Measured power is strongly correlated with power setting that ranges from -30 to +4. In terms of distance calculations we recommend to use +4.

BTW. There is no value -70 for measured power coming from our beacons. Check out available values below:

-30 dBm = -91 -20 dBm = -81 -16 dBm = -76 -12 dBm = -74 -8 dBm = -68 -4 dBm = -66 0 dBm = -62 +4 dBm = -60

Let me know if changing power setting helps in your situation!

scailbc commented 8 years ago

Hi @martinklimek, I'm not worried about the precision of the result, my problem is: why when I have beacons at the same distance, the method Utils.computeAccuracy gives me really different result? I checked that based on the value of transmission power the result changes, I tested that by changing the value from -76 to -70 (I'm using different kinds of beacons, not only Estimote) the calculated distance is doubled, I'm talking about the average value of lot of samples. I understand that with a different transmission power the accuracy will change, but I expect that the average value is more or less the same (beacons 1 and 4 are more or less 5 meters, while beacon 20 is 11 meters). It's correct? I tried once with in a hallway with no obstacles, and I saw that when I'm far (about 15 meters) the values of RSSi were almost equals (-99 and -100), could it be that for some reason due to my environment, I get similar RSSI and that's why the result is wrong?

martinklimek commented 8 years ago

Hi @scailbc,

What I meant is that the distance precision for RSSI values close to the -100 is very low what is directly related to math behind it. This part of RSSI range is described with exponential function, so small change of RSSI cause big change of distance.

The only way to improve distance measurements for range mentioned by you (5m to 10m) is to adjust broadcasting power of the beacon. You will move away from this fast growing part of the graph then.

scailbc commented 8 years ago

Ok, so from far away it's normal that the value is wrong. But still, when I'm closer to the beacon I can see a relationship between the measured distance and the transmission power, and by changing the transmission power the value of measured distance changes. This relationship seems too precise to be simply an error. The value of the measured distance shouldn't be more or less the same when changing the trasmission power (knowing that the transmission power influences the accuracy)?

scailbc commented 8 years ago

Ok, I think I figured out what is the problem. The distance is calculated by using the measured power, that is the RSSI measured at 1 meter of distance, and the measured power depends from the transmission power. The problem is that some beacons can tell the wrong measured power, the owner can change the value of measured power while keeping the same transmission power, thus the distance calculated is wrong. Hope this helps.

twanschik commented 8 years ago

@scailbc Can you tell me more about how to see if the value of measured power has changed while keeping the same transmission power?

scailbc commented 8 years ago

Hello @twanschik, from your app you only see the measured powered and there is no way (at least for what I saw in the iBeacon protocol) to see the value of transmission power, you can only assume that the measured power depends from the transmission power. From what I saw, some brand of beacon allows the owner of the beacon to set a value of measured power not related to the transmission power, this way the value of computed distance is wrong. Only the owner of the beacon can do this, the only way to find out if the measured power sent by the beacon is correct, is measure it by yourself: put the beacon at 1 meter of distance and check a lot of values. As I said, only some brands of beacons allow this, for instance the Estimote beacons don't, when you change the transmission power, the measured power is changed as well.