Espruino Hub on Raspberry SSL issue

Posted on
  • Hi there,
    I noticed that the Espruino Hub software is installed without SSL certificate.
    Thus it is unable to connect via Bluetooth.
    Any instructions available to add https?

    1 Attachment

    • Screenshot from 2023-02-17 22-57-41.png
  • Hi - you shouldn't need this if EspruinoHub is working correctly. If you just want to use Web Bluetooth use

    What happens is EspruinoHub serves up a page which creates a WebSocket connection back to EspruinoHub. Then EspruinoHub handles the bluetooth connection (which it doesn't need SSL for)

  • Yes but that was my point, you should mention that in the manual that without SSL is not going to allow.
    Yes of course I can use the public web version which has SSL.

  • I'm not sure where in the manual you mean but if you want to do a PR for the extra docs I'll happily merge.

    I'm still not sure why you'd want to use Web Bluetooth when the whole point of using EspruinoHub is to use the bluetooth that it provides though?

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

  • Ahh, I think I see what you're getting at.

    "Web Bluetooth" is the thing that allows the Web Browser to use your PC's Bluetooth connection. And yes, you need HTTPS for that.

    But that's not what we're using to allow you to access Bluetooth sensors from far away.

    Instead, EspruinoHub uses a WebSocket connection from the page that hosts the IDE back to EspruinoHub, and the bluetooth connection goes through that. Web Bluetooth is not needed.

    Maybe you could check http://yourhost:1888/status and see if any devices have been found there?

    If they have, when you open the http://yourhost:1888/ide and click the connect button (you may have to wait a few seconds) the bluetooth devices in range that Espruino recognises should just appear, as in the picture below:

    You could always check the Chrome Debug console to see if anything looks amiss

    1 Attachment

    • Screenshot at 2023-02-23 08-56-53.png
  • It seems to have crashed today let me investigate...

  • 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
        Process: 25723 ExecStart=/home/pi/EspruinoHub/ (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.
  • It seems to be constantly failing even when restarting this is weird ...

  • I know EspruinoHub does attempt to restart if it can't detect any Bluetooth LE devices in range because it thinks something might be broken - could that be it?

  • There are like 20 devices in range, I can't really understand what is the problem.
    I will probably reinstall everything again.

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

  • I seem to have solved my problems, here's the docker file:

    version: "3.9"
        image: espruino/espruinohub
        hostname: espruinohub
        container_name: espruinohub
        privileged: true
          - TZ=Europe/London
          - NOBLE_HCI_DEVICE_ID=0
        network_mode: host
          - /home/pi/espruinohub/config.json:/data/cĀ­onfig.json:ro
        restart: unless-stopped
        image: nodered/node-red:latest
          - TZ=Europe/London
          - "1880:1880"
        network_mode: host
          - node-red-data:/data
        restart: unless-stopped
        image: eclipse-mosquitto:2
          #- ./mqtt/config/:/mosquitto/config/
          - ./mqtt/log/:/mosquitto/log/
          - mqtt-data:/mosquitto/data/
        network_mode: host
          - 1883:1883
          - 9001:9001

    I need to find the folder where to store the Espruino web pages.

  • Great, glad it's working for you! I think you can just leave mqtt_options commented with "//mqtt_options" and it should be fine if there is no password

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

Espruino Hub on Raspberry SSL issue

Posted by Avatar for user153457 @user153457