Determine the exact distance of the Beacon - ios

Can we determine the exact distance of the Beacon from the iOS App using these properties below.
Proximity
accuracy
rssi
If so, How can we achieve it?
Thanks,

accuracy is an estimation of the distance (in meter) between your device and the beacon. It isn't really reliable. As a matter of fact determining an exact distance would require taking into account all things creating interferences or attenuating the signal which isn't possible.

Accuracy is reliable within 1 meter,but the value may fluctuate.With increasing distance error increases.
You can calculate the distance by rssi in the actual environment.

Related

How to achieve a more accurate distance from device to Beacon?

I am sorry if this has been asked in one way shape or another. I have started working with beacons, and in Xcode (Swift) - using CoreLocation. I really need a more accurate determination between the device and a beacon though. So far I have been using the standard proximity region values (Far, Near, and Immediate), however this just isn't cutting it at all. It seems far too unstable for the solution I am looking for - which is a simple one at best.
My scenario;
I need to display notifications, adverts, images etc to the users device when they are approximately 4 meters away from the beacon. This sounds simple enough, but when I found out that the only real solutions there are for beacons are those aforementioned proximity regions, I started to get worried because I need to only display to devices that are 3-5 meters away, no more.
I am aware of the accuracy property of the CLBeacon class, however Apple state it should not be used for accurate positioning of beacons, which I believe is what I am trying to achieve.
Is there a solution to this? Any help is appreciated!
Thanks,
Olly
There are limitations of physics when it comes to estimating distance with Bluetooth radio signals. Radio noise, signal reflections, and obstructions all affect the ability to estimate distance based on radio signal strength. It's OK to use beacons for estimating distance, but you must set your expectations appropriately.
Apple's algorithms in CoreLocation take a running average of the measured signal strength over 20 seconds or so, then come up with a distance estimate in meters that is put into the CLBeacon accuracy field. The results of this field are then used to come up with the proximity field. (0.5 meters or less means immediate, 0.5-3 meters means near, etc.)
When Apple recommends against using the accuracy field, it is simply trying to protect you against unrealistic expectations. This will never be an exact estimate in meters. Best results will come with a phone out of a pocket, with no obstructions between the beacon and the phone, and the phone relatively stationary. Under best conditions, you might expect to get distance estimates of +/- 1 meter at close distances of 3 meters or less. The further you get away, the more variation you will see.
You have to decide if this is good enough for your use case. If you can control the beacons there are a few things you can do to make the results as good as possible:
Turn the beacon transmitter power setting up as high as possible. This gives you a higher signal to noise ratio, hence better distance estimates.
Turn the advertising rate up as high as possible. This gives you more statistical samples, hence better distance estimates.
Place your beacons in locations where there will be as few obstructions as possible.
Always calibrate your beacon after making the changes like above. Calibration involves measuring the signal level at 1 meter and storing this as a calibration constant inside the beacon. Consult your beacon manufacturer instructions for details of how to do this calibration.

Determining Distance and Direction of iDevice from Beacon

