13 lines
328 B
Python
13 lines
328 B
Python
import serial
|
|
|
|
def read_vedirect(port='/dev/serial0', baudrate=19200):
|
|
ser = serial.Serial(port, baudrate, timeout=1)
|
|
|
|
while True:
|
|
line = ser.readline().decode('utf-8', errors='ignore').strip()
|
|
if line:
|
|
print(line) # Raw data from Victron
|
|
|
|
if __name__ == "__main__":
|
|
read_vedirect()
|