|
|
@ -34,8 +34,6 @@ def on_message(client, userdata, msg):
|
|
|
|
client.publish("response/{}".format(user_id), "image produce success!", qos=2)
|
|
|
|
client.publish("response/{}".format(user_id), "image produce success!", qos=2)
|
|
|
|
client.publish("image/{}".format(user_id), open("/tmp/image.jpg", "rb").read(), qos=2)
|
|
|
|
client.publish("image/{}".format(user_id), open("/tmp/image.jpg", "rb").read(), qos=2)
|
|
|
|
# 全局变量,用于标记是否收到响应
|
|
|
|
# 全局变量,用于标记是否收到响应
|
|
|
|
global response_received
|
|
|
|
|
|
|
|
response_received = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 创建客户端实例
|
|
|
|
# 创建客户端实例
|
|
|
|
client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2,)
|
|
|
|
client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2,)
|
|
|
|