google / uribeacon

The Web Uri Open Beacon for the Internet of Things
Apache License 2.0
409 stars 108 forks source link

Validator App Scan Time #202

Open KST-Cory opened 9 years ago

KST-Cory commented 9 years ago

Hello Google Team,

I was wondering if it would be possible to increase the scan time for the validator tests when connecting to the UriBeacon. When I run the validator app on my firmware with an advertisement interval of 1285ms, the app has a difficult time connecting to the beacon but if I put the advertisement interval of my UriBeacon to something a lot quicker, such as 100ms, the app works perfectly. I noticed that the UriBeacon sample scanner app has a menu option for scan time, i think this could help with validating beacons that have an advertisement rate greater than or equal to 1285ms.

Thank You,

Cory Mast

scottjenson commented 9 years ago

Thanks for the feedback. The recommended advertising rate is 1000ms. There is no secret calculation here, it's just a reasonable trade off between battery and responsiveness for the user. We don't mind you going more quickly of course, but going slower is going to get you in trouble as the scanner app will have a slightly harder time finding all beacons if they broadcast more slowly.

The validator app is really there to test the API so in the short run, just set it to the recommended 1000ms time and test. If you really want your advertising time to be >1000ms, then we should talk in a different issue as I'd like to understand why you're doing that. With most modern chipsets, you should be able to get great battery life and still broadcast at the 1000ms range.

Scott

KST-Cory commented 9 years ago

Thanks for the fast reply Scott. The reasoning behind an advertising rate >1000ms and specifically 1285ms is because this is the upper limit of what is discoverable using iOS and it was just chosen to further maximize battery life while still being discoverable. Lowering the advertisement rate to 1000ms will definitely still give us great battery life and improve the user experience, which is the most important.

I will make the changes to my firmware to make the default mode equal to the recommended advertising rate of 1000ms. Thank you very much for clarifying this for me.

Cory

g-ortuno commented 9 years ago

The test scans for 5 seconds. So it seems that it should pick up your beacon.

Actually there are a couple differences between normal broadcasting and config broadcasting. You can have any value you want for the period when you're broadcasting the URI (as Scott mentioned 1000ms is recommended) but in Config Mode the period should always be 1000ms. Please let me know if you still have problems with 1000ms.

I added some more information about Config Mode to the spec. You can check it out here since it's not merged yet.

KST-Cory commented 9 years ago

I set my beacon to 1000ms advertise interval and the validator app functions much better. There are still some times when the validator can't see my beacon but I feel it is because I am testing the beacon in such a BLE flooded environment with so much traffic that missing some packets is unavoidable.

The updated Config Service spec definitely clears things up and I will implement the changes as soon as possible.

Another issue I am noticing, and this may be attributed to all the BLE traffic and noise in my test environment, but when I run the Core UriBeacon Tests, the validator app has difficulty seeing the advertisement packet. I get all green check marks up until the "Has Valid Advertisement Packet" test. The test doesn't fail, and the revolving arrow doesn't spin. I am using the Nordic Master Conrtrol Panel app for android to scan for the device while the test is running and I can see the beacon advertising the appropriate data but the app just sits there. If i use the "long press" feature on the tests that haven't executed yet while the app is locked up, I can sometimes force the app into finishing the test. I have made sure I am using the latest version of the app from https://github.com/google/uribeacon/releases and I am still experiencing difficulties. Do you have any thoughts?

Thanks!

g-ortuno commented 9 years ago

The arrow not revolving is a bug from Android and the new RecyclerView; if the arrow is being shown the the test is running. The test should run for at most 5 seconds and return an error if it can't find the beacon. Does it go for longer than 5 seconds? If this is the case I have a couple more questions:

  1. What device are you using to run the tests?
  2. What version of Lollipop does it have?
KST-Cory commented 9 years ago

It does go for longer than 5 seconds. If I let the screen timeout and then wake it back up, the validator app will still show the arrow on the "Has Valid Advertisement Packet" test but it will also show an arrow on the next test. I then end up with two arrows not revolving on two tests.

I am currently using a Nexus 7 tablet with Android version 5.0.1

g-ortuno commented 9 years ago

Two tests running at the same time is another bug that has been fixed since the latest release.

I'll look into the test running for more than 5 seconds. Thanks for the info!

KST-Cory commented 9 years ago

I will download and install Android 5.0.2 as soon as possible and see if that changes anything. Thank you for your support.

g-ortuno commented 9 years ago

Sorry what I meant was that the two tests running is a bug in the app, not on android. It wasn't fixed in time for the release but it is fixed on master. Either way it should't have anything to do with a test running for more than 5 seconds, unless the screen times out in the middle of the 5 seconds. Is that the case? If so could you increase the time out of the screen and see if the test runs for more than 5 seconds?