0

I am experimenting with a iPad app (iPad Air, app running in foreground, not background) and a couple of beacons (from Estimote and Bluecat) to develop an indoor and outdoor game where people have to scan beacons in proper order. Beacons are placed inside area of like 5 x 5m and participants have to approach them (in immediate range).

However, discovering that beacon is in CLProximityImmediate range can take from few seconds (which is fine) to something like 30-60 seconds (which is too long) even in cases when iPad is actually physically touching the beacon. From my experiments beacons are ranged like once per second, but report immediate range with delays and frequently report CLProximityUnknown.

My ranging setup is as follows (I am in always ranging mode, no turning on/off for enter/exit region):

CLBeaconRegion *estimoteRegion = [[CLBeaconRegion alloc] initWithProximityUUID:estimoteUUID identifier:estimoteIdentifier];
CLBeaconRegion *bluecatRegion = [[CLBeaconRegion alloc] initWithProximityUUID:bluecatUUID identifier:bluecatIdentifier];
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
[self.locationManager startRangingBeaconsInRegion:estimoteRegion];
[self.locationManager startRangingBeaconsInRegion:bluecatRegion];

And ranging event handler is similar to below one:

- (void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region {
    for(CLBeacon *beacon in beacons) {
        if (beacon.proximity == CLProximityImmediate) {
             // Handle it
             break;
        }
    }

I've tried both Core Location and Estimote SDK, but they give very similar results.

Do you have any practical tips how to speed beacon immediate range sensing? Should going way deeper to Core Bluetooth promises any serious improvements?

Maciej Jastrzebski
  • 3,674
  • 3
  • 22
  • 28

1 Answers1

2

The delays you mention are likely caused by four factors:

  1. The time it takes for CoreLocation to give you a single ranging update: 1second
  2. The time it takes for CoreLocation's rolling average estimate of "accuracy" (distance) to settle out on the value for a new location from an old location. My experiments show this is about 20 seconds.
  3. The time it takes to get an immediate reading given radio fluctuation this should be 2-3 seconds at most.
  4. The calibration constant of your beacon. If your beacon is not calibrated properly, CoreLocation may overestimate the distance, causing (3) to take much longer until random variation happens to give you an immediate reading.

To speed up the above, first ensure proper calibration. Next, you may want to abandon iOS' distance estimation in favor of your own, based on the RSSI reading you get with each ranging callback. The advantage is you can get rid of the 20 second lag caused by the rolling average. But the real tradeoff is that you will see much higher variability on your distance estimate. Leading to false positives when you are further away than you want .

Community
  • 1
  • 1
davidgyoung
  • 63,876
  • 14
  • 121
  • 204
  • How should I ensure proper beacon calibration? Is it a vendor specific operation? I could not find anything relevant on the search engine. – Maciej Jastrzebski Jun 02 '14 at 14:16
  • Apps like Locate for iBeacon include a calibration function, which require you to simply hold your iOS device exactly one meter away from the beacon for 30 secs or so to collect samples. The average RSSI at this distance is then provided to you as a negative number. Next, you must configure your beacon with this calibration value. The means of entering the calibration value is different for each beacon vendor, so check the beacon's documentation. – davidgyoung Jun 02 '14 at 15:26