我使用带有以下命令的SOCAT创建了一个VSP:
socat -d -d pty,raw,echo=0 pty,raw,echo=0
我可以创建一个串行设备(19200,N,8,1)并使用Python发送和接收数据。
所以我必须为另外一个配置为(19200,even_aprity,Python中的硬件流程)的设备做同样的事情,当我这样做时它抛出以下错误:
Traceback (most recent call last):
File "py2.py", line 163, in <module>
buffer += ser.read(1) # this will block until one more char or timeout
File "/usr/lib/python2.6/dist-packages/serial/serialposix.py", line 311, in read
if self.fd is None: raise portNotOpenError
serial.serialutil.SerialException: Port not open
Exception SystemError: 'error return without exception set' in <bound method BreakHandler.__del__ of <sig_handler.BreakHandler instance at 0xb719338c>> ignored
指导我