False/Positive monitoring events for multiple regions

Hello,

I’m having an issue with the estimote proximity beacons and the estimote sdk.

I have two beacons that represent two distinctive regions. Defined like this:

    roomRegions.add(
        new Region("Jupiter Meeting Room", UUID.fromString("6BE60BBB-BA1F-458B-B712-04A67ADFF6EA"),
            42710, 38727));
    roomRegions.add(
        new Region("Neptune Meeting Room", UUID.fromString("532FACF3-5AA3-9AE7-AE8E-CDD402903BEA"),
            54629, 61342));

The beacons are placed at approximately 5 meters from each other (two rooms next to each other).

The issue I’m having is that I received an infinite number of events:

    03-17 08:43:49.191 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:43:49.211 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:44:04.331 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:44:05.961 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:44:19.751 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:44:20.241 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:44:34.631 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:44:34.701 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:44:49.881 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:44:50.261 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:45:05.541 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:45:07.241 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:45:20.231 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:45:22.031 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:45:35.421 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:45:35.601 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:45:50.501 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:45:50.641 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:46:05.671 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:46:05.761 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:46:21.081 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:46:22.911 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:46:36.241 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:46:37.521 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:46:51.221 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:46:55.651 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:47:06.521 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:47:08.501 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:47:21.511 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:47:21.791 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:47:38.481 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:47:38.781 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:47:53.731 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:47:54.291 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:48:07.291 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:48:11.691 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:48:22.221 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:48:23.971 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:48:37.621 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:48:39.471 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:48:52.881 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:48:54.531 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:49:07.901 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:49:09.191 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:49:22.851 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:49:25.791 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:49:38.161 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:49:38.461 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:49:54.431 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:49:55.411 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:50:09.061 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:50:09.811 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Jupiter Meeting Room, proximityUUID=6be60bbb-ba1f-458b-b712-04a67adff6ea, major=42710, minor=38727, secure=false}]
    03-17 08:50:23.731 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:50:24.341 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:50:38.851 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): OUTSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]
    03-17 08:50:39.081 11586-11586/com.example.android.beacon D/MonitoringEvent: receivedMonitoringEvent(): INSIDE: region = [Region{identifier=Neptune Meeting Room, proximityUUID=532facf3-5aa3-9ae7-ae8e-cdd402903bea, major=54629, minor=61342, secure=false}]

The INSIDE event is from onEnteredRegion() and OUTSIDE event is from onExitedRegion() from MonitoringListener interface.

This is the beacon manager config change I’ve made:

// Change the scan period for monitoring
beaconManager.setBackgroundScanPeriod(5000, 10000);
// Expiration period from 1000-60000ms(1s-60s) range.
// This affects how precise the exit event is but also how fast exit events are received
beaconManager.setRegionExitExpiration(5000);

I’ve also converted the MonitoringListener into an Observable:

  public Observable<MonitoringResult> getMonitoringObserver() {
    return Observable
        .create(emitter -> beaconManager.setMonitoringListener(new MonitoringListener() {
          @Override
          public void onEnteredRegion(Region region, List<Beacon> list) {
            if (!emitter.isDisposed()) {
              emitter.onNext(new MonitoringResult(region, State.INSIDE, list));
            }
          }
           @Override
           public void onExitedRegion(Region region) {
             if (!emitter.isDisposed()) {
               emitter.onNext(new MonitoringResult(region, State.OUTSIDE, Collections.emptyList()));
             }
           }
         }));

How can I overcome this issue? Is it an bug in the SDK, in the beacons itself or in my implementation?

In the end I want to avoid receiving exit events that are not correct(I show and hide an view based on these events and it starts to flicker for this scenario).
And as an extra step I want to show the closest one only (currently, it usually detects the one further away a little later and this replaces the old one in my logic), any recommendations on how I can achieve this?

Thank you and best regards,
Ionut Valentin Negru

Hello,

I have a small update on the issue:
I’ve noticed a different behaviour when I switched from singleton pattern to factory pattern for the BeaconManager object.

Does anyone know of some limitations of the BeaconManager regarding this kind of ussage?

Thank you.

I’ve noticed a different behaviour when I switched from singleton pattern to factory pattern for the BeaconManager object.

Does that mean it works just fine for you now? How you instantiate the BeaconManager shouldn’t affect scanning at all, could be a bug then. Mind sharing the code that shows how you go about that?

Hello,

Sorry for the late reply, I paused the project for the last few days.
Yes, it is working fine if I enforce a single instance of the BeaconManager. I do not know if it was because of the way I’ve implemented it or if it is something that remained active from the service behind the beacon manager.

When I resume the project I will make more tests and try to isolate the issue.

Thank you and best regards.