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?

4

1 回答 1

2

您提到的延误可能是由四个因素造成的:

  1. CoreLocation 为您提供单次测距更新所需的时间:1 秒
  2. CoreLocation 对“准确度”(距离)的滚动平均估计从旧位置确定新位置值所需的时间。 我的实验表明这大约是20 秒。
  3. 鉴于无线电波动,立即读数所需的时间最多应为2-3 秒。
  4. 信标的校准常数。如果您的信标未正确校准,CoreLocation 可能会高估距离,导致 (3) 需要更长的时间,直到随机变化恰好为您提供即时读数。

为了加快上述速度,首先要确保正确校准。接下来,您可能希望放弃 iOS 的距离估计,转而使用您自己的距离估计,基于您在每个测距回调中获得的 RSSI 读数。好处是您可以摆脱滚动平均造成的 20 秒滞后。但真正的权衡是,您会看到距离估计的可变性要大得多。当您比您想要的更远时会导致误报。

于 2014-06-02T10:40:13.723 回答