Important
This project is under development. All source code and features on the main branch are for the purpose of testing or evaluation and not production ready.
Tool for communication via serial port (e.g UART).
Open serial connection put serial port and baud rate:
port can be e.g. COM1 if windows or /dev/ttyUSB0 if linux
serial = SerialConnection(serial_port='/dev/ttyUSB0', baud=115200) Read data from serial:
serial.read()Send text msg via serial port
serial.send('Text to send')Read until some expression appear:
serial.read_until('Module Error') Close serial connection:
serial.close() Read in background (e.g. if we want to run tests and log everything what happen on serial port during the test)
serial.read_in_background()
(... test steps ...)
serial_log = serial.get_result() #get_result will automatically close the connectionSerialConnection can be used as context manager:
with SerialConnection(serial_port='/dev/ttyUSB0', baud=115200) as serial:
log = serial.read() If you encounter any bugs or have suggestions for improvements, you're welcome to contribute directly or open an issue here.