parent
ceb2d9d6ad
commit
cca4dbaf14
6
main.py
6
main.py
|
@ -169,7 +169,11 @@ if __name__ == '__main__':
|
||||||
client = mqtt.Client("server_rack_led")
|
client = mqtt.Client("server_rack_led")
|
||||||
client.username_pw_set("mqtt", "pmMQTT_11!")
|
client.username_pw_set("mqtt", "pmMQTT_11!")
|
||||||
debug_print("Connecting to MQTT Broker "+str(mqttBroker))
|
debug_print("Connecting to MQTT Broker "+str(mqttBroker))
|
||||||
client.connect(mqttBroker)
|
try:
|
||||||
|
client.connect(mqttBroker)
|
||||||
|
except:
|
||||||
|
time.sleep(20)
|
||||||
|
client.connect(mqttBroker)
|
||||||
client.on_connect = mqtt_on_connect
|
client.on_connect = mqtt_on_connect
|
||||||
client.on_message = mqtt_on_message
|
client.on_message = mqtt_on_message
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue