Skip to content

Embedded MQTT broker for ESP32 proxy #54

@KristianP26

Description

@KristianP26

Summary

Add an optional embedded MQTT broker (e.g. aedes) so users of the ESP32 BLE proxy don't need to install and configure a separate broker like Mosquitto.

Motivation

The ESP32 proxy currently requires an external MQTT broker, which adds setup complexity for users who don't already have one (e.g. no Home Assistant). Embedding a lightweight broker directly in BLE Scale Sync would make the proxy a zero-config experience.

Proposed behavior

  • If mqtt_proxy.broker_url is not set, start an embedded MQTT broker on mqtt://0.0.0.0:1883 and connect to it internally
  • If mqtt_proxy.broker_url is set, use the external broker as before (no change)
  • The ESP32 config.json would point to the server's IP on port 1883

Implementation notes

  • aedes is a lightweight, well-maintained MQTT broker for Node.js
  • The broker should start before the mqtt-proxy handler connects
  • Port should be configurable (e.g. mqtt_proxy.embedded_broker_port)
  • Docker: no extra container needed, the app container handles everything
  • Existing users with external brokers are unaffected

Metadata

Metadata

Assignees

No one assigned

    Labels

    bleBluetooth issuesenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions