I am trying to get serial communication working between my Arduino and Python. I am new at this, but I have tested several examples, none of which worked. This was only supposed to be the initial step in a larger project, but I have run into a brick wall.
I know that serial communication is working between my computer and my Arduino as I can upload programs and I can see results from the Arduino in the Arduino Serial Monitor. So the problem likely lies with Python. I am running Python 3.2 on Windows 7 (64 bit). It seems possible that the problem may be in pySerial.
I keep getting the following error:
File "C:\Python32\lib\site-packages\serial\serialwin32.py", line 236, in read
raise SerialException("ReadFile failed (%s)" % ctypes.WinError())
serial.serialutil.SerialException: ReadFile failed ([Error 6] The handle is invalid.)
The same error message occurs with multiple examples.
Can anyone help? I'm stuck at this point. I'd have posted the code, but I really don't believe the problem is in the code, as I have copied exactly some of the examples that purport to show how serial communications works between Arduino and Python.
I checked many places on the Internet, which pointed me in the direction of a problem with 32bit vs 64bit environment. I've tried installing a new version of pySerial as well as a new version of win32.py, again, with no joy.
Is this problem specific to Windows 7? Is it Python 3.2? Is it pySerial? Is it win32.py? Could it be my setup?
I appreciate any help.
jbolt