This commit is contained in:
deckensteuerung
2018-10-21 15:19:51 +02:00
parent 27fa6f7c63
commit 6c7d81ed49
6 changed files with 130 additions and 88 deletions

5
main.py Normal file → Executable file
View File

@@ -1,3 +1,4 @@
import config
import subprocess
import os
@@ -94,6 +95,7 @@ class SerialWriter(threading.Thread):
data = self.datasource.getData()
ser.write(b"\01")
ser.write(data)
ser.flush()
except Exception as e:
if ser != None:
ser.close()
@@ -138,8 +140,9 @@ class LogReader(threading.Thread):
logging.info("LogReader started")
while running and self.running:
try:
self.log += runner.app.stderr.read(1).decode("utf-8")
self.log += self.runner.app.stderr.read(1).decode("utf-8")
except Exception as e:
print(e)
time.sleep(1)
logging.info("LogReader closed")
def stop(self):