From 7ec303628193e10884ba0ae0fbb4d6cd1ac3e4df Mon Sep 17 00:00:00 2001 From: Julian Appel Date: Tue, 28 Jan 2025 15:51:03 +0100 Subject: [PATCH] Changed comport to /dev/serial/by-id/... to avoid future problems with wrong allocations after restart --- heatingMeter.py | 2 +- officeMeter.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/heatingMeter.py b/heatingMeter.py index 60c960f..6f30fd8 100644 --- a/heatingMeter.py +++ b/heatingMeter.py @@ -7,7 +7,7 @@ from influxdb_client import Point, WritePrecision from influx import writeToDB stream = SmlStreamReader() -port = serial.Serial(port='/dev/ttyUSB0', baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS) +port = serial.Serial(port='/dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0021-if00-port0', baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS) energyCounter = 0 # Counter for values that should only be pushed to db every minute diff --git a/officeMeter.py b/officeMeter.py index dc979fc..f992d1e 100644 --- a/officeMeter.py +++ b/officeMeter.py @@ -7,7 +7,7 @@ from influxdb_client import Point, WritePrecision from influx import writeToDB stream = SmlStreamReader() -port = serial.Serial(port='/dev/ttyUSB1', baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS) +port = serial.Serial(port='/dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0038-if00-port0', baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS) energyCounter = 0 # Counter for values that should only be pushed to db every minute