[PythonCE] (Solved!) Using serial ports
David McNab
rebirth at orcon.net.nz
Mon Jun 1 02:19:41 CEST 2009
Hi all,
It seems the problem is triggered by setting the baudrate prior to
calling the '.open()' method.
The following works:
from ceserial import Serial, SerialException
port = Serial(port='COM1:')
port.open()
port.baudrate = 115200
The following fails:
from ceserial import Serial, SerialException
port = Serial(port='COM1:')
port.baudrate = 115200
port.open()
This fails too:
from ceserial import Serial, SerialException
port = Serial(port='COM1:', baudrate=115200)
port.open()
Cheers
David
On Mon, 2009-06-01 at 09:27 +1200, David McNab wrote:
> On Sun, 2009-05-31 at 23:08 +1200, David McNab wrote:
> > Also, I tried the 'ceserial.py' module which has popped up on some
> > discussions, but it crashes in its Serial.open() method with a most
> > unhelpful exception string '50'.
>
> More info on that:
>
> Seems that Serial.open() gets a bad return code when it calls
> windll.coredll.SetupComm() to set the buffer sizes. If I comment out the
> exception, then self._configurePort crashes with the same exception.
>
> I'm trying to open COM1: on an h4350.
>
> Can anyone please shed some light.
>
> Thanks
> David
>
>
>
> _______________________________________________
> PythonCE mailing list
> PythonCE at python.org
> http://mail.python.org/mailman/listinfo/pythonce
More information about the PythonCE
mailing list