LocationManager: didRangeBeacons method does not detect BLE device

I am using the Nordic BLE nRF8001 development kit to test CoreBluetooth. Using the CBCentralManager methods (e.g. didDiscoverPeripheral (), didConnectPeripheral (), etc.) my iPhone 5 is able to detect Nordic advertisements and connect to it just fine . However, I am not getting any response from the new locationManager or regionMonitoring methods. Below I will explain my setup:

1.) First, I received my NSUUID from my Nordic device in the didDiscoverPeripheral () delegation method using the transmitted on the peripheral device (my northern device). By the way, I created a special service for my Scandinavian device, so suppose this peripheral device is a Scandinavian device. To get the NSUUID, I used:

NSUUID *uuid = [peripheral identifier]; NSString *uuidString = [uuid UUIDString]; //uuidString = 9A8D4C73-152D-BBDA-E4C2-9CE952654645 

2.) Then I create a beacon area for my northern device and create a CLLocationManager:

  self.locationManagerBeacon = [[CLLocationManager alloc] init]; [self.locationManagerBeacon setDelegate:self]; NSUUID *myUUID = [[NSUUID alloc] initWithUUIDString:@"9A8D4C73-152D-BBDA-E4C2-9CE952654645"]; self.beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:myUUID identifier:@"nordicRegion"]; self.beaconRegion.notifyEntryStateOnDisplay = YES; 

3.) Now I start monitoring the area of ​​the lighthouse

 [self.locationManagerBeacon startRangingBeaconsInRegion:self.beaconRegion]; 

4.) Problem : locationManager: didRangeBeacons: inRegion is called, but the beacon area is always empty.

Question: Do I need to configure the Nordic BLE device in a certain way so that new locationManager beacon methods can detect it (for example, BLE ad frequency, power level, etc.)? If so, can someone point me to the documentation.

Appreciate the help!

+2
ios iphone bluetooth ibeacon
source share
4 answers

I always assumed that in order to use the range of beacons you should first start monitoring beacons:

 [theLocManager startMonitoringForRegion: region1]; [theLocManager startRangingBeaconsInRegion: region1]; 

This code works fine for me (plus, like you, I also set notifyEntryStateOnDisplay = YES).

Try it and see if it has changed. Otherwise, I would say that you have something wrong with the BLE package that you broadcast to serve as an advertisement for the beacon.

You might also try downloading the Apple AirLocate demo (which will listen to the beacons and turn your iOS device into a beacon.) You can use AirLocate to see if it recognizes your BLE user device as a beacon. If so, use AirLocate to transmit as a beacon and see if its code recognizes.

+6
source share

I found that sometimes having an empty string (@ "") as an identifier will result in the same pro

 region = [[CLBeaconRegion alloc] initWithProximityUUID:UUID identifier:[UUID UUIDString]]; 

We hope this helps.

Z.

0
source share

Thanks to Duncan for commenting "something is wrong with the BLE package." I used several Estimote lighthouses that I bought some time ago. I also returned an empty array. When I connected to them using the Estimote iOS app, it showed that the Estimote operating system is out of date. I used the beacon update application and they started to appear for me in the array.

0
source share

In my experience, there are a few things that could go wrong if you followed Duncan's instructions and still don't work:

  • The generated CLBeaconRegion must have unique identifiers if you control several regions. If they are not unique, then didRangeBeacons will be called, which will be an empty array beacon.
  • You should not call startMonitoringForRegion and startRangingBeaconsInRegion in the dispatch_async block.
  • If this still fails, check in your centralManagerDidUpdateState implementation that you reset monitoring when you see CBCentralManagerStatePoweredOn .
0
source share

All Articles