This commit is contained in:
xyj 2023-12-09 16:38:12 +08:00
parent ef6de16b52
commit b3d1b57dc6
2 changed files with 4 additions and 5 deletions

View File

@ -1,4 +1,3 @@
#!/bin/bash
set -e
supervisorctl stop sensor_to_server
supervisorctl start sensor_to_local

View File

@ -9,14 +9,14 @@ from device import device_name
def on_connect(client, userdata, flags, rc):
global times
if rc == 0:
# print("连接成功,执行数据推送和本地存储")
subprocess.Popen(['/usr/bin/bash /home/pi/lot_manager/bash/start_data_upload.sh'], shell=True)
print("连接成功,执行数据推送和本地存储")
# subprocess.Popen(['/usr/bin/bash /home/pi/lot_manager/bash/start_data_upload.sh'], shell=True)
times = 3
def on_connect_fail(client, userdata):
# print("失败,执行本地存储")
subprocess.Popen(['/usr/bin/bash /home/pi/lot_manager/bash/stop_data_upload.sh'], shell=True)
print("失败,执行本地存储")
# subprocess.Popen(['/usr/bin/bash /home/pi/lot_manager/bash/stop_data_upload.sh'], shell=True)
times = 3