From rushaliwatane at gmail.com Tue Dec 15 00:30:59 2015 From: rushaliwatane at gmail.com (Rushali Watane) Date: Tue, 15 Dec 2015 05:30:59 +0000 (UTC) Subject: [PythonCE] Accessing serial port with PythonCE 2.5 References: <20070110151828.88211.qmail@web60720.mail.yahoo.com> Message-ID: Stefan Johansson 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 lestat.st> > To: Luke Dunstan hotmail.com> > Cc: pythonce 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 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() From rushaliwatane at gmail.com Tue Dec 15 01:41:00 2015 From: rushaliwatane at gmail.com (Rushali Watane) Date: Tue, 15 Dec 2015 06:41:00 +0000 (UTC) Subject: [PythonCE] Accessing serial port with PythonCE 2.5 References: <20070110151828.88211.qmail@web60720.mail.yahoo.com> <45A6BE6E.6010707@lestat.st> Message-ID: David Goncalves 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 From gadgetsteve at hotmail.com Tue Dec 15 01:53:00 2015 From: gadgetsteve at hotmail.com (Steve (Gadget) Barnes) Date: Tue, 15 Dec 2015 06:53:00 +0000 Subject: [PythonCE] Accessing serial port with PythonCE 2.5 In-Reply-To: References: <20070110151828.88211.qmail@web60720.mail.yahoo.com> <45A6BE6E.6010707@lestat.st> Message-ID: On 15/12/2015 06:41, Rushali Watane wrote: > David Goncalves 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 > > > > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > https://mail.python.org/mailman/listinfo/pythonce > Hi, You seem to be missing the essential steps of ser.open() before trying to read and ser.close() at the end. -- Steve (Gadget) Barnes Any opinions in this message are my personal opinions and do not reflect those of my employer. From rushaliwatane at gmail.com Tue Dec 15 04:19:30 2015 From: rushaliwatane at gmail.com (Rushali Watane) Date: Tue, 15 Dec 2015 09:19:30 +0000 (UTC) Subject: [PythonCE] Accessing serial port with PythonCE 2.5 References: <20070110151828.88211.qmail@web60720.mail.yahoo.com> <45A6BE6E.6010707@lestat.st> Message-ID: Steve (Gadget) Barnes hotmail.com> writes: > > > On 15/12/2015 06:41, Rushali Watane wrote: > > David Goncalves 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 > > > > > > > > > > _______________________________________________ > > PythonCE mailing list > > PythonCE python.org > > https://mail.python.org/mailman/listinfo/pythonce > > > > Hi, > > You seem to be missing the essential steps of ser.open() before trying > to read and ser.close() at the end. Hello Sir, I have open the port as ser.open() before trying to read but it is giving me output as connected to COM1: Got: But not going to read the data. I am sending you my updated code. Please have a look on it. 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) ser.open() #data = '' while True: n = ser.inWaiting() size = n data = ser.readline(size) if len(data) > 0: print 'Got:', data sleep(0.5) #print 'not blocked' ser.close() Regards Rushali From rushaliwatane at gmail.com Tue Dec 15 07:01:33 2015 From: rushaliwatane at gmail.com (Rushali Watane) Date: Tue, 15 Dec 2015 12:01:33 +0000 (UTC) Subject: [PythonCE] Accessing serial port with PythonCE 2.5 References: <20070110151828.88211.qmail@web60720.mail.yahoo.com> <45A6BE6E.6010707@lestat.st> Message-ID: Steve (Gadget) Barnes hotmail.com> writes: > > > On 15/12/2015 06:41, Rushali Watane wrote: > > David Goncalves 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 > > > > > > > > > > _______________________________________________ > > PythonCE mailing list > > PythonCE python.org > > https://mail.python.org/mailman/listinfo/pythonce > > > > Hi, > > You seem to be missing the essential steps of ser.open() before trying > to read and ser.close() at the end. Hi I have open the port before trying to read the data but it shows only output as- connected to:COM1 Got: It is get connected to the serial port but not able to read the values from the port. I am sending you the my updated code snippet. please tell me the solution for it. from time import sleep import ceserial ser = ceserial.Serial(port="COM5:",baudrate=9600,bytesize=8,stopbits=ceserial. STOPBITS_ONE,parity=ceserial.PARITY_EVEN) print("connected to: " + ser.portstr) ser.open() #data = '' while True: n = ser.inWaiting() size = n data = ser.readline(size) if len(data) > 0: print 'Got:', data sleep(0.5) #print 'not blocked' ser.close() Regards Rushali From adam.walley at gmail.com Tue Dec 15 08:04:07 2015 From: adam.walley at gmail.com (Adam Walley) Date: Tue, 15 Dec 2015 13:04:07 +0000 Subject: [PythonCE] Accessing serial port with PythonCE 2.5 In-Reply-To: References: <20070110151828.88211.qmail@web60720.mail.yahoo.com> Message-ID: Hello, I thought I would send a short comment, as I have used the ceserial module (a long time ago) for my HP iPaq running PythonCE 2.5. I recall that the ceserial module tries to implement what the standard serial module does for Python, but depending on the actual version of ceserial used there may be some small differences in the naming of the of the properties and variables. It is worth verifying in the ceserial module that it is actually settings the parameters as expected for the serial port object. That aside, I would also say that a PARITY_EVEN setting would be unusual these days and that PARITY_NONE is more common. I think I also found that the stopbits setting did not set the port as expected. Sorry to not have a definite answer, but an oscilloscope will show you what the device is trying to do. Finally, perhaps the device you are connecting to is expecting the DTR line to change? AdamW On 15 December 2015 at 05:30, Rushali Watane wrote: > Stefan Johansson 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 lestat.st> > > To: Luke Dunstan hotmail.com> > > Cc: pythonce 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 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() > > > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > https://mail.python.org/mailman/listinfo/pythonce > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rushaliwatane at gmail.com Wed Dec 16 04:11:58 2015 From: rushaliwatane at gmail.com (Rushali Watane) Date: Wed, 16 Dec 2015 09:11:58 +0000 (UTC) Subject: [PythonCE] Accessing serial port with PythonCE 2.5 References: <20070110151828.88211.qmail@web60720.mail.yahoo.com> <45A6BE6E.6010707@lestat.st> Message-ID: Hi, Please do help me. I have tried with this essential step but not able to read the data. Please do needful. Regards Rushali From adam.walley at gmail.com Wed Dec 16 05:29:01 2015 From: adam.walley at gmail.com (Adam Walley) Date: Wed, 16 Dec 2015 10:29:01 +0000 Subject: [PythonCE] Accessing serial port with PythonCE 2.5 In-Reply-To: References: <20070110151828.88211.qmail@web60720.mail.yahoo.com> <45A6BE6E.6010707@lestat.st> Message-ID: Hello, Just to add to my previous message, the ceserial module uses ctypes to access the same functionality which would be used by a WinCE application written in VB or C#. I have just checked and Microsoft appear to still have the reference pages available, so you may find that the following link can guide you in checking the serial communications: https://msdn.microsoft.com/en-us/library/aa450503.aspx (I am assuming WinCE version 5.0, but I think WinCE 6.0 and later versions will also be available) For checking your device is communicating as expected, you could try to use a third party terminal program that can also access the serial port. I recall using vxHpc and also PocketPuTTY. These can be installed directly onto the WinCE device and allow you to test the serial port. Then you can try connecting the WinCE device directly to a computer to check communication settings are correct, then connect your serial device directly to a computer (just the regular troubleshooting steps really). Good luck AdamW On 16 December 2015 at 09:11, Rushali Watane wrote: > Hi, > > Please do help me. I have tried with this essential step but not able to > read the data. > Please do needful. > > Regards > Rushali > > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > https://mail.python.org/mailman/listinfo/pythonce > -------------- next part -------------- An HTML attachment was scrubbed... URL: