1
votes

We are using AltBeacon for detecting regions in the background. For an important use case of the project we absolutely need to have a lot of very small regions (basically one beacon with minimum transmitting power is the whole region) and very close to each other. With this beacon setup, we get notified at each region event, but the enter region events are triggered earlier than we would like them to do, usually happening when we walk in a 10m radius of the beacon (representing the region). Our goal is to at least cut this distance in half. I understand that this use case is not an ideal one for region monitoring, but it is essential that it works this way. Is it possible to set a minimum distance for getting notified on enter region events?

A possible solution we are starting to test is to always do ranging (even on the background), overriding the default foreground scan periods to something resembling background monitoring. Our worries are that the distances might not be reliable (due to the scans not happening all the time and the minimum beacon power settings) and that the battery consumption might be higher than an equally frequent monitoring. Any thoughts on this approach?

2

2 Answers

0
votes

You can use onReadRemoteRssi . This measures the signal strength in dB and you can approximate the distance by it. Keep in mind that it is not accurate and you have to test it. I've tried something like this but there were some peak values like a noise and you should filter them. Here is one example

0
votes

The Ranging and Monitoring APIs are abstract concepts applied to detecting beacon packets. As you have found for your use case, neither concept fits perfectly.

What you want is two things at the same time:

  1. Logic triggered on a short distance from a specific beacon (like Ranging)

  2. Battery friendly detections (like Monitoring)

Unfortunately, to estimate distance, you must do constant Bluetooth scans as is typically done for ranging in the foreground. These constant scans do use more battery.

Depending on your use case it may be possible to do constant ranging in the background but only or a limited time. This should give you acceptable distance estimates for that period. You could decide when to start this (e.g. first beacon detection) and continue only as long as beacons are detected or for a maximum time interval, say 10 minutes. If you can limit the time, the battery usage may be acceptable.