Installed Espruino Hub on a Raspberry Pi W, got it all working, and node-red works.
But how do you get the web bluetooth code working on there to connect to the Puck.js through the Pi, as im currently getting odd errors.
I copy pasted the code at https://www.espruino.com/Smart+Meter at the bottom of the page, and put that in a file called meter.html in the hub's www dir.
The page loads, but when you click the box, it says Web Bluetooth is not supported in this browser.
I'm guessing there's some extra work to tell it to use the Pi's MQTT bridge to the Puck, rather than connecting to the Puck directly, but still the error is odd, as it should support web bluetooth, as im still using the same Chrome that worked when I tried to connect to it directly from the example page.
Ahh - so running a web browser (Chrome hopefully) on the Raspberry Pi itself?
I believe you just need to go to chrome://flags and turn on Experimental Web Platform Features and restart.
Experimental Web Platform Features
However the idea of the MQTT bridge is not to need Web Bluetooth, and to allow you to view the webpage on any device while using the Raspberry Pi as the bridge.
There's a bit of an example here:
You should just be able to check on the /ble/advertise/ BLE topic and extract any data (eg the meter reading) that you want...
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem