developer tip

ibeacon 거리 이해

optionbox 2020. 8. 6. 08:16
반응형

ibeacon 거리 이해


ibeacon (beacon / bluetooth-le / ble)과의 거리가 어떻게 작동하는지에 대한 기본 개념을 파악하려고합니다. ibeacon이 얼마나 정확하게 측정 할 수 있는지에 대한 실제 문서가 있습니까? 내가 300 피트 떨어져 있다고 가정 해 봅시다 ... ibeacon이이를 감지 할 수 있습니까?


iOS에서 제공하는 거리 추정치는 보정 된 송신기 전력 (txPower)에 대한 iBeacon 신호 강도 (rssi)의 비율을 기반으로합니다. txPower는 1 미터 거리에서 rssi로 알려진 측정 신호 강도입니다. 정확한 거리 추정을 위해서는 각 iBeacon을이 txPower 값으로 교정해야합니다.

우리는 안드로이드 iBeacon 라이브러리를 구축 할 때 iOS CoreLocation 소스 코드를 사용할 수 없기 때문에 독자적인 알고리즘을 개발해야했습니다. 알려진 거리에서 rssi 측정 값을 측정 한 후 데이터 포인트와 일치하도록 가장 적합한 곡선을 만들었습니다. 우리가 생각해 낸 알고리즘은 아래 자바 코드로 표시됩니다.

여기서 "정확도"라는 용어는 미터 단위의 거리를 나타내는 iOS입니다. 이 공식은 완벽하지는 않지만 iOS의 기능과 거의 비슷합니다.

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;
  }
}   

주 : 값 0.89976, 7.7095 및 0.111로는 가장 적합한 곡선 풀 때 계산 세 상수 우리의 측정 된 데이터 포인트. YMMV


iBeacon을 사용하여 정확성 / rssi / 근접성 문제를 철저히 조사하고 있으며 실제로 인터넷의 모든 리소스 (블로그, StackOverflow의 게시물)에 문제가 있다고 생각합니다.

davidgyoung (응답 허용,> 100 개 공감) :

여기서 "정확도"라는 용어는 미터 단위의 거리를 나타내는 iOS입니다.

실제로, 대부분의 사람들은 이것을 말하지만 나는 왜 그런지 전혀 모른다! CLBeacon.proximity는 다음과 같은 문서로 매우 명확합니다.

하나의 시그마 수평 정확도를 미터 단위로 나타냅니다. 근접성 값이 동일한 비콘을 구별하려면이 특성을 사용하십시오. 비콘의 정확한 위치를 식별하는 데 사용하지 마십시오. RF 간섭으로 인해 정확도 값이 변동될 수 있습니다.

반복하자 : 미터 단위의 시그마 정확도 . 주제에 대한 Google의 상위 10 개 페이지는 모두 문서에서 인용 한 "시그마 하나"라는 용어를 가지고 있지만,이 용어를 분석하는 사람은 없습니다.

실제로 하나의 시그마 정확도 가 무엇인지 설명하는 것이 매우 중요 합니다 . 다음 URL로 시작하십시오 : http://en.wikipedia.org/wiki/Standard_error , http://en.wikipedia.org/wiki/Uncertainty

실제 환경에서는 약간의 측정을 수행 할 때 (노이즈, 왜곡 등으로 인해) 항상 다른 결과가 나오며 결과는 종종 가우스 분포를 형성합니다. 가우스 곡선을 설명하는 두 가지 주요 매개 변수가 있습니다.

  1. 평균 (이해하기 쉬운 곡선의 피크가 발생하는 값).
  2. 표준 편차는 곡선의 넓이 또는 좁음을 나타냅니다. 모든 결과가 서로 가깝기 때문에 곡선이 좁을수록 정확도가 향상됩니다. 곡선이 넓고 가파르 지 않으면 동일한 현상의 측정 값이 서로 크게 다르므로 측정 품질이 떨어집니다.

하나의 시그마 는 가우스 곡선이 얼마나 좁고 넓은 지 설명하는 또 다른 방법입니다.
그것은 단순히 측정의 평균이 X이고, 경우에 있다고 하나 시그마는 σ이며, 모든 측정의 68 % 사이에있을 것입니다 X - σX + σ.

예. 결과적으로 거리를 측정하고 가우스 분포를 얻습니다. 평균은 10m입니다. σ가 4m이면 측정의 68 %가 6m와 14m 사이에 있음을 의미합니다.

