EddystoneScanner-iOS-SDK icon indicating copy to clipboard operation
EddystoneScanner-iOS-SDK copied to clipboard

Background mode

Open vasquezdennisalon opened this issue 6 years ago • 9 comments

I was reviewing the code but when I put the application in background mode without destroying the application the Eddystone library stops detecting beacon scanning.

vasquezdennisalon avatar Mar 08 '19 20:03 vasquezdennisalon

@vasquezdennisalon Are you running the Sample App?

sachinmobstac avatar Mar 20 '19 05:03 sachinmobstac

@sachinmobstac I'm actually running the sample application, but when placing the application in background mode it only sends packets every so often or it's a bit slower to read the beacon

vasquezdennisalon avatar Mar 20 '19 13:03 vasquezdennisalon

@vasquezdennisalon, That's strange. It works normally for me. Can you let me which hardware beacons are you using?

sachinmobstac avatar Mar 22 '19 09:03 sachinmobstac

@vasquezdennisalon, Hey updates?

sachinmobstac avatar Apr 15 '19 11:04 sachinmobstac

Thank you for the support you provide.

The information of the beacons is the following:

  • Firmware Version Estimote OS 4.13.2
  • Hardware F3.3

And with the new update when I have the app in foreground I quickly detect the beacons but in background mode it takes a bit to detect the beacons or even not detect them.

vasquezdennisalon avatar Apr 15 '19 14:04 vasquezdennisalon

@vasquezdennisalon, I don't have the hardware to test the scenario. Since this is an open source project, is it possible for you to check what's going wrong in the background?

sachinmobstac avatar Apr 16 '19 04:04 sachinmobstac

@sachinmobstac, I still have the same problem when the application is in the background, when the application is in the foreground the reading of the bluetooth is fast but when the application is in the background the reading of beacons is slower

I attached the github link of my project

The steps to perform the tests is as follows:

  1. Start the project
  2. Detect a beacon (with this you can see that the readings of beacons are continuous can be seen through the func didUpdateBeacon (scanner: Scanner, beacon: Beacon))
  3. Place the app in the background and with this you can see that the readings are slower also by means of the func method didUpdateBeacon (scanner: Scanner, beacon: Beacon)

I also attach a sample file of readings so you can see what is happening

vasquezdennisalon avatar May 31 '19 16:05 vasquezdennisalon

Hi @vasquezdennisalon, It looks like the CBCentralManager is slow in detecting the peripherals and we are not doing anything fuzzy in the background.

Since the project is open source, you can help us fix this bug by contributing.

sachinmobstac avatar Jun 03 '19 10:06 sachinmobstac

Good day, with good news to improve the library I have found several cases:

  1. Apple has a problem with the detection of bluetooth devices I do not know if it is called a bug but when time goes by it takes longer to go recognizing beacons so much of this depends on how you configure a beacon so that applications recognize the beacons quickly guide me of this documentation to configure a beacon

Additionally beacons must be configured with Transmit Power (Tx) = Strong (0 dBm) and Advertising interval = 210ms This so there is not much time waiting for the discovery of bluetooth packets.

  1. To improve the distance you have to perform a regression by device I share a link where I could make distance measurements and thus be able to perform the regression, but unfortunately I could only do it for iPhone 5s, 6s, 7, XS devices

with this information the formula of the distance would be as follows:

if (rssi == 0) {return -1.0}

let ratio: Double = Double (rssi / 1m_RSSI);
var distance: Double = 0

if (ratio <1.0) {distance = pow (ratio, 10)}
else {distance = (A) * pow (ratio, B) + C}

return distance

For the other phones that I could not make the measurements, leave one by default:

A = 0.89976
B = 0.111
C = 7.70950
1m_RSSI = -60

With this you can get a better approximation of the distance

  1. In the Arma filter, the variable ARMA_FILTER_PROCESS_NOISE is currently 0.15 and found that working at 0.5 calculates the distance more efficiently, that is, calculates it faster.

Help

Another thing that I would like to try, maybe you help me, I'm doing comparisons with Android and there is a library called AltBeacon creates a method called setBeaconSimulator with which you can simulate a beacon, how could we do this part in Swift so that the management of unit tests is more efficient.

https://altbeacon.github.io/android-beacon-library/beacon_simulator.html

vasquezdennisalon avatar Jul 12 '19 16:07 vasquezdennisalon