Monitoring onExitedRegion delay

My android app shows an alert when a user enters a region, and another alert when the user exits a region. There are three separate regions with one beacon each. The enter events are triggered very fast when you come into range of a beacon. However, the exit events seem to have a delay of at least 15 seconds.

I understand that there is a default delay to protect from false positive exit events, so I used beaconManager.setBackgroundScanPeriod(15000,1000), and beaconManager.setRegionExitExpiration(1000), (note: I am passing java Longs for the time as required) however there is still a delay of about 15 seconds after exiting a region before the alert is displayed.

Am I doing something wrong, or is it not possible to trigger the onExitedRegion function any faster?

Hi @matthew.carney,

I tried the same thing, but it seems that you can’t receive exit events under this 15 seconds guard-time…
Maybe I did something wrong too ^^

Hi,
I can confirm - we have a bug here in recent SDK versions. It forces SDK to always use default 20s timeout before triggering onExitEvent.
We working hard to solve the issue. Fix should be available in upcoming SDK version - stay tuned :slight_smile:

Regards
Wojtek

3 Likes

nice to hear it guys!

Hi,
New SDK version is ready to be downloaded: compile 'com.estimote:sdk:1.0.13'
Check it out and let us know if fix works as expected.

Regards
Wojtek

@Wojciech_Wawerek

Nope ,

it works not as expected.
I’ve tried setRegionExitExpiration(60000) and setRegionExitExpiration(1000), but

it is always set to 20000=20s.

heh… like always - “strange, it works for me” :slight_smile:
We’ll investigate it further - stay tuned

Regards
Wojtek

I’ve tried it on Android 5.0.1 and 5.1 devices.

Hey, it works for me, when I put:


[...]

        // Set the monitoring settings.
        beaconManager.setBackgroundScanPeriod(1000, 0);

        // Set the exit expiration to it's min (between 1000 and 60000 in ms).
        beaconManager.setRegionExitExpiration(1000);

[...]

The exit notification came with 1 second delay :slight_smile:

here is my code:

beaconManager.setForegroundScanPeriod(200, 0);
beaconManager.setRegionExitExpiration(1000);

and it don’t work.

Are you using background or foreground scanning?

foreground, that why I use:

beaconManager.setForegroundScanPeriod(200, 0);

Discovery is always foreground.

Android SDK - Basic concepts

Are you doing that:

  • you use monitoring technology,
  • you monitor a region in foreground.

I think what you wrote is wrong, because:
the setForegroundScanPeriod() is used for ranging (see the JavaDoc),
and setRegionExitExpiration is for monitoring onExitRegion call.

I only use Discovery, cause I use EddystoneListener.

Yes, but, why is a beacon there and the app gets data from sdk, although I removed batteries, and the data is received for exactly 20s.

In 0.16.0 it worked fine

OK, so you want to change the scanning period of the ConfigurableDevice scanner, don’t you?
The doc’ doesn’t seems to demonstrate how to do this…

Just to @Wojciech_Wawerek, the monitoring setRegionExitExpiration is working well on 1.0.13 :slight_smile:

if you say, that setRegionExitExpiration is for monitoring onExitRegion call.

Why is onEddystoneFound invoked although the beacon has no power supply (batteries are removed) and put out the namespace and instance of the beacon (Eddystone), so I can be sure, that is the beacon I had on my desk.

It’s quite obvious that no, but maybe another beacon is active near you…

no, I use EddystoneListener. and I start it with beaconManager.startEddystoneDiscovery().

The problem is:

  1. beacon batteries are removed
  2. earlier there was no eddystone packet received after 1 second (sdk 0.16.0)
  3. now I get eddystone packets for 20s, but no other beacons are there, only one beacon! (sdk 1.0.12+)