2
votes

I'm trying to range estimote beacons in my app. But when app ranges beacons after firing [beaconManager:didRangeBeacons:inRegion:] method,it outputs "CoreBluetooth[API MISUSE] CBCentralManager can only accept commands while in the powered on state " into debug console,and also i'm not able to connect to beacon for changing some values.I can range beacons and read values which don't require connection to beacon,such as minor,major,proximity etc.,but I also need to change them.

What's my problem?

Thanks in advance!

2
The comment says it all: you should not call any APIs on the central manager before you receive the state update with the Powered On state. The Core Bluetooth Programming Guide contains lots of info on how you should use the APIs.allprog
Hi there, We're still investigating the bug at Estimote. As for connecting to the beacons, please elaborate. Are you logged in to your Estimote Account when you try to access them, and are the beacons properly assigned to the account?Wojtek Borowicz
I've created a tool to help debug the API Misuse errors: github.com/nrbrook/NBCoreBluetoothAPIMisuseGuardNick

2 Answers

0
votes

I ran into the same problem. I suspect this is a bug with Estimote SDK. I managed to work around this by calling the startEstimoteBeaconsDiscoveryForRegion method (which I believe goes on to turn on CBCentralManager). My initialisation code is as follows:

_estBeaconManager = [[ESTBeaconManager alloc] init];
_estBeaconManager.delegate = self;
_estBeaconRegion = [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID identifier:@"Estimotes"];
[_estBeaconManager startRangingBeaconsInRegion:_estBeaconRegion];
[_estBeaconManager startEstimoteBeaconsDiscoveryForRegion:_estBeaconRegion];

Hope this helps

-1
votes

Just for you out there who are missing the obvious like me, make sure you have BlueTooth turned on on the phone.