-
I have wrote my own docker compose file now which works quite well, but one question about the config.json:
"mqtt_host": "mqtt://localhost", "//mqtt_options": { "username": "user", "password": "pass", "clientId": "clientid" },
if I have an open MQTT broker, do I just omit the username and password fields?
-
-
-
It seems to be happened at midnight.
EspruinoHub.service - EspruinoHub BLE -> MQTT bridge Loaded: loaded (/etc/systemd/system/EspruinoHub.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2023-02-18 01:33:55 GMT; 5 days ago Docs: https://github.com/espruino/EspruinoHub Process: 25723 ExecStart=/home/pi/EspruinoHub/start.sh (code=exited, status=1/FAILURE) Main PID: 25723 (code=exited, status=1/FAILURE) CPU: 897ms Feb 18 01:33:55 pihome systemd[1]: EspruinoHub.service: Scheduled restart job, restart counter is at 5. Feb 18 01:33:55 pihome systemd[1]: Stopped EspruinoHub BLE -> MQTT bridge. Feb 18 01:33:55 pihome systemd[1]: EspruinoHub.service: Start request repeated too quickly. Feb 18 01:33:55 pihome systemd[1]: EspruinoHub.service: Failed with result 'exit-code'. Feb 18 01:33:55 pihome systemd[1]: Failed to start EspruinoHub BLE -> MQTT bridge.
-
-
-
I think we are missing each other, yes exactly I want to use the EspruinoHub installed on my Raspberry so that I can connect remotely from my laptop (which is far away from the BLE sensors) to the ide and then program the sensors via the WebBluetooth option.
Yes I could do the same thing via SSH into the box and run the commandline but this is not always possible because of firewalls and other controls.I seem to recall that not having SSL enabled on webpages doesn't allow the WebBluetooth dialog to be available?
-
-
-
-
Hi there, this simple code gives me a
Puck.getBatteryPercentage is not a function
at SVGPathElement.<anonymous> (pucktest.html:47:22)
should it not just work in the web as in the console?
<html> <head> <style> body { margin:0; } svg { display:block; position:absolute; top:0%; left:0%; width:100%; height:100%; } </style> </head> <body> <div> <svg viewBox="0 0 24 24"> <path fill="#000000" d="M12,2A7,7 0 0,0 5,9C5,11.38 6.19,13.47 8,14.74V17A1,1 0 0,0 9,18H15A1,1 0 0,0 16,17V14.74C17.81,13.47 19,11.38 19,9A7,7 0 0,0 12,2M9,21A1,1 0 0,0 10,22H14A1,1 0 0,0 15,21V20H9V21Z" /> </svg> </div> <div> <button id="btn-stat">Get Status</button> </div> <script src="https://www.puck-js.com/puck.js"></script> <script type="text/javascript"> // Get the actual curve inside the SVG. You could make differemt // parts of a more complex SVG do different things... var path = document.getElementsByTagName('path')[0]; var sync = document.getElementById('btn-stat'); // Make sure your mouse cursor turns into a hand when over it, and gray it out path.style="cursor:pointer;fill:#BBB"; // the possible states we could be in var state = 0; var states = [ { color : "#444", command : "digitalWrite([LED1],0);\n" }, { color : "red", command : "digitalWrite([LED1],1);\n" }, { color : "green", command : "digitalWrite([LED1],2);\n" }, { color : "blue", command : "digitalWrite([LED1],4);\n" }, ]; // Now send commands to turn the LED on or off path.addEventListener("click", function() { state++; if (state>=states.length) state=0; path.style.fill=states[state].color; Puck.write(states[state].command); var bat = Puck.getBatteryPercentage(); }); </script> </body> </html>
-
I seem to have solved my problems, here's the docker file:
I need to find the folder where to store the Espruino web pages.