@ -34,8 +34,11 @@ def on_message(client, userdata, msg):
f.write(msg.payload)
print("图片已保存。")
global response_received
client.loop_stop()
response_received = True
client.disconnect()
# global response_received
# response_received = True
try:
@ -61,7 +61,7 @@ with open("logex.txt", "w") as log_file:
print("启动树莓派拍照客户端成功。")
client.publish("response/topic", "启动树莓派拍照客户端成功", qos=2)
client.publish("response/topic", "smp_coder started successfully!", qos=2)
# 停止网络循环并断开连接