Reputation: 972
How can i get a numeric distance from ibeacon:
NSString *proximity;
switch (beacon.proximity) {
case CLProximityNear:
proximity = @"Near";
break;
case CLProximityImmediate:
proximity = @"Immediate";
break;
case CLProximityFar:
proximity = @"Far";
break;
case CLProximityUnknown:
default:
proximity = @"Unknown";
break;
}
I want to have values like 2.4m
Upvotes: 0
Views: 1996
Reputation: 5
Accuracy parameter returns numeric distance in meters. Proximity values like Immediate, Near, Far and Unknown are predefined by apple on the basis of RSSI (Recieved signal strength intensity), Accuracy (distance in meters) and Tx Power (Measured signal strength at 1m distance from beacon). If you want to create your own algorithm you can always use parameters those parameters but they are not reliable as RSSI fluctuates too much. So you have to do testing for optimum values of these parameters according to your surroundings.
Upvotes: 0
Reputation: 91
If you're using Estimote beacons,they have property distance which automatically calculate distance between device and beacon
Upvotes: 1
Reputation: 9337
There is no simple and reliable way to do this. You can recon it base on the proximity value (immediate,near,far). Moreover you can try to play with RSSI
(which is changing all the time, sometimes quite rapidly) and compare it with TxPower
which is a measured signal strength at a distance of 1 meter form beacon. As I mentioned at the beginning it won't be a reliable method but you can try it how well it will work for you. I do not expect that those value will change in a linear way but maybe you will find a good method that will work in your case.
Upvotes: 0
Reputation: 11754
There's a great answer here on Stack Overflow: What are the nominal distances for iBeacon. The simple answer is, there is no numerical value you can easily extrapolate. The longer answer is to get a numerical value you'd either need multiple iBeacons, or a lot of luck to be able to generate a figure that's accurate.
Upvotes: 2