Whats the possible range of peripheralDataWithMeasuredPower - ios

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.

Related

Indoor Navigation using I-Beacon

I am doing an Indoor Navigation using I Beacon. I want to know the current location of the user. Is there any property for beacon like proximity or accuracy where i will get the distance of the beacon from the userLocation. Please help me to get the distance of the beacon from the userLocation. According to my knowledge beacons have accuracy, proximity and Received Signal Strength (RSSI). So it will be helpful if i get a clear idea of what these accuracy, proximity and RSSI means and how i can calculate or get the distance of the beacon from the userlocation.
Thanks in advance.
The CLBeacon class contains three properties which are related to the distance between the beacon transmitter and the receiving device:
rssi: The Received Signal Strength Indicator, measured in dBm, tells how strong the beacon signal was as averaged over the last one second ranging cycle. It originates from the radio receiver on the Bluetooth LE chip, and has a large amount of variation due to radio noise.
accuracy: This field provides a distance estimate in meters between the beacon and the receiving device. It is calculated using a mathematical formula from a running average of the rssi over 20 seconds, combined with a reference measurement of what the rssi is expected to be for the beacon at a distance of 1 meter. This reference measurement is transmitted inside every iBeacon packet. The field also has quite a bit of variance and error due to radio noise, signal multipath and reflections.
proximity: This field is derived from accuracy, and puts that value into one of three "buckets" depending on a range of values. "Immediate" is for an accuracy under 0.5 meters, "Far" is for an accuracy of 3 meters or more, and "Near" is for any value in between.
None of these fields can be used by themselves for indoor positioning, which is a much more complex subject. However, the first two fields can be useful inputs depending on the technique used.
More details are available here: http://developer.radiusnetworks.com/2014/12/04/fundamentals-of-beacon-ranging.html
I am working on indoorpin, which is a ready to use framework for iBeacon management. You can integrate it to your mobile app (IOS or Android) and use it with any iBeacon device. It consists of a web based CMS and SDK for mobile app. In CMS, you can see the real-time location of the mobile app user or you can get a report for historical data as heat-map or bubble map.

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.

Determine the exact distance of the Beacon

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.

Beacon Proximity: Is this still a issue from Apple API reference.

We are having a issue with iBeacons.
App makes wrong guess sometimes as to which proximity region its in before eventually correcting itself. It sometimes shows Far when the Proximity is Near. And then later it flips back to Near.
The problem actually occurs when we need to fire an event when we are in the Near/Far/Immediate region. This doest happen in that way. App is likely to lose range of beacons for brief instances.
Are there any other way to solve this Issue.
It is normal for the Proximity estimate to fluctuate with radio noise, but your experience sounds extreme. What iBeacon brand are you using?
Make sure you are using an iBeacon with as fast enough transmission rate. Different iBeacons transmit advertisements at different frequencies from 30 times per second to once per second or less. Generally, faster transmission rates give you less noisy distance estimates because they give iOS more radio signal strength measurements to work with.
If an iBeacon transmits less than once per sec, you may get intermittent exit/entry events.
For your testing, Try an iOS-based iBeacon like Locate for iBeacon or EZBeacon to see if it helps. It is known to transmit 30x per second.
The proximity issue can be effected by advertising frequency as David has already said. The reason for this is that iOS takes an average of the RSSI readings overtime and uses these to find a final value, if you hold an iOS device in an ideal location, (i.e. clear line of site to the beacon) the result settles down over a few seconds of holding the device still. Apple describes the averaging as: "This value is the average RSSI value of the samples received since the range of the beacon was last reported to your app."
However a bigger factor can be fluctuations in the environment, the RSSI will change dramatically if an obstruction appears between the iBeacon and the iOS device, if the iBeacon and iOS device are both at a low level, this could be a person walking past. I have published some initial results using Estimote iBeacons that show changes in distance based on the device operator rotating 360 degrees. A distance change of +/- 2m is not an uncommon change in this circumstance and could result in the behaviour you observed if the iOS device is near the proximity region boundary.
This is Wojtek Borowicz, I'm a community evangelist at Estimote.
Calculating the exact proximity of a Beacon is based solely on the radio waves it’s broadcasting an is really hard. You encounter factors like multipath propagation, wave diffraction, absorption or interference. That’s exactly why iBeacon standard does not try to calculate the exact distance between a Beacon and the receiving device. Instead, it uses a value called RSSI (received signal strength indicator), which allows to estimate the proximity based on signal power. For calibration purposes, there’s also included a metric called Measured Power - but it’s nothing more than just RSSI measured 1 meter away from the Beacon. Even calibrated, RSSI might fluctuate heavily, due to the factors mentioned above.
The stability of the Beacon’s signal is also based on two main factors. One of them is advertising interval (frequency - the lower, the better signal) and broadcasting power (the higher the better signal). Improving them will allow for much better proximity reading, but will also strongly affect battery life.

Update/Refresh Rate for monitoring iBeacons

I've been playing around with Estimote Beacons for the last few days. I'm starting to doubt the effectiveness for iBeacons becouse of the high latency they have when it comes to determine a Beacons position.
When you move 2-3 meters it takes a few seconds until it gets the position right.
A usecase-scenario like, capturing a person walking by a beacon can be quite hard to determine.
Is it possible to manipulate the Update/Refresh Rate of a CLLocationManager or a CLBeaconRegion? e.g. every 0.1 Seconds
The reason that you are seeing it take so long for the iOS distance measurement (what they call "accuracy" in the CLBeacon object) to stabilize is because it is based on a running average of the RSSI -- the received signal strength. This signal strength measurement is inherently noisy and it bounces all around. That is why collecting multiple samples is necessary to smooth it out.
But because of this averaging, there is a lag. The most recent estimate is based on measurements from several seconds ago.
You cannot change the refresh rate of the CLLocationManager or the CLBeaconRegion, but you may be able to get an iBeacon that transmits more often than the 1s baseline. More transmissions gives you more RSSI measurements to work with, and it may help smooth out the noise. Because I am not sure of the internal implementation of CoreLocation, I am not positive whether a higher iBeacon transmission rate would reduce the noise on the distance measurement.
You can always calculate your own distance measurement, too, based on RSSI and the Power calibration value sent out by an iBeacon. If you use a single RSSI sample, then there will be no lag from averaging with earlier measurements, but you will have a high degree of variability. You basically have to accept a tradeoff between filtering out noise and filtering out old measurements based on different positions.
If you want to try your own calculation, you can use something like below (See my answer to this question for details).
distanceInMeters = 0.89976 * (rssi/txPower)**7.7095 + 0.111
You have to set realistic expectations on how accurate this estimate is going to be. Apple generally recommends that you don't use their "accuracy" measurement inside CLBeacon, unless it is in combination of other rougher measurements like "proximity" that bucketize the distance measurement into "immediate", "near" and "far" groupings.

Resources