Question about distance value calculation using Beacon rssi

Asked 2 years ago, Updated 2 years ago, 113 views

Attempt to obtain distance using rssi, but rssi receives normally, but only 127 attempts to obtain txPower using the getxPower() method in scanresult.class. What should I do to receive the txpower value of ibeacon normally?

txpower of getxPowerlevel() is received normally and can txpower be replaced by txpowerlevel in the formula below?

When the txpower level is 0dbm, the equation below is not calculated, so I'm not sure if it's correct.

protected static double calculateAccuracy(int txPower, double rssi) {
   if (rssi == 0) {
    return -1.0; // if we cannot determine accuracy, return -1.
  }

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

android-studio altbeacon java ibeacon

2022-09-22 18:08

1 Answers

When you set iBeacon, don't you think txpower is properly set, so 0xff is listed in the txpower field in broadcast?


2022-09-22 18:08

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.