Open gregoiregentil opened 1 year ago
Linux is not supported for now. See https://github.com/WebBluetoothCG/web-bluetooth/blob/main/implementation-status.md#scanning-api
OK. Thank you.
I'm using Linux+Chrome for development purpose. The page says that "GATT Server Connect" is supported. But I tried device.gatt.connect() on the response of navigator.bluetooth.requestDevice() but it doesn't succeed. Once again, the same device is connected from Windows + chrome upon reception of the Advertisement watch.
I'm in a case which I own the device with its Gatt server. Is there a way to manage to connect to a BLE device from Linux+Chrome without using scanLE and without watch advertisement?
Does this help?
- Linux: Requires Kernel 3.19+ and BlueZ 5.41+ installed. Read How to get Chrome Web Bluetooth working on Linux.
- Note that Bluetooth daemon needs to run with experimental interfaces if BlueZ version is lower than 5.43:
sudo /usr/sbin/bluetoothd -E
If you own the device, can you expose the GATT Battery Service and try https://googlechrome.github.io/samples/web-bluetooth/battery-level-async-await.html?
Ubuntu 22.04 is way beyond kernel 3.19 and BlueZ 5.41. I'm on Ubuntu 20.04 (kernel 5.15 and bluez 5.53) and I can connect to the device from a plain C application.
request device works and I get a structure such as {deviceId: 'ui5gjtwifKM+.....', name: 'AutoCamera'}. But the connect() fails.
And the connect works in Android.
I really would like to make this work because it will save me a lot of time to work on Linux+Chrome.
The error in Linux is "connect error: DOMException: Connection Error: Connection attempt failed."
Could you file a web bluetooth bug at https://crbug.com/new and follow https://www.chromium.org/developers/how-tos/file-web-bluetooth-bugs/#linux instructions?
I'm not totally sure of my own implementation of the Gatt server on my device, but the same "very simple" page works on Android and fails on Linux. And it also works in a native Android java app, as well as in a native Linux C app.
I have emailed you a full log report (to fbe....com)
As shared by email, it looks like a Bluez issue:
= bluetoothd: 70:2C:1F:6C:81:4A: error updating services: Connection refused (111)
A clean install of Ubuntu 22.04 LTS with the latest version of Google Chrome as of February 2023 such as 110, watchAdvertisements doesn't work in the sense that no device is seen. There is no error on the page https://googlechrome.github.io/samples/web-bluetooth/watch-advertisements-and-connect.html, it just says:
The same page on Android or on Windows 10 (even with an old Google Chrome) is working, it lists the advertisements and successfully connects to the device.
Once again, a live ISO of Ubuntu 22.04 LTS with google-chrome.deb installed shows up the problem.