bluetooth: Web Page stops receiving notifications |
||
Issue descriptionFrom external developer: We are seeing the same that might be the same or related to this bug, where we are running Zephyr on a arduino 101, that registers a couple BLE Gatt services, where one of the service allows client running Android device to subscribe to temperature updates. We wrote our web page that uses the BLE api to connect to the device, and then monitors the updates, the device sends 1 notifcation every 0.5 second, and the bug we are seeing is that after 5-10 mins or maybe sometimes sooner, we will stop receiving notification. We can tell that it's a Chromium bug because we use another Android app like nrfConnect or nrfToolbox and subscribe to the same service, and we cannot reproduce this, and we've verified that the device is continuing to push out notifcation over BLE, but the phone running Android has stopped receiving them. As a work-around, we've modified our code to only send notifications if it changed in a certain threshold, and we put a gap of at least 2 seconds between notifcations. Here's the link to github issue we've filed to track this in our project that might be helpful to reproduce, but it will require you to get a Arduino 101 board since we are running Zephyr on the device. https://github.com/01org/zephyr.js/issues/148 Environment Setup: Phone: Nexus 5x OS: Android 7.0 Chromium Version: 53.0.2785.124 There are a couple of possibilities here: 1. The device got garbage collected and the connection was dropped. 2. zephyr.js is reusing the services and characteristics from the first connection. Per spec these are no longer valid. I'm working on a patch to throw an error when this happens. 3. There is a problem in our implementation. To rule out 1. could you please try to reproduce on the latest Chrome Dev? In the latest version a characteristic holds a reference to its services which holds a reference to its device which means the device will not get garbage collected. 2. will need manual inspection of the zephyr code For 3. could you provide some adb logcat logs? Bonus: you can follow the instructions at [1] and provide more detail logs. [1] https://www.chromium.org/developers/how-tos/file-web-bluetooth-bugs.
,
Oct 26 2016
Everytime we connect, we refetch primary service and both characteristics
,
Oct 26 2016
I've added a onDisconnected function to https://googlechrome.github.io/samples/web-bluetooth/read-characteristic-value-changed.html which tries to reconnect.
,
Oct 28 2016
Discussion is happening on GitHub at https://github.com/01org/zephyr.js/issues/148#issuecomment-256917006 for now.
,
Nov 1 2016
Uploading trace here for the record, this is the same as the ones we uploaded to the github page.
,
Nov 1 2016
Seems the issue has been resolved: https://github.com/01org/zephyr.js/issues/148#issuecomment-257733258 |
||
►
Sign in to add a comment |
||
Comment 1 by fbeaufort@chromium.org
, Oct 26 2016