Add debugging method
This commit is contained in:
@@ -37,4 +37,14 @@ class SerialReader:
|
||||
line = self.serial.readline()
|
||||
if line:
|
||||
data = line.decode('utf-8', errors='ignore')
|
||||
self.__notify(data)
|
||||
self.__notify(data)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
def callback(data):
|
||||
print(data)
|
||||
|
||||
reader = SerialReader("/dev/ttyUSB1", 57600)
|
||||
reader.subscribe(callback)
|
||||
reader.start()
|
||||
@@ -50,7 +50,6 @@ if __name__ == "__main__":
|
||||
print("Light sensor reader started.")
|
||||
|
||||
app.run(host="0.0.0.0", port=5000, debug=False)
|
||||
print("Server started.")
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("Keyboard interrupt. Stopping app...")
|
||||
|
||||
Reference in New Issue
Block a user