Skip to content

Commit 2cbe997

Browse files
committed
tools/pyboard: ProcessPtyToTerminal: Add workaround for PySerial bug.
When working with a "virtual" port, like PTY. The issue described in http://stackoverflow.com/questions/34831131/pyserial-does-not-play-well-with-virtual-port
1 parent d468996 commit 2cbe997

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/pyboard.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ def __init__(self, cmd):
179179
self.close()
180180
sys.exit(1)
181181
pty = m.group()
182-
self.ser = serial.Serial(pty, interCharTimeout=1)
182+
# rtscts, dsrdtr params are to workaround pyserial bug:
183+
# http://stackoverflow.com/questions/34831131/pyserial-does-not-play-well-with-virtual-port
184+
self.ser = serial.Serial(pty, interCharTimeout=1, rtscts=True, dsrdtr=True)
183185

184186
def close(self):
185187
import signal

0 commit comments

Comments
 (0)