Python -> serial -> Arduino

First: Im a NOOB.
Second: cant connect python to my com3(usb) where my arduino mega is located.

pyserial 32bit and python 32bit, running on win7 64bit.

Here is the python code and result.

ser = serial.Serial('COMM3', 9600)
ser.write('hello world')

Traceback (most recent call last):
File "<pyshell#16>", line 1, in
ser = serial.Serial('COMM3', 9600)
File "C:\Python27\lib\site-packages\serial\serialwin32.py", line 30, in init
SerialBase.init(self, *args, **kwargs)
File "C:\Python27\lib\site-packages\serial\serialutil.py", line 260, in init
self.open()
File "C:\Python27\lib\site-packages\serial\serialwin32.py", line 56, in open
raise SerialException("could not open port %s: %s" % (self.portstr, ctypes.WinError()))
SerialException: could not open port COMM3: [Error 2] Systemet finner ikke angitt fil. (Norwegian: cant find file)

Am i missing something in the python program or...?

Karl

Did i mention i started with python today? :slight_smile:

Com port names, on Windows, are COMn, where n is 1 to 9. The format changes slightly when n exceeds 9. You have two Ms in the name, not one.

I use linux, my python looks like this:

ser = serial.Serial('/dev/ttyUSB0', 9600)