[PythonCE] Accessing serial port with PythonCE 2.5

Rushali Watane rushaliwatane at gmail.com
Tue Dec 15 00:30:59 EST 2015


Stefan Johansson <sjn37 <at> yahoo.com> writes:

> 
> You can find a link to ceserial in the archives:
> http://mail.python.org/pipermail/pythonce/2006-September/001589.html
> I have used it successfully on my Dell Axim.
> 
> Stefan
> 
> ----- Original Message ----
> From: David Goncalves <pythonce-ml <at> lestat.st>
> To: Luke Dunstan <coder_infidel <at> hotmail.com>
> Cc: pythonce <at> python.org
> Sent: Monday, January 8, 2007 4:08:58 PM
> Subject: Re: [PythonCE] Accessing serial port with PythonCE 2.5
> 
> Hi,
> 
> > Well there is no "serial" module included with PythonCE, but Python 
on 
> > my PC doesn't have such a module either. I haven't done it myself on 
> > PythonCE but I think the best way would be to use ctypes to access 
the 
> > Win32 serial communications APIs. I have written some code to do 
this on 
> > the PC, so I have attached it.
> 
> Thanks for your code ;) I'll try it and give feedback.
> 
> I've seen about people usin "ceserial" that seems to be a port of
> PySerial on WinCE. But no way to find it somewhere on the net :(
> _______________________________________________
> PythonCE mailing list
> PythonCE <at> python.org
> http://mail.python.org/mailman/listinfo/pythonce
> 
Hi,
I am trying to read the data from serial port using python 2.5 with 
ceserial module on windows CE 5.0. When i am trying to run, it is get 
connected to port, but it is not reading the data from the port.Below is 
my code -

from time import sleep
import ceserial

ser = 
ceserial.Serial(port="COM1:",baudrate=9600,bytesize=8,stopbits=ceserial.
STOPBITS_ONE,parity=ceserial.PARITY_EVEN)

print("connected to: " + ser.portstr)

#data = ''
while True:
    data = ser.read(9999)
    if len(data) > 0:
        print 'Got:', data
    sleep(0.5)
    #print 'not blocked'

ser.close()





More information about the PythonCE mailing list