diff --git a/bash/stop_data_upload.sh b/bash/stop_data_upload.sh index 1e9f301..8f8b2ea 100644 --- a/bash/stop_data_upload.sh +++ b/bash/stop_data_upload.sh @@ -1,4 +1,3 @@ #!/bin/bash -set -e supervisorctl stop sensor_to_server supervisorctl start sensor_to_local diff --git a/data_upload.py b/data_upload.py index 92bb152..7cc0e79 100755 --- a/data_upload.py +++ b/data_upload.py @@ -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