mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-20 20:12:12 +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
|
#endif
|
||||||
{
|
{
|
||||||
if (moduleConfig.mqtt.enabled) {
|
if (moduleConfig.mqtt.enabled) {
|
||||||
|
LOG_DEBUG("Initializing MQTT\n");
|
||||||
|
|
||||||
assert(!mqtt);
|
assert(!mqtt);
|
||||||
mqtt = this;
|
mqtt = this;
|
||||||
|
|
||||||
@ -181,6 +183,14 @@ MQTT::MQTT() : concurrency::OSThread("mqtt"), mqttQueue(MAX_MQTT_QUEUE)
|
|||||||
if (!moduleConfig.mqtt.proxy_to_client_enabled)
|
if (!moduleConfig.mqtt.proxy_to_client_enabled)
|
||||||
pubSub.setCallback(mqttCallback);
|
pubSub.setCallback(mqttCallback);
|
||||||
#endif
|
#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);
|
// preflightSleepObserver.observe(&preflightSleep);
|
||||||
} else {
|
} else {
|
||||||
disable();
|
disable();
|
||||||
|
Loading…
Reference in New Issue
Block a user