I am developing an iOS application in which I need to know the exact distance and direction of the device from the beacon. I am using Estimote beacon.
I have used iOS's CLLocation as well as Estimote's framework but both of them give an incorrect value for the distance. Moreover, the values fluctuate a lot, the beacon even goes into unknown state (accuracy -1.000) a lot of times.
I have also tried to use the formula given here:
Understanding ibeacon distancing
but in iOS, it seems there is no way to get the txPower or measured power of Beacon.
I have searched a lot but nowhere I found a satisfactory way to find the distance accurately.
is there any other way which can help me in finding accurately the distance and direction of iOS device from Beacon?
The distance is computed by comparing the received signal strength (RSSI) with the advertised transmitted power (txPower) of the beacon, as the signal strength in theory is inversely proportional to the square of the distance.
But there are lots of other things that can affect RSSI, including obstacles, orientation of the antennas, and possibly multi-path (reflections). So it's difficult to accurately measure distance based on this information.
Another way of measuring distance is using round-trip-time (RTT): you send something to the beacon, and you measure how long it takes to come back. But this requires a fixed response time, and on this sort of scale (meters), there are probably enough variable delays here and there that it might severely affect the calculation.
Direction would require either triangulation or multiple directional antennas, I don't believe that's the case in this scenario.
In short, you can get a rough idea of the distance (which is why it's good for proximity alerts), but accurate distance or direction would require different technologies.
Why do you need them? There may be alternatives based on your specific scenario.
EDIT
If you have a large number of beacons around, and you know their exact positions, it might be possible to pull off the following:
use at least 3 beacon distances to compute your exact position by triangulation
from there, as you know the position of the beacons, you can compute the distance and direction of any of the beacons (or anything else, really)
Of course, depending on the actual accuracy of the beacon distance measurement provided by the SDK, the result might be more or less accurate. The more beacons you have, the more precise you should be able to get (by picking only those that return a distance, or by eliminating those that are not "compatible" with the others when computing solutions).
Even having 3 or more beacons with fixed positions, you still won't be able to receive very accurate positioning without some serious and complex noise reduction. That's because radio waves are prone to being affected by diffraction, multipath propagation, interference and absorption - mostly by metal objects and water particles (therefore human bodies are strong signal blockers). Even phone's alignment (antenna position) can have a significant impact on the proximity readings. Therefore, without implementing alorithms for noise reduction, trilateration can give you accuracy of about 5 meters.
You can find some examples in Obj-C (https://github.com/MatVre/MiBeaconTrilaterationDemo) and Swift (https://github.com/a34729t/TriangulatorSwift) and check how they work for you.
Cheers.

Estimating distance to iBeacon on iOS

I'm trying to estimate the distance from an iOS device to an iBeacon. I am aware that distance estimation is not super accurate, and I am also aware of this formula:
https://electronics.stackexchange.com/questions/83354/calculate-distance-from-rssi
I have found, through some research, that an iBeacon's BLE advertisement in fact contains data that represents the calibration value. That is to say, the RSSI determined at 1 meter away is actually broadcast by the beacon for all to see.
Now, I think the iOS must internally use this information to determine the Near, Far, Immediate, and Unknown categorizations of distance but I am not aware of any way to access this 1-meter RSSI directly.
My question is simply: Is there a way to get the distance estimate between an iOS device and a beacon WITHOUT having the 1-meter calibration value saved on the iOS device beforehand?
Some people say that the 'accuracy' field of the CLBeacon class is, in fact, the distance measurement to the beacon. The documentation does not support this statement, here's what it says:
accuracy The accuracy of the proximity value, measured in meters from
the beacon. (read-only)
#property (readonly, nonatomic) CLLocationAccuracy accuracy;
Discussion Indicates the one sigma horizontal accuracy in meters. Use
this property to differentiate between beacons with the same proximity
value. Do not use it to identify a precise location for the beacon.
Accuracy values may fluctuate due to RF interference.
A negative value in this property signifies that the actual accuracy
could not be determined.
There is a new iBeacon Document released by Apple on June 2, 2014 that states:
When building an application that uses either GPS or
beacon, it is important to consider this accuracy. The values
reported by the Core Location objects (the
horizontalAccuracy property in the CLLocation class, or
the accuracy property in the CLBeacon class) indicate this
level of uncertainty, or the margin of error. Both are
measured in meters. The higher the value, the lower the
certainty of the position of the device or beacon. Keep in
mind that depending on the physical surroundings a low
accuracy may not be possible.
I suspect that's Apple's 'confidence' metric when reading their CLProximity values. I interpret that as obtaining something like:
CLProximityNear with an accuracy value of 5; Apple pinpoints your position within a 5m margin of error.
The general sentiment I'm getting from my general analysis of sources is that using beacon technology for distance approximation is probably not the strength of the technology.
EDIT: Chaise Hocking from Shine Technologies in Melbourne has an insightful blog post that has some experiments and results regarding the accuracy property.
Is there a way to get the distance estimate between an iOS device and a beacon WITHOUT having the 1-meter calibration value saved on the iOS device beforehand?
YES, you simply read the CLBeacon accuracy field as you suspected. This is an estimate of the distance to the beacon in meters.
This estimate uses an undocumented calculation that is based on the RSSI measurements (likely a 30 second running average, perhaps discarding outliers) combined with the 1-meter RSSI calibration value embedded in the iBeacon advertisement. A port of this calculation to Android is shown here.
And, no, there is no way to read the calibration value from an app. It is obscured by iOS, which disallows seeing the details of iBeacon Bluetooth LE advertisements. See here for a detailed explanation.

Whats the possible range of peripheralDataWithMeasuredPower

I am trying to setup a Beacon with CBPeripheralManager. I'm using peripheralDataWithMeasuredPower on the CLBeaconRegion and from the docs it says that it would be the measured RSSI value 1m from the device. But in the real scenario always Im getting a particular RSSI value while Ranging, irrespective of the Power we have set. Any ideas on this.
The RSSI value you get in the ranging callback is supposed to be the actual measured signal strength, not the calibration power value you set. So what you are seeing is expected.
iOS compares the measured RSSI to the calibration constant (which is not visible through the ranging API) to calculate an estimated distance. If the measured RSSI is weaker than the calibration constant then the device is over one meter away. If it is less, then the device is less than one meter away.

Location with iBeacon

I am using an iBeacon, and using triangulation and trilateration (or something similar), want to be able to locate an exact (or fairly accurate) distance between the iBeacon and user's device (in feet/metres/e.t.c). What is the best way to do this, and how would I do this?
I forgot to mention: I understand that it is possible to find proximity (i.e near, immediate, far, etc.), however as mentioned, ideally I am looking to find an accurate distance (maybe by combining RSSI, accuracy, and proximity values).
For this you should use RSSI (Received Signal Strength Indication) of an iBeacon. The signal strength determines how close or far it is from you. But the problem is that:
Every beacon's RSSI might differ distance, accuracy.
If beacon is behind the wall or any static obstacle the RSSI-Distance-Ratio will not work.
Therefore instead of Triangulation or Trilateration you should go for Fingerprinting. This will work better then rest of the techniques.
Place obstacles all around you.
Make reference points on your map.
Calibrate your app with that location i.e. Get the signal strengths from atleast 3 nearest iBeacons and save it against that reference points.
Do this for all other reference points.
(If you can) Do this twice or thrice and take average and store in database.
Now you have laid map of calibrated reference points. (This will handle all different RSSI-DIstance-Ratios of all the beacons)
Now whenever you are at any position compare it with the nearest point and you will get to know the closest location of your reference point.
If you are using google maps, the lat long they provide is upto six decimal place i.e. 0.11 meters which i think is preety much accurate in a room as well.
I guess this helps :)
Please mark this the right answer if it works.
In iOS the Core Location beacon information you get when you range a beacon includes both a "proximity" value (far/near/immediate) and an "accuracy" reading, which is actually approximate distance, in meters.
In order for the distance reading to be as accurate as possible, you should really calibrate your beacons. To do that, you put the beacon exactly 1 meter from the receiver and take a reading. The receiver gives you a "measured power" reading, which you then set on the transmitter. The measured power reading is used in calculating the distance reading.
Distance readings are very approximate, and are subject to interference from the surroundings.
The Apple sample app "AirLocate" shows working code for calibrating a beacon, and I believe it also displays

Resources