Unreliable Region monitoring (false positives)


#1

Hi!

I’ve been working on a iOS app (quite simple) that monitors and range beacons. Ranging seems to be working ok, but I’m having some issues with the background beacon monitoring:

My app currently is monitoring one specific beacon (Strong broadcasting power (4 dBm) & 1300ms interval). It simply sends a notification when didEnterRegion is fired, and another notification when didExitRegion is fired.
The problem is that I’ve been having unreliable results with the background monitoring, where I could be from 20 cm to 2 mts away from the beacon when suddenly didExitRegion gets fired, and of course, after that didEnterRegion is fired because I’m still inside the region (sometimes instantly, sometimes it takes some seconds) showing several entrance and exit notifications.

I’ve tried with a different beacon (just in case), but I’m getting the same results. Sometimes everything works fine, but some days I would get this crazy behavior.

Any ideas? Or something I should check? I know about the iOS 30 seconds waiting to avoid didExitRegion false positives, but it seems that is not working completely, or at least not always.

Any information is much appreciated.
Thanks!


Monitoring region problem
didEnterRegion and didExitRegion being called every minute
#2

Yes, I’ve seen that as well, and we got other similar reports too. The problem lies somewhere at the Core Location level, but we’ve had no luck getting to the bottom of it so far. I’m gathering some data to submit a bug report to Apple, maybe you could help me?

Could you try setting the adv interval to 100 ms (Apple’s official requirement for “pure/strict” iBeacon)? Could you try enabling the Basic Power Mode and disabling the Smart Power Mode? Does this happen with all of your beacons, or just some specific ones? If there are two iOS devices in range of the beacon, does the problem happen at the same time for both?


#3

Thanks for your reply heypiotr.

Good to know that I’m not alone with this problem. To answer some of your questions, this happened with 2 different beacons (both Estimote) and I didn’t try it with more than one device simultaneously, but I’ll try that today.

I’ll change the beacon settings to the ones you mention and let you know how it goes.
While I try this, don’t hesitate to ask anything else if it helps you gather data to send to Apple.
Cheers.


#4

Well, I’ve been using the beacons with Smart Power Mode disabled and a 100ms interval and so far the results are much better. I don’t suffer the false positives anymore. The only problem with this approach is, of course, the beacon’s battery life (only 3-4 months).
I will slowly increase the advertising interval to see if this behavior continues in order to try to extend the beacon’s battery life. Hopefully something around 400-500ms should be enough to get almost 2 years out of the beacon.


#5

Hi luchiolb thanks for this, exactly the problems we are seeing. Did you get to an optimal interval?


#6

We have been testing and so far we are happy with 500ms interval. It doesn’t fail as it used to, maybe once every now and then, nothing terrible. With that interval you get a decent battery life, I would recommend you to do some tests too, but that seems to be our magic number.


#7

I’ve posted a workaround here, do check it out!


#8

Hey we are facing this same issue! Thank you so much for your trial and error testing, we will change the settings to advertise every 500 ms and broadcast at 4dBm. How long on average do your beacons’ batteries last with these settings?


#9

Thank you so much, I’m not too familiar with NSOperationQueue or NSBlockOperation but I’m going to read into those classes and then add in your solution.


#10

You’ll get the exactly how much the battery will last when you apply the changes, but it’s approximately 12 months.


How to avoid duplicate uilocalnotification
#11

Thanks. So I tried it on 500 ms with 4 dBm all the way down to 100 ms advertising interval at 4 dBm and I’m still getting false positives :confused: I’m not sure what to do other than turning to continuous ranging in the background because our app cannot afford false positives as we are tracking people’s time.


#12

Yes, indeed the false positives continue, although I’ve experienced not as many as before. I think you’ll need to mix this approach with a logic filter or ranging in the background.
Try the filter first, where by some logic (a time flag or something), you check if the user to re-enter the region immediately after exiting. So, in that case you can ignore the exit/entrance event.


#14

I didn’t try @chaychoong solution. With Android, a time flag to check if a user re-enters immediately worked fine. With iOS it’s a little more complicated because of the background availability that only gives you around 10 seconds.
You should try looking for users re-entering the region up to 10 seconds after exit, and ignore the event if necessary or just go ranging in the background (I haven’t try this one).


#15

I was under the assumption that iOS gives around 3 minutes of background availability?


#16

Nop, and according to Apple docs:

Upon being woken up, the app has around 10 seconds to process the data. Ideally, it should process the data as fast as possible and allow itself to be suspended again. However, if more time is needed, the app can use the beginBackgroundTaskWithExpirationHandler: method to request additional time; it should do so only when absolutely necessary, though.


#17

But ranging doesnt work in background according to Estimote docs…right?


#18

In iOS ranging works in background for a limited time:


#19

Everybody! (:

We’ve just released Estimote iOS SDK 4.8.0 with our brand new feature: Estimote Monitoring.

It’s our own re-implementation of Core Location monitoring, and among other things, it should significantly reduce the number of false positives.

Read more in our blog post, includes how to try it, code snippets, etc.:
More reliable notifications for your beacon-based apps—say hi to Estimote Monitoring


#20

Nice to hear this! But i’m having this problem in android app, haven’t found any related information on android forum but it’s the same problem reported here, any news about this?