Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lib PySerial
#1
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?
Reply
#2
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
Reply
#3
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()
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020