It was three days ago I found that bluetooth can be accessed by web content in Chrome! So I have written a webpage as new client for our previous bluetooth project.
First, install the server-side program on your pi, see how: https://github.com/PiSugar/sugar-wifi-conf
Then you can connect your pi through BLE with your laptop or smartphone by opening this link in chrome app: https://www.pisugar.com/sugar-wifi-conf
Since web bluetooth has not been widely supported yet, I have tested on several devices:
- It works well with latest Chrome for MacOS and Android.
- On Win10, Chrome is able to detect the bluetooth but I am not able to open it, which is pretty strange. (If you can open it, please do tell me how)
- Chrome for iOS doesn't support web-bluetooth. There is an ios app called WebBLE which implements the web-bluetooth api. However, it doesn't works. It seems different from the standard api. I will see how to fix this later.
For other compatibility information please see here.
It's able to run on iOS now!
The iOS problem I mentioned above, it's because WebBLE browser only supports the early version of web-bluetooth api, which doesn't include "getCharacteristics" method. (Click here to see more detail) Therefore I had to use the old way to get characteristics when it runs on iOS.