1technophile / OpenMQTTGateway

MQTT gateway for ESP8266 or ESP32 with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility & LoRa.
https://docs.openmqttgateway.com
GNU General Public License v3.0
3.62k stars 797 forks source link

Allow running an MQTT broker within OMG #1988

Closed mlesniew closed 4 months ago

mlesniew commented 4 months ago

Description:

This change adds the possibility to run a MQTT broker instead of an MQTT client on the microcontroller.

To switch to broker mode, the MQTT_BROKER_MODE must be defined to true. A new environment configuration esp32dev-ble-broker has been added and it has this preprocessor macro defined. It is otherwise identical to esp32dev-ble.

Currently the broker is listening on the WiFi interface, on port 1883. To keep the PR small and simple, there currently are little configuration possibilities in broker mode. However, the code is extendible and support for listening on different ports, allowing websocket connections, or listening on Ethernet can be easily added.

Checklist:

1technophile commented 4 months ago

Thanks!