user128009
Member since Apr 2021 • Last active May 2021Most recent activity
-
- 20 comments
- 6,767 views
-
I don't think this is related to the flag, as I can't run the examples without it, IIRC
.getDevices()
is not defined without the new permission backend flag.Interesting that Linux/macOS behave similarly, how can we check if this is a Chrome implementation issue? https://github.com/GoogleChrome/samples/issues does not appear to be monitoring new issues.
-
@Gordon: What is interesting is that the automatic reconnect works on Windows/CSR8510. Can you clarify which Browser/OS/Bluetooth combo you have where it doesn't? Still trying to find out if this is specific to OS or the Bluetooth chip.
-
It seems like the power requirement for the USB dongle permanently overwrites the (lower) power requirement for the integrated Bluetooth module. As a result the Bluetooth module thinks it is not supplied with sufficient power and shuts down.
Apparently there is a workaround with certain old Bluetooth 2.0 dongles with similar power requirements to the internal Bluetooth module, 2 I had lying around, which didn't work - I now bought a third one from eBay that I hope will fix this. Can't use the Puck.js until then and can't afford the time to have my MacBook shipped for repairs.
In the thread they are even shipping around old Bluetooth dongles via post to fix this.
-
I connected the CSR8510 to my MacBook Pro 16 to check if the difference is caused by Windows or the Bluetooth chip; as a result Bluetooth on my MacBook Pro 16 is now bricked and apparently needs a Logic Board replacement (https://discussions.apple.com/thread/250944058). 🤷
-
I can confirm your experience on Windows 10/CSR8510 (Win10 Bluetooth Driver)/Chrome 90:
- Go to https://googlechrome.github.io/samples/web-bluetooth/watch-advertisements-and-connect-async-await.html
- Request and pair your Espruino
- Close/Reopen Chrome and go to the same site
- Press "Connect"
- Wait (up to 10 seconds in my 5 runs)
Result:
Getting existing permitted Bluetooth devices... > Got 1 Bluetooth devices. Watching advertisements from "Puck.js c699"... > Received advertisement from "Puck.js c699"... Connecting to GATT Server from "Puck.js c699"... > Bluetooth device "Puck.js c699 connected.
On macOS I don't get a reconnect because no advertisement packets are received unless I explicitly trigger a scan or request a device.
- Go to https://googlechrome.github.io/samples/web-bluetooth/watch-advertisements-and-connect-async-await.html
-
@fanoush: Interesting, could you post details on your OS/Bluetooth/Browser/Espruino combo? Definitely doesn't work for me (macOS 10.15/Chrome 90 + flag:#enable-web-bluetooth-new-permissions-backend/Puck.js v2.09)
//Press Connect Getting existing permitted Bluetooth devices... > Got 1 Bluetooth device. Watching advertisements from "Puck.js c699"... //Stuck here, but if you now press Request and don't select a device: Requesting any Bluetooth device... > Received advertisement from "Puck.js c699"... Connecting to GATT Server from "Puck.js c699"... > Bluetooth device "Puck.js c699 connected. //Abort Request Argh! NotFoundError: User cancelled the requestDevice() chooser.
It seems like for some reason your Espruino is still sending advertisement packets even after it is connected? Do you have any Bluetooth device scanning tool running in the background/in parallel?
-
Thanks for the link.
https://googlechrome.github.io/samples/web-bluetooth/watch-advertisements-and-connect-async-await.html also gives me the
device is out of range
error, however, adding a call torequestLEScan()
or justrequestDevice()
seems to trigger advertisement packages, which will cause a reconnect without selecting a device in the dialog.However, the scanning/request dialog is still shown (and it doesn't disappear when a device is connected). Is there any option to close the scanning/request dialog programatically? It does not support AbortController signals.
-
Thanks for the link to the issue tracker. So to summarize, reconnecting to already paired devices should be supported in Chrome when using
chrome://flags/#enable-web-bluetooth-new-permissions-backend
andchrome://flags/#enable-experimental-web-platform-features
and this code:However, at least on Linux and macOS, the event
advertisementreceived
is never triggered. Is that an issue with Chrome, the OS or the device? Looks like.watchAdvertisement
is supposed to trigger advertisement packages but it doesn't on Linux/macOS?