MQTT trouble

This commit is contained in:
2026-04-21 18:34:29 +02:00
parent 2e5e410897
commit 64b0aa482f

View File

@@ -896,6 +896,7 @@ def connect_mqtt():
user=MQTT_USER,
password=MQTT_PASSWORD,
keepalive=30,
socket_timeout=10,
)
client.set_callback(on_message)
client.connect()
@@ -961,6 +962,7 @@ def check_mqtt():
user=MQTT_USER,
password=MQTT_PASSWORD,
keepalive=30,
socket_timeout=10,
)
client_ref.set_callback(on_message)
client_ref.connect()
@@ -1300,7 +1302,7 @@ def main():
info("Gauge MQTT controller starting")
info("=" * 48)
connect_wifi(WIFI_SSID, WIFI_PASSWORD, force_reconnect=True)
connect_wifi(WIFI_SSID, WIFI_PASSWORD, force_reconnect=False)
connect_mqtt()
_subscribe_all(client_ref)