mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-18 11:02:16 +00:00
Ensure that MQTT is enabled and log initialization (#2643)
This commit is contained in:
parent
3fbe2d771c
commit
96c6a20e03
@ -164,6 +164,8 @@ MQTT::MQTT() : concurrency::OSThread("mqtt"), mqttQueue(MAX_MQTT_QUEUE)
|
||||
#endif
|
||||
{
|
||||
if (moduleConfig.mqtt.enabled) {
|
||||
LOG_DEBUG("Initializing MQTT\n");
|
||||
|
||||
assert(!mqtt);
|
||||
mqtt = this;
|
||||
|
||||
@ -181,6 +183,14 @@ MQTT::MQTT() : concurrency::OSThread("mqtt"), mqttQueue(MAX_MQTT_QUEUE)
|
||||
if (!moduleConfig.mqtt.proxy_to_client_enabled)
|
||||
pubSub.setCallback(mqttCallback);
|
||||
#endif
|
||||
|
||||
if (moduleConfig.mqtt.proxy_to_client_enabled) {
|
||||
LOG_INFO("MQTT configured to use client proxy...\n");
|
||||
enabled = true;
|
||||
runASAP = true;
|
||||
reconnectCount = 0;
|
||||
publishStatus();
|
||||
}
|
||||
// preflightSleepObserver.observe(&preflightSleep);
|
||||
} else {
|
||||
disable();
|
||||
|
Loading…
Reference in New Issue
Block a user