msg MQTT message

main
zart 5 months ago
parent 6034f20e41
commit 26cddb076d

@ -34,8 +34,11 @@ def on_message(client, userdata, msg):
f.write(msg.payload) f.write(msg.payload)
print("图片已保存。") print("图片已保存。")
global response_received client.loop_stop()
response_received = True client.disconnect()
# global response_received
# response_received = True
try: try:

@ -61,7 +61,7 @@ with open("logex.txt", "w") as log_file:
print("启动树莓派拍照客户端成功。") print("启动树莓派拍照客户端成功。")
client.publish("response/topic", "启动树莓派拍照客户端成功", qos=2) client.publish("response/topic", "smp_coder started successfully!", qos=2)
# 停止网络循环并断开连接 # 停止网络循环并断开连接
client.loop_stop() client.loop_stop()

Loading…
Cancel
Save