Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iBeacons Multiple Monitoring

Tags:

ios

ibeacon

I am developing an application which will have multiple ibeacons to detect and react according. The client has different stores in which he wants to deploy the beacons. I am now in a situation where the ibeacons are very close to each other. All the beacons share the same UUID but different major and minor values.

The situation is this:

A user enters the shop and it receive first notification through beacon monitoring. Now to get the other notification for the other beacon the user has to left the region and enter it again in order for the didEnterRegion to call otherwise the user will not get the alert for the other beacons. And that is not happening in my case. The beacons are close to each other that the user not really leaves the region once it enters it. And the notifications do not come through ranging once the device is locked or the application is killed.

Any suggestions on how to tackle this problem in a real case scenario. How to get the notification for all the beacons on a lock screen. I am using the estimote beacons for development.

like image 315
Aleem Ahmad Avatar asked Aug 08 '14 09:08

Aleem Ahmad


People also ask

Can multiple beacons have same UUID?

No, the API does not work that way.

Which communication protocol is used by iBeacons?

iBeacon is just a Bluetooth protocol whereas beacon is a common name for a device that transmits iBeacon or Eddystone protocols. iBeacon does not collect any data - it is a protocol received by mobile apps that can with a user consent track certain information.

What is iBeacon in IOT?

iBeacon is a small-scale network device that uses Bluetooth Low Energy (BLE) and acts as a transmitter to detect and track smartphones.

What is the range of iBeacon?

The maximum range of an iBeacon transmission will depend on the location and placement, obstructions in the environment and where the device is being stored (e.g. in a leather handbag or with a thick case). Standard beacons have an approximate range of 70 meters. Long range beacons can reach up to 450 meters.


2 Answers

This is a common problem. As you have seen, background detection is only triggered by region monitoring, and if your regions are set up to cover multiple beacons in the same physical area, you won't get background notifications as you move between them.

You can only get entry/exit updates in the background for a maximum of 20 BeaconRegions per app. So the common solution is to creatively use these 20 BeaconRegions for maximum results. If you have 20 or fewer different beacons within range of each other, the technique is straightforward -- you simply create one region for each beacon, and monitor on all of these.

If you need to work with > 20 beacons, then you have to come up with a numbering scheme that helps this along. For example, you can set all of the beacons' ProximityUUIDs to the same value, number your major values 1-20, and then set the minor values to a unique number for each beacon. You then would then monitor for the 20 regions, each with a different major number. You would also set up simultaneous ranging so you can also get the minor identifier of detected beacons. Like this:

  CLBeaconRegion *region1 = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"region1" major:1 ];
  CLBeaconRegion *region2 = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"region2" major:2 ];
  ...
  CLBeaconRegion *region20 = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"region20" major:20 ];

  [locationManager startMonitoringBeaconsInRegion:region1];
  [locationManager startRangingBeaconsInRegion:region1];
  [locationManager startMonitoringBeaconsInRegion:region2];
  [locationManager startRangingBeaconsInRegion:region2];
  ...
  [locationManager startMonitoringBeaconsInRegion:region20];
  [locationManager startRangingBeaconsInRegion:region20];

This technique works well if you can ensure that there is never a case where two beacons with the same minor number that would be within radio range of a mobile device simultaneously (e.g. beacons with the same minor must be > 100 meters apart). If you can't do this, then you have to start making compromises.

like image 123
davidgyoung Avatar answered Oct 19 '22 18:10

davidgyoung


Multiple beacons monitoring is not possible. Since iOS has limits, maximum number of supported regions should be 20. We can achieve your use case by doing the followings.

  • Group all the beacons with single UUID. We can monitor one region instead monitoring multiple regions
  • Capture the nearby beacons through ranging(Monitoring will trigger only enter and exit. When the user stays within the region for longer time, then monitoring delegated won't be triggered.) Sort the beacons with proximity received through didRange method.

If no beacons found with "Immediate" Proximity, move to next proximity Near. Display notification if we found any one beacon with proximity Immediate. If more than one beacons are found with immediate proximity, then sort using RSSI. Lowest RSSI will be the closest beacon and display the notification for the closest one.

If no beacons found with "Near" Proximity, move to next proximity Far. Display notification if we found any one beacon with proximity Near. If more than one beacons are found with near proximity, then sort using RSSI. Lowest RSSI will be the nearest beacon and display the notification for the nearest one.

If no beacons found with "Far" Proximity, then you don't have any beacons nearby. Display notification if we found any one beacon with proximity Far. If more than one beacons are found with Far proximity, then sort using RSSI. Lowest RSSI will be the nearest beacon and display the notification for the nearest one.

Unknown - You can ignore this

like image 30
Ambi Avatar answered Oct 19 '22 17:10

Ambi