iPhone: Paired Devices vs iBeacon Bluetooth Battery Consumption

Hi there,

I’ve a quick question about the battery consumption of iBeacons (Estimote) and connected bluetooth devices. So here is the situation.

Situation:
I’ve 2 apps (1 that is registers and scans for iBeacons (Estimote) in the background, no ranging) and the other without. Both of these apps are essentially similar with the exception of 1st being enabled for iBeacons.

// location manager config
+ (CLLocationManager *)sharedLocationManager {
       static CLLocationManager *_locationManager;

      @synchronized(self) {
              if (_locationManager == nil) {
                 _locationManager = [[CLLocationManager alloc] init];
                 _locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers;
                 _locationManager.pausesLocationUpdatesAutomatically = NO;
                 if ([_locationManager respondsToSelector:@selector(allowsBackgroundLocationUpdates)]){
                     _locationManager.allowsBackgroundLocationUpdates = YES;
        }
     }
   }
  return _locationManager;
}


- (void)startMonitoringItem:(Item *)item {
 CLBeaconRegion *beaconRegion = [self beaconRegionWithItem:item];
 CLLocationManager *locationManager = [LocationTracker sharedLocationManager];
 [locationManager startMonitoringForRegion:beaconRegion];
}

- (void)stopMonitoringItem:(Item *)item {
    CLBeaconRegion *beaconRegion = [self beaconRegionWithItem:item];
    CLLocationManager *locationManager = [LocationTracker sharedLocationManager];
    [locationManager stopMonitoringForRegion:beaconRegion];
}

I’ve registered about a 100 iBeacons within the 1st app, and ran both apps on an iPhone 6 and an iPhone 6 Plus, running the same OS version within the vicinity of the 100 plus iBeacons, both with blue tooth enabled.

I’m only interested in entry and exit events, and essentially just implemented both of these calls in the 1st app. I ran the tests for about 14 hours, by just leaving both iPhones with bluetooth enabled within the vicinity of the iBeacons.

When I checked my battery status in my settings menu, the 1st app consumed at most 1% more battery than the 2nd app (eg: 1st app: 25%, 2nd app: 24%), which is the same on both devices. This is expected behaviour, as the blue tooth scanning algorithm controlled by iOS should be optimised to preserve battery.

However, on my client’s device, the 1st app consumes 5x more battery than the 2nd app (eg: 1st app: 10%, 2nd app: 2%). Both the 1st and 2nd apps were running for approximately the same time, and I checked the percentages in both the last 24 hours and 7 days.

When I checked his bluetooth setting, I realized that his iPhone was paired with about 8 other devices.

So my question is this. Will pairing with other devices caused a much larger battery drain on my 1st app even though it is just scanning for iBeacons? If yes, is there any way I can optimized by algorithm to ignore paired devices and just scan for iBeacons.

StackOverflow Opinion 1:

One of the replies that I got from David, on Stack Overflow was:

Yes, bluetooth pairing, especially classic bluetooth will use much more battery than scanning for beacons in the background on iOS.

There is nothing you can do about pairing that is done outside your app. Apple’s iOS sandboxes apps so they cannot affect general system settings (such as bluetooth on or off, or bluetooth pairing for things like tethering and speakers) or the behavior of other apps (like those that might pair with bluetooth devices for app-specific purposes.)

The bottom line is that the battery usage you describe is not caused by your app’s beacon scanning. It is caused by the pairing. If you uninstall the 1st app from your client’s device, the device should drain the battery at a similar rate as if your app were not installed at all.

Question:

If David is correct, then why is the additional battery usage for the connected devices being counted under my 1st App which was just scanning for Estimote beacons? If I uninstall the 1st App, will the additional battery usage for connected devices count under another blue-tooth enabled app that is also scanning for ibeacons (eg: Estimote app)?

I think David is correct in saying that being paired with many Bluetooth accessories should contribute to greater battery consumption overall, but it shouldn’t count against your apps. He actually clarified that in a comment underneath his answer.

My own suspicions:

  • Some bug (feature?) in iOS, which counts general Bluetooth usage against all apps that use Bluetooth.

  • Being paired with so many Bluetooth devices causes iBeacon scanning to switch away from a battery-efficient hardware-assisted BLE scanning, into regular scanning (like ranging, only less frequently). The Bluetooth hardware used in iPhones might have some limit when it comes to how many Bluetooth devices it can handle at the same time.

    Maybe you could try unpairing one device at a time, restarting monitoring (once a monitored region gets registered in the non-hardware-assisted “slot,” it won’t automatically switch to a hardware-assisted slot should one become available—you need to force it by restarting monitoring), and measuring again?