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,