[PythonCE] Accessing serial port with PythonCE 2.5

Rushali Watane rushaliwatane at gmail.com
Tue Dec 15 01:41:00 EST 2015


David Goncalves <pythonce-ml <at> lestat.st> writes:

> 
> Hi,
> 
> Stefan Johansson wrote:
> > 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.
> 
> Thanks a lot for that link.
> 
> I downloaded CeSerial and started to listen to my serial port
> only with 3 lines of code ;)
> 
> Regards.
> 
Hi,

I have also downloaded ceSerial and successfully communicate with serial 
ports. I have successfully write the data to the port but I am not able 
to read the data from the ports. It is getting connected to the port but 
it is not able to read the values. Below is my code snippet for reading 
the data from the port.

Can you help me to solve this issue.

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()

Regards
Rushali






More information about the PythonCE mailing list