2

Until recently I was happily using win7 + pythonX and pyserial. Lately I upgraded to win10, now I have a problem running some python serial code which I had working on win7.

However I can even run the simple example from: Full examples of using pySerial package

What I get is the same error, on all pyserial related codes:

Traceback (most recent call last): File ".\t.py", line 10, in bytesize=serial.SEVENBITS File "C:\Python37\lib\site-packages\serial\serialwin32.py", line 31, in init super(Serial, self).init(*args, **kwargs) File "C:\Python37\lib\site-packages\serial\serialutil.py", line 240, in init self.open() File "C:\Python37\lib\site-packages\serial\serialwin32.py", line 78, in open self._reconfigure_port() File "C:\Python37\lib\site-packages\serial\serialwin32.py", line 222, in _reconfigure_port 'Original message: {!r}'.format(ctypes.WinError())) serial.serialutil.SerialException: Cannot configure port, something went wrong. Original message: OSError(22, 'The parameter is incorrect.', None, 87)

however I found out that the reason for this is the exception raised by a call "win32.SetCommState(self._port_handle, ctypes.byref(comDCB)):" from serialwin32.py

This call returns 0, indicating something is wrong, but when i comment it out then I can get the serial communication working again, anyone else experienced this ? any idea why this is happening ?

KapaA
  • 165
  • 14
  • I have the exact same issue. It's a bummer you didn't get any answers. I wish the error message said which parameter was incorrect. – devtk Mar 31 '19 at 01:53

0 Answers0