Home › Forums › Mooshimeter Support › Bluetooth web API
- This topic has 0 replies, 1 voice, and was last updated 6 years ago by Anonymous.
I have started work on a project to talk to the Mooshimeter via the Bluetooth web API. It’s on Chrome and Opera (and I’ve only tested on the former in OSX).
Note that it needs a modern Chrome an updated Mooshimeter and a HTTPS web host.
Here’s a screenshot – http://imgur.com/a/7b5kA
It’s pretty primitive at the moment, I find it gets stuck in the ‘Requesting’ phase (the meter seems to stop sending stuff) and I don’t have a timeout so you need to press Go again.
Also you can’t change what is displayed, it doesn’t do any offset calculation etc etc.. It’s just a PoC.
If you pack it with nw.js you don’t need a webserver and this means it could be the start for a pretty nice desktop app!
The only problem is that afaik the bluetooth api doesn’t work in windows yet :-(
Thanks for nw.js, I’d never heard of it before :)
I think it is supported in Windows but 8.1 and later as per https://github.com/WebBluetoothCG/web-bluetooth/blob/master/implementation-status.md
That said I tried it on a Windows 10 box with 2 different Bluetooth 4 dongles and it doesn’t see the meter where as my MacBook Pro right next to it does :-/
I also tried it on someone’s laptop running Linux and it was found by Chrome and we could connect but it didn’t complete and I wasn’t able to work out the details.
yes, nw.js is quite nice, and I use it whenever I program small guis that have to run on different plattforms.
I will also try to get it running on windows, because I really need a desktop app for the mooshimeter :-)
If you can get it working in Windows that would be awesome!
Also, if you have any suggestions, patches, etc please feel free.. My JS is pretty weak and I’m sure the code is full of many anti-patterns :)
I tried on another Windows 10 PC (a Gigabyte all in one with built in BT) but it doesn’t work there either.
Interestingly the Windows Bluetooth settings panel does sometimes show the Mooshimeter in the list of found devices but pairing to it makes no difference (i.e. Chrome can’t see it)
Perhaps the Mooshimeter firmware needs tweaking before Windows will talk to it :(
I don’t think the BLED112 uses the Windows bluetooth stack, instead it talks directory to the BLED112 over a UART so it’s not really comparable.
Also, when I last looked the example code for the Mooshimeter uses the old API which is incompatible with the newest firmware.
although I do most of my programming in js and managed to create some very complex programs, your code looks way prettier and cleaner than mine! :-D
So I have good news and bad news:
I’ve managed to pair to the mooshimeter in your app, but I get an exception:
index.html:1 Uncaught (in promise) DOMException: Unsupported device.
The way I did achieve that was this:
1. enable experimental features in nw.js by adding this line in package.json.
2. start the app
3. open windows-settings, under bluetooth you will find the mooshimeter (not paired)
4. click on connect in the app, it should show a dialog indicating that it is searching for devices
5. click on pairing in windows settings – use code “0000” then it should pair
6. in the app dialog the mooshimeter should appear
7. open chrome-dev-tools by hitting F12
8. hit “pair” on the app dialog – the dialog closes and you can see the “unsupported device” message in dev-tools console