Junfeng
Junfeng

Reputation: 93

ios beacon scanning interval

I want to use iPhone running a beacon scanning app to detect iBeacon to measure my distance changing. However I found the scanning rate is 1 per second, which cannot satisfy my moving speed. Some documents show scanning 1 time per second is determined by API that cannot be changed.

So do I have chance to speed up scanning rate?

Upvotes: 0

Views: 1340

Answers (1)

davidgyoung
davidgyoung

Reputation: 65015

There are two issues with the ranging beacons with CoreLocation for fast moving mobile devices:

  1. As you mention, updates come only once per second.
  2. The distance estimate in the CLBeacon accuracy field is based on the running average of the RSSI over 20 seconds, so it effectively gives you the average distance over that interval.

Unfortunately, you cannot change this -- it is how the API works. An alternative is to use the CoreBluetooth APIs, which can give you a call back once for each Bluetooth packet -- 10 times per second for a beacon advertising at that rate. Three obstacles with this:

  1. You do not get a distance estimate with CoireBluetooth callbacks, just an RSSI measurement, so you must calculate your own distance from RSSI.
  2. There is a lot of noise on RSSI, so using only a single reading the calculated distance estimate will be very inaccurate.
  3. An iBeacon transmission cannot be parsed by iOS using CoreBluetooth, so you must use an alternate beacon format like AltBeacon.

You have to decide if these obstacles are acceptable for your use case.

Upvotes: 2

Related Questions