Python Forum

Full Version: Lib PySerial
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello.

I'm using library PySerial and connectiong to the coverter RS485 with socket. (__https://pyserial.readthedocs.io/en/latest/url_handlers.html#socket)

Question: How i can manage baud rate, timeouts in socket type connection?
did you look at the documentation?
There are clear examples there, see: https://pythonhosted.org/pyserial/shorti...rial-ports
as fas as timeouts: https://pythonhosted.org/pyserial/pyseri...al.timeout
All is in the documentation. But for now, here you have a small example:

ser = serial.Serial()
ser.baudrate = 100000
ser.port = port
ser.parity = serial.PARITY_EVEN
ser.stopbits = 2
ser.open()