From 8da48b88da4779a83720dc27ab5ff182c6fb4462 Mon Sep 17 00:00:00 2001 From: zart Date: Fri, 28 Jun 2024 11:32:04 +0800 Subject: [PATCH] msg MQTT message --- smp_coder/mqtt_smp.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/smp_coder/mqtt_smp.py b/smp_coder/mqtt_smp.py index 3dbfc5d..c9b92a7 100644 --- a/smp_coder/mqtt_smp.py +++ b/smp_coder/mqtt_smp.py @@ -52,12 +52,16 @@ while not response_received: client.publish("response/topic", "Set user.txt success!", qos=2) -# 停止网络循环并断开连接 -client.loop_stop() -client.disconnect() + os.system("sudo myenv/bin/python3 smp_coder/extur_smp.py > logex.txt 2>&1 &") print("启动树莓派拍照客户端成功。") +client.publish("response/topic", "启动树莓派拍照客户端成功", qos=2) + +# 停止网络循环并断开连接 +client.loop_stop() +client.disconnect() + print("收到响应,客户端退出。")