This commit is contained in:
xyj 2023-12-18 11:31:01 +08:00
parent 1b8690bc2e
commit 4cc6d3bb21
1 changed files with 0 additions and 2 deletions

View File

@ -76,7 +76,6 @@ class MQTTClient:
if __name__ == '__main__': if __name__ == '__main__':
# print(broker, port, subscribe_topic, publish_topic, username, password)
# MQTT客户端 # MQTT客户端
MQTT = MQTTClient(broker, port, subscribe_topic, username, password) MQTT = MQTTClient(broker, port, subscribe_topic, username, password)
# 循环连接 # 循环连接
@ -86,6 +85,5 @@ if __name__ == '__main__':
# 阻塞监听 # 阻塞监听
MQTT.client.loop_forever() MQTT.client.loop_forever()
except Exception as e: except Exception as e:
# print(e)
# 异常等待时间在进行连接 # 异常等待时间在进行连接
time.sleep(30) time.sleep(30)