parameter | details |
---|---|
port | Device name e.g. /dev/ttyUSB0 on GNU/Linux or COM3 on Windows. |
baudrate | baudrate type: int default: 9600 standard values: 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200 |
readline()
. Do specify a timeout when opening theserial port otherwise it could block forever if no newline character isreceived. Also note that readlines()
only works with a timeout.readlines()
depends on having a timeout and interprets that as EOF (endof file). It raises an exception if the port is not opened correctly.eol
parameter for readline()
is no longer supported whenpySerial is run with newer Python versions (V2.6+) where the moduleio
is available.readline()
or to use universal newlinemode, it is advised to use io.TextIOWrapper:python-mserial.tools.list_ports
will print a list of available ports. Itis also possible to add a regexp as first argument and the list will onlyinclude entries that matched.python-mserial.tools.miniterm<port_name>
(use option -h
to get a listing of all options).