|
|
|
@ -38,8 +38,10 @@ def on_message(client, userdata, msg):
|
|
|
|
|
response_received = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 创建客户端实例
|
|
|
|
|
client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2,)
|
|
|
|
|
try:
|
|
|
|
|
client = mqtt.Client()
|
|
|
|
|
except:
|
|
|
|
|
client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2,)
|
|
|
|
|
|
|
|
|
|
# 设置回调函数
|
|
|
|
|
client.on_connect = on_connect
|
|
|
|
|