• 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.

    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...

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

How do you use TinyDash or any of the Web Bluetooth examples on the Espruino Hub www with Puck.js through the Pi

Posted by Avatar for redfox @redfox