Estimote / Android-Fleet-Management-SDK

Estimote Fleet Management SDK for Android
https://developer.estimote.com
MIT License
836 stars 451 forks source link

Secure UUID enter/exit area detection is erroneous in random situation #124

Closed maddie closed 9 years ago

maddie commented 9 years ago

The application I'm developing is an auto check in/out application, which will monitor the only one beacon that I've owned. I have updated to 0.9.1 and enabled Secure UUID as per the updated README.

At first it seems like it works just fine, however when I leave the area of my own beacon and went to some other places, my application still triggers onEnter and onExit, like it was entering my beacon's area.

This was not the case when I haven't enabled Secure UUID on previous versions of the SDK.

I'm not sure how could I provide any logs since it occurs quite randomly in what it appears to be in random locations.

And I've noticed that these events were triggered like I was really entering my beacon's area, for example, when I enter a mall (which likely have beacons), it checks in. When I leave its proximity, it checks out.

wiktor commented 9 years ago

@maddie Yup, we already had identified this problem and will be issuing fix within next release. I'll keep this issue open till release is ready.

maddie commented 9 years ago

@wiktor Good to know! Thanks for your great work!

wiktor commented 9 years ago

Should be fixed with v0.9.2.

maddie commented 9 years ago

Same thing still happening with v0.9.3

The monitoring runs in a Service. Still randomly checks in/out...

wiktor commented 9 years ago

@maddie Secure UUID bugs were eliminated. Now we are concentrating on better monitoring (does not matter if secure or not). Tracking issue is here: https://github.com/Estimote/Android-SDK/issues/130

maddie commented 9 years ago

@wiktor Thanks.

But with the very same code, only changing Region to SecureRegion, random onEnter/onExit still occurs.. Only when I use Region the problem seems to go away.

This happened on Nexus 5 and OnePlus Two, both running Lollipop.

wiktor commented 9 years ago

@maddie Can you enable debug logging in the SDK (EstimoteSDK.enableDebugLogging(true)) and copy logs here?

maddie commented 9 years ago

Log as below, that's all I can get with EstimoteSDK.enableDebugLogging(true).

As the trigger seems to be another beacon around the device (not owned by me, of course), I have used an iPhone as a Virtual Beacon (using the Estimote app). Once I turned it on, seconds later the device registered the onEnter event. After turning the virtual beacon off, the device calls onExit.

The application was running on a Nexus 5, with stock Android 5.1

10-31 15:37:46.673 5735-15600/com.example.app D/BluetoothAdapter: startLeScan(): null
10-31 15:37:46.744 15551-15567/? D/BtGatt.GattService: registerClient() - UUID=f4d5e1ad-7519-4291-a16f-1c8a4e89b3e8
10-31 15:37:46.745 15551-15571/? D/BtGatt.GattService: onClientRegistered() - UUID=f4d5e1ad-7519-4291-a16f-1c8a4e89b3e8, clientIf=5
10-31 15:37:46.745 5735-10551/com.example.app D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=5
10-31 15:37:46.750 15551-15566/? D/BtGatt.GattService: start scan with filters
10-31 15:37:46.752 15551-15596/? D/BtGatt.ScanManager: handling starting scan
10-31 15:37:46.754 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - queue=1
10-31 15:37:46.754 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - ScanSetting Scan mode=2 mLastConfiguredScanSetting=-2147483648
10-31 15:37:46.822 5735-5735/com.example.app D/BeaconMonitoring: entered
10-31 15:37:46.836 5735-5735/com.example.app D/BeaconMonitoring: entered
10-31 15:37:46.836 5735-5735/com.example.app D/BeaconMonitoring: entered
10-31 15:39:17.229 15551-15572/? D/BtGatt.GattService: stopScan() - queue size =1
10-31 15:39:17.230 15551-15596/? D/BtGatt.ScanManager: stop scan
10-31 15:39:17.232 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - queue=0
10-31 15:39:17.232 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - ScanSetting Scan mode=-2147483648 mLastConfiguredScanSetting=2
10-31 15:39:17.232 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - queue emtpy, scan stopped
10-31 15:39:17.234 15551-15567/? D/BtGatt.GattService: unregisterClient() - clientIf=5
10-31 15:39:47.239 5735-15600/com.example.app D/BluetoothAdapter: startLeScan(): null
10-31 15:39:47.242 15551-15566/? D/BtGatt.GattService: registerClient() - UUID=5f147d91-3b1f-4f64-8f2a-7b725446790f
10-31 15:39:47.251 15551-15571/? D/BtGatt.GattService: onClientRegistered() - UUID=5f147d91-3b1f-4f64-8f2a-7b725446790f, clientIf=5
10-31 15:39:47.253 5735-5758/com.example.app D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=5
10-31 15:39:47.262 15551-15572/? D/BtGatt.GattService: start scan with filters
10-31 15:39:47.270 15551-15596/? D/BtGatt.ScanManager: handling starting scan
10-31 15:39:47.291 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - queue=1
10-31 15:39:47.297 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - ScanSetting Scan mode=2 mLastConfiguredScanSetting=-2147483648
10-31 15:39:57.303 5735-15600/com.example.app D/BluetoothAdapter: stopLeScan()
10-31 15:39:57.314 15551-15572/? D/BtGatt.GattService: stopScan() - queue size =1
10-31 15:39:57.319 15551-15596/? D/BtGatt.ScanManager: stop scan
10-31 15:39:57.330 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - queue=0
10-31 15:39:57.330 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - ScanSetting Scan mode=-2147483648 mLastConfiguredScanSetting=2
10-31 15:39:57.330 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - queue emtpy, scan stopped
10-31 15:39:57.340 15551-15567/? D/BtGatt.GattService: unregisterClient() - clientIf=5
10-31 15:40:27.351 5735-15600/com.example.app D/BluetoothAdapter: startLeScan(): null
10-31 15:40:27.354 15551-15567/? D/BtGatt.GattService: registerClient() - UUID=c39c3158-6221-49f2-a225-fa97346c7f18
10-31 15:40:27.355 15551-15571/? D/BtGatt.GattService: onClientRegistered() - UUID=c39c3158-6221-49f2-a225-fa97346c7f18, clientIf=5
10-31 15:40:27.356 5735-10551/com.example.app D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=5
10-31 15:40:27.358 15551-15566/? D/BtGatt.GattService: start scan with filters
10-31 15:40:27.359 15551-15596/? D/BtGatt.ScanManager: handling starting scan
10-31 15:40:27.361 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - queue=1
10-31 15:40:27.361 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - ScanSetting Scan mode=2 mLastConfiguredScanSetting=-2147483648
10-31 15:40:37.368 5735-15600/com.example.app D/BluetoothAdapter: stopLeScan()
10-31 15:40:37.370 15551-15566/? D/BtGatt.GattService: stopScan() - queue size =1
10-31 15:40:37.371 15551-15596/? D/BtGatt.ScanManager: stop scan
10-31 15:40:37.374 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - queue=0
10-31 15:40:37.374 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - ScanSetting Scan mode=-2147483648 mLastConfiguredScanSetting=2
10-31 15:40:37.374 15551-15596/? D/BtGatt.ScanManager: configureRegularScanParams() - queue emtpy, scan stopped
10-31 15:40:37.375 15551-15572/? D/BtGatt.GattService: unregisterClient() - clientIf=5
maddie commented 9 years ago

Any thoughts?

heypiotr commented 9 years ago

Does this problem still appear with the latest SDK? We've implemented some Secure UUID and monitoring improvements since 0.9.1.

maddie commented 9 years ago

Hi @heypiotr ,

Thanks for the response. Actually the log above was from using v0.9.4.

I'm not sure if I can provide any more logs to troubleshoot the problem. It occurs on Nexus 5, OnePlus Two, and Xiaomi 4, so I guess it shouldn't be hardware related.