-
Notifications
You must be signed in to change notification settings - Fork 837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
beacon distance value showing negative distance on Motorola phones (moto edge 20 pro & moto g5+) #1115
Comments
Thanks for this report. Can you please provide a few samples of these two values when you see the negative distance?
|
Tested on Moto G5 S+
|
Also i've noted that the beacon reading (Ranged 0 beacons) even if the beacon advertiser and receiver are in close vicinity
|
Hi @davidgyoung I faced the same issue that sometimes getting negative distance on Motorola devices. Explanation :
In short, The negative distance measured in Motorola devices is because of the negative value of mCoefficient3. |
I found this |
It worked, but can you tell how we can get these three coefficient values for different phones ? coz I know we can get distance via this formulae but for 2nd equation how we can get variables:
|
Yes, it sounds like the Motorola coefficients should be replaced in the library's built-in and web hosted device map file. As @RenisDudhat described above, there is a certain range of RSSI values input to the formula that will yield negative values and this should not happen. There are instructions for calculating the constants in the last section of this page: https://altbeacon.github.io/android-beacon-library/distance-calculations.html If you can take the measurements and come up with a set of coefficients that does not give negative values, we can replace the existing Motorola coefficients with a new one. |
Hey, I tried these two formulas to get the values; if I get the C as -ve, I chose different formulae so that C should be positive or zero always
For Motorola device I got these values Method 1
Method 2 (C as 0)
|
@gptshubham595 and @RenisDudhat can you do some testing with these values and see how they work on your Motorola devices in practice? Method 2 (C as 0)
In order to properly put this into the config file we really need to know the actual values reported by android.os.Build for:
The CSV file relies on those actual values for matching purposes. You can use this URL to configure the library with this equation for initial testing: https://android-beacon-library.s3.amazonaws.com/android-distance2.json I made it the first equation for Motorola which should match that for your device if you device reports it Build.MANUFACTURER as "Motorola" |
I used these values and all worked perfectly fine |
@gptshubham595 can you please add code to read these values from your test phone? I can then use the results to add it to the library's built-in android-distance.json file:
|
Yeah sure you can use these:
|
Expected behavior
Actual behavior
Steps to reproduce this behavior
Mobile device model and OS version
Android Beacon Library version
altbeacon_version = "2.19.4"
The text was updated successfully, but these errors were encountered: