简体   繁体   中英

BLE device communication with windows 10

Need to connect to Windows 10 through BLE device. The problem is Windows 10 does not have support for BLE and I need to run a browser application(chrome/mozilla) which can connect and communicate with BLE device. I researched on google bluetooth web API but it works in linux well but not in windows 10. I just need to take sensor data from device and show it in the browser through BLE. Any help will be appreciated.

Unfortunately, to start, I don't have an easy solution for you. I thought I would share some of the paths you could take, that I have already explored. Maybe it may be of some use.

I am assuming the browser application is a traditional web application not using a technology such as Electron . If you were, a library like noble could be used with IPC to pipe the data into the UI.

Since you require data to be available in the context of your web application, as far as I know for a direct connection, you would need to use the Web Bluetooth API. This API is still very young, and if this is for a production site, your target audience would be limited to pretty much Chrome . Progress is being made though and looks like Windows support is coming along .

Alternative to a direct connection, you could distribute a desktop application that would handle the BLE communication. The desktop application could use a variety of means to stream the data into the web application (WebRTC could be interesting here). The downside of this approach is that you have to develop and test a desktop application. This method is also not easy if your device is utilizing custom profiles as that could add further complexity if you try to utilize the native BLE API in the latest versions of Windows 10. That being said, you can find some examples here . Accessing the built-in Bluetooth hardware is also not always possible and you may need to distribute a BLE capable dongle for full coverage. This will add hardware and logistics costs to whatever you are doing.

Another option would be to middleman with a mobile application and stream the data into the browser. Probably easier than the above (desktop) and no need to distribute hardware.

If this is a hobby/for fun project, using Web Bluetooth should work. For a production application, I am not aware of an easy solution. Hopefully someone else can share one with us!

If anyone is still interested in this - yes it does work in Win 10 with Chrome (I haven't tested with other browsers) - have a look at

I tested this with a micro:bit using espruino.

Note that when you reload the web page, the device has to be paired again.

Best wishes - Andy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM