From e44a78742e798719d6fc0b75dff4a72aabc6a216 Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Thu, 2 May 2024 22:10:52 +0200 Subject: [PATCH] Fixed Uart serial stuff --- src/handler/mhz19_co2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/handler/mhz19_co2.py b/src/handler/mhz19_co2.py index 74c4fde..a65e95a 100644 --- a/src/handler/mhz19_co2.py +++ b/src/handler/mhz19_co2.py @@ -5,7 +5,7 @@ class Mhz19Co2: def __init__(self): self.last_read = None - self.serial_port = "/dev/tty.usbserial-B001BTPZ" + self.serial_port = "/dev/serial0" self.baud_rate = 9600 self.byte_size = 8 self.parity = "N" @@ -18,6 +18,7 @@ class Mhz19Co2: return self.last_read def read(self): + ser = None try: ser = serial.Serial( port=self.serial_port,