When we measure distance with beacons, we get RSSI and 1-meter calibration value, which allow us to measure distance in meters. But every measurement gives different values, which form gaussian curve. And one sigma (and accuracy) is accuracy of the measurement, not distance!

It may be misleading, because when we move beacon further away, one sigma actually increases because signal is worse. But with different beacon power-levels we can get totally different accuracy values without actually changing distance. The higher power, the less error.

There is a blog post which thoroughly analyses the matter: http://blog.shinetech.com/2014/02/17/the-beacon-experiments-low-energy-bluetooth-devices-in-action/

Author has a hypothesis that accuracy is actually distance. He claims that beacons from Kontakt.io are faulty beacuse when he increased power to the max value, accuracy value was very small for 1, 5 and even 15 meters. Before increasing power, accuracy was quite close to the distance values. I personally think that it's correct, because the higher power level, the less impact of interference. And it's strange why Estimote beacons don't behave this way.

I'm not saying I'm 100% right, but apart from being iOS developer I have degree in wireless electronics and I think that we shouldn't ignore "one sigma" term from docs and I would like to start discussion about it.

It may be possible that Apple's algorithm for accuracy just collects recent measurements and analyses the gaussian distribution of them. And that's how it sets accuracy. I wouldn't exclude possibility that they use info form accelerometer to detect whether user is moving (and how fast) in order to reset the previous distribution distance values because they have certainly changed.


The iBeacon output power is measured (calibrated) at a distance of 1 meter. Let's suppose that this is -59 dBm (just an example). The iBeacon will include this number as part of its LE advertisment.

The listening device (iPhone, etc), will measure the RSSI of the device. Let's suppose, for example, that this is, say, -72 dBm.

Since these numbers are in dBm, the ratio of the power is actually the difference in dB. So:

ratio_dB = txCalibratedPower - RSSI

To convert that into a linear ratio, we use the standard formula for dB:

ratio_linear = 10 ^ (ratio_dB / 10)

If we assume conservation of energy, then the signal strength must fall off as 1/r^2. So:

power = power_at_1_meter / r^2. Solving for r, we get:

r = sqrt(ratio_linear)

In Javascript, the code would look like this:

function getRange(txCalibratedPower, rssi) {
    var ratio_db = txCalibratedPower - rssi;
    var ratio_linear = Math.pow(10, ratio_db / 10);

    var r = Math.sqrt(ratio_linear);
    return r;
}

Note, that, if you're inside a steel building, then perhaps there will be internal reflections that make the signal decay slower than 1/r^2. If the signal passes through a human body (water) then the signal will be attenuated. It's very likely that the antenna doesn't have equal gain in all directions. Metal objects in the room may create strange interference patterns. Etc, etc... YMMV.


iBeacon uses Bluetooth Low Energy(LE) to keep aware of locations, and the distance/range of Bluetooth LE is 160ft (http://en.wikipedia.org/wiki/Bluetooth_low_energy).


Distances to the source of iBeacon-formatted advertisement packets are estimated from the signal path attenuation calculated by comparing the measured received signal strength to the claimed transmit power which the transmitter is supposed to encode in the advertising data.

A path loss based scheme like this is only approximate and is subject to variation with things like antenna angles, intervening objects, and presumably a noisy RF environment. In comparison, systems really designed for distance measurement (GPS, Radar, etc) rely on precise measurements of propagation time, in same cases even examining the phase of the signal.

As Jiaru points out, 160 ft is probably beyond the intended range, but that doesn't necessarily mean that a packet will never get through, only that one shouldn't expect it to work at that distance.


It's possible, but it depends on the power output of the beacon you're receiving, other rf sources nearby, obstacles and other environmental factors. Best thing to do is try it out in the environment you're interested in.


With multiple phones and beacons at the same location, it's going to be difficult to measure proximity with any high degree of accuracy. Try using the Android "b and l bluetooth le scanner" app, to visualize the signal strengths (distance) variations, for multiple beacons, and you'll quickly discover that complex, adaptive algorithms may be required to provide any form of consistent proximity measurement.

You're going to see lots of solutions simply instructing the user to "please hold your phone here", to reduce customer frustration.

참고URL : https://stackoverflow.com/questions/20416218/understanding-ibeacon-distancing

반응형