pyserial port connection problem

Grant Edwards grante at visi.com
Fri Nov 17 10:41:21 EST 2006


On 2006-11-17, Jon <jspeis at gmail.com> wrote:

> I ran py2exe on the program (which uses wxpython for its gui)
> and sent the output from the py2exe to another computer. now
> when I try to run it on this other computer it fails to open
> the port. it gives the error that it cannot createfile. the
> code I'm using to connect is the same as it is when it worked
> on my computer.

Are you sure you're using the correct com port?

> I do notice that pyserial sees this port on the other computer as
> \\\\.\\COM14 - while windows device manager displays it as COM14.

That's just another one of the many fun and wonderful little
bits of brokenness in MS Windows.  COM14 can't be opened using
the name COM14.  You have to call it \\.\COM14.  Using the
unadorned COMx name only works for COM1-COM9.  Since the
dimwits at MS decided to use C's "escape" character as a
directory separator, you've got to double it up (e.g.
"\\\\.\\COM14") to get the string you really want.

> On the other computer the data is properly displayed in
> Hyperterminal when opened on COM14.

What it displays as on other computers is irrelevant.  Just
because a USB serial adapter shows up as COM14 on machine A,
that doesn't mean it's going to be COM14 on machine B.

> how can I resolve this issue?

Go look in the device manager to see what com port you should
be using.

-- 
Grant Edwards                   grante             Yow!  There's a SALE on
                                  at               STRETCH SOCKS down at the
                               visi.com            "7-11"!!



More information about the Python-list mailing list