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
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
mqtt_proxy.broker_urlis not set, start an embedded MQTT broker onmqtt://0.0.0.0:1883and connect to it internallymqtt_proxy.broker_urlis set, use the external broker as before (no change)config.jsonwould point to the server's IP on port 1883Implementation notes
mqtt_proxy.embedded_broker_port)