diff --git a/data_upload.py b/data_upload.py index 19f7c52..4e73b63 100644 --- a/data_upload.py +++ b/data_upload.py @@ -24,9 +24,7 @@ class DataUploadClient: self.client.on_disconnect = self.on_disconnect def on_connect(self, client, userdata, flags, rc): - global times - times = 6 - client.publish('success', payload='连接成功,执行数据推送和本地存储' + str(time.time()), qos=0) + self.client.publish('success', payload='连接成功,执行数据推送和本地存储' + str(time.time()), qos=0) subprocess.Popen(['/usr/bin/bash /home/pi/lot_manager/bash/start_data_upload.sh'], shell=True) def on_disconnect(self, client, userdata, rc):