Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background mode #6

Open
vasquezdennisalon opened this issue Mar 8, 2019 · 9 comments
Open

Background mode #6

vasquezdennisalon opened this issue Mar 8, 2019 · 9 comments

Comments

@vasquezdennisalon
Copy link

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.

@sachinmobstac
Copy link
Contributor

@vasquezdennisalon Are you running the Sample App?

@vasquezdennisalon
Copy link
Author

@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

@sachinmobstac
Copy link
Contributor

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

@sachinmobstac
Copy link
Contributor

@vasquezdennisalon, Hey updates?

@vasquezdennisalon
Copy link
Author

vasquezdennisalon commented Apr 15, 2019

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.

@sachinmobstac
Copy link
Contributor

@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?

@vasquezdennisalon
Copy link
Author

vasquezdennisalon commented May 31, 2019

@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

@sachinmobstac
Copy link
Contributor

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.

@vasquezdennisalon
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants