update
This commit is contained in:
parent
ef6de16b52
commit
b3d1b57dc6
|
@ -1,4 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
|
||||||
supervisorctl stop sensor_to_server
|
supervisorctl stop sensor_to_server
|
||||||
supervisorctl start sensor_to_local
|
supervisorctl start sensor_to_local
|
||||||
|
|
|
@ -9,14 +9,14 @@ from device import device_name
|
||||||
def on_connect(client, userdata, flags, rc):
|
def on_connect(client, userdata, flags, rc):
|
||||||
global times
|
global times
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
# print("连接成功,执行数据推送和本地存储")
|
print("连接成功,执行数据推送和本地存储")
|
||||||
subprocess.Popen(['/usr/bin/bash /home/pi/lot_manager/bash/start_data_upload.sh'], shell=True)
|
# subprocess.Popen(['/usr/bin/bash /home/pi/lot_manager/bash/start_data_upload.sh'], shell=True)
|
||||||
times = 3
|
times = 3
|
||||||
|
|
||||||
|
|
||||||
def on_connect_fail(client, userdata):
|
def on_connect_fail(client, userdata):
|
||||||
# print("失败,执行本地存储")
|
print("失败,执行本地存储")
|
||||||
subprocess.Popen(['/usr/bin/bash /home/pi/lot_manager/bash/stop_data_upload.sh'], shell=True)
|
# subprocess.Popen(['/usr/bin/bash /home/pi/lot_manager/bash/stop_data_upload.sh'], shell=True)
|
||||||
|
|
||||||
|
|
||||||
times = 3
|
times = 3
|
||||||
|
|
Loading…
Reference in New Issue