added failover mech

Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>
master
Ebbe Baß 2022-08-15 06:28:33 +02:00
parent ceb2d9d6ad
commit cca4dbaf14
1 changed files with 5 additions and 1 deletions

View File

@ -169,6 +169,10 @@ if __name__ == '__main__':
client = mqtt.Client("server_rack_led")
client.username_pw_set("mqtt", "pmMQTT_11!")
debug_print("Connecting to MQTT Broker "+str(mqttBroker))
try:
client.connect(mqttBroker)
except:
time.sleep(20)
client.connect(mqttBroker)
client.on_connect = mqtt_on_connect
client.on_message = mqtt_on_message