Fix initialization with CH340 UARTs
Initialization is messed up with older Linux kernels and that results in 9600 baud being used unconditionally. Setting the baud rate separately seems to work around this successfully.
This commit is contained in:
parent
293ce2c749
commit
af153a89e7
@ -732,8 +732,11 @@ class StcBaseProtocol:
|
|||||||
Set up serial port, send sync sequence and get part info.
|
Set up serial port, send sync sequence and get part info.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self.ser = serial.Serial(port=self.port, baudrate=self.baud_handshake,
|
self.ser = serial.Serial(port=self.port,
|
||||||
parity=self.PARITY)
|
parity=self.PARITY)
|
||||||
|
# set baudrate separately to workaround a bug with the CH340 driver
|
||||||
|
# in older Linux kernels
|
||||||
|
self.ser.baudrate = self.baud_handshake
|
||||||
|
|
||||||
# fast timeout values to deal with detection errors
|
# fast timeout values to deal with detection errors
|
||||||
self.ser.timeout = 0.5
|
self.ser.timeout = 0.5
|
||||||
|
Loading…
Reference in New Issue
Block a user