msg MQTT message

main
zart 5 months ago
parent 8da48b88da
commit 22ca3d32d3

@ -1,4 +1,5 @@
import os import os
import subprocess
import paho.mqtt.client as mqtt import paho.mqtt.client as mqtt
import time import time
@ -54,7 +55,10 @@ client.publish("response/topic", "Set user.txt success!", qos=2)
os.system("sudo myenv/bin/python3 smp_coder/extur_smp.py > logex.txt 2>&1 &") command = ["sudo", "myenv/bin/python3", "smp_coder/extur_smp.py"]
with open("logex.txt", "w") as log_file:
process = subprocess.Popen(command, stdout=log_file, stderr=log_file, bufsize=1, universal_newlines=True)
print("启动树莓派拍照客户端成功。") print("启动树莓派拍照客户端成功。")
client.publish("response/topic", "启动树莓派拍照客户端成功", qos=2) client.publish("response/topic", "启动树莓派拍照客户端成功", qos=2)

Loading…
Cancel
Save