Search code examples
iosgeolocationcore-locationibeaconestimote

Obtaining Geo Location Long and Lat of iBeacon in iOS


Im wanting to know if anyone knows of a way using the data that the ibeacon is sending to the phone can you than use that to calculate its longitude and latitude. Being the fact that I know the Long and Lat of the phone using core location (ios, objc) I was thinking there would have to be a way to than take the distance signal data to calculate the long and lat of the beacon. Any ideas?

Im using the estimote iBeacons and their SDK.


Solution

  • Bluetooth Low Energy (BLE) devices do not report their location; all they do is broadcast a tuple: (UUID, Major, Minor). Ranging of BLE devices is approximated based on the signal strength received, making any distance measure applied to it never 100% accurate.

    Because of this, you will be unable to accurately detect the lat/long of a particular iBeacon. All you know is that it is within some short distance from your phone's current location. You don't even get a direction -- signal strength is a one-dimensional value and it isn't even linearly related to distance. It can be modified by lead walls, signal interference, signal boosting, and many other factors.

    In short, iBeacons do not intrinsically report their lat/long and detecting distance from you to a particular iBeacon is not yet possible with a sufficient level of accuracy. The best you can do is say "I detected an iBeacon and my current location is (lat/long). The iBeacon is probably within x metres." Where x is based on signal strength and is provided with the caveat that it is an vague approximation.


    Edit:

    An alternative would be to record the lat/long locations of where you expect to be placing your iBeacons, then set up a server somewhere (or you could just code it right into the build if you're not worried about having to update it on the fly) that will translate the Major/Minor pair into a lat/long using a database lookup that you create.