g-ortuno / eddystone-chrome-apps-demo

Chrome App that advertises a different URL depending on the image
Apache License 2.0
15 stars 4 forks source link

An advertisement is already advertising #2

Closed tvanier closed 8 years ago

tvanier commented 8 years ago

Thanks for the great demo app, I just tried it on my Chromebook (dev channel with the enable-ble-advertising-in-apps flag turned on) Version 49.0.2587.3 dev Platform 7729.0.0 (Official Build) dev-channel daisy Firmware Google_Snow_Rev4.2695.128.0 The initial registerAdvertisement promise is rejected with the "An advertisement is already advertising" message. eddystone.advertisements is empty. chrome.runtime.lastError does not seem to contain more info. I see the same error with my own sample app. What could cause this error? Is there a workaround?

g-ortuno commented 8 years ago

What chromebook are you using? Make sure Bluetooth is turned on and try closing the app and restarting the chromebook.

tvanier commented 8 years ago

Thanks @g-ortuno . I tested on a 2013 Samsung XE303C12-A01US. It seems to work after connecting a USB dongle - an Asus BT400 I think, which came with my Chromebox CN60 (I have not tested the demo app on the Chromebox yet)). I can see advertised URLs on my Android phone when the app is started after the Chromebook booted, but I see the same "An advertisement is already advertising" when restarting just the demo app. Should Eddystone.advertisements only contain 1 single advertisement at a time? On what hardware was the demo app tested? More generally, does eddystone require Bluetooth v4?

g-ortuno commented 8 years ago

Yes. Bluetooth 4.0 doesn't support multiple Adv Packets at the same time, so you have to unregister a previous advertisement in order to register a new one. That's one of the reasons the feature sits behind a flag.

I tested it on a Chromebit, a Pixel and a couple chromeboxes. All of them have BT 4.0. Let me know if you have any more problems/questions.

tvanier commented 8 years ago

Thanks @g-ortuno , I will test on my Chromebox. I was wondering about the options to see the advertised URL on Android? I am testing with the Physical Web app, there may be other ways for a demo? Can Chrome itself display Adv Packets?

g-ortuno commented 8 years ago

They are working on that! It is currently behind a flag on Chrome for Android:

https://phy.net/2015/11/enable-the-physical-web-for-chrome-dev/

tvanier commented 8 years ago

Thanks @g-ortuno for all the info, the demo app works great on my Chromebox, I can see the advertised URL in Chrome Dev for Android! Feel free to close this issue.