"Frederic Wenzel" <[EMAIL PROTECTED]> Wrote:
>On 9/9/06, Frederic Wenzel <[EMAIL PROTECTED]> wrote: >> On 9/9/06, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: >> > | I wrote a script on Linux that uses pyserial to read status messages >> > | from a serial line using readlines(). For now, it just displays what >> > | it gets on stdout: >> > | (...) >> > | ser = serial.Serial(port=1, >> > | baudrate=1200, >> > | rtscts=1, >> > | >> > | If the script does not time out there, I am not sure what else it is >> > | doing. It seems to be in a wait state it does not get out of. > >When it stopped working again (unfortunately) I pressed ctrl c and got the following outputĂ– > >14:53 | 0008 | 02 | | 5 |Rack Abs.| - | --752 >14:53 | 0005 | 02 | | 2 |Rack Abs.| - | 00752 >14:53 | 0008 | 02 |Traceback (most recent call last): > File "serialhandler.py", line 34, in ? > lines = sh.readLines() > File "serialhandler.py", line 29, in readLines > return self.ser.readlines() > File "/usr/lib/python2.3/site-packages/serial/serialutil.py", line 78, in readlines > line = self.readline(eol=eol) > File "/usr/lib/python2.3/site-packages/serial/serialutil.py", line 60, in readline > c = self.read(1) > File "/usr/lib/python2.3/site-packages/serial/serialposix.py", line 269, in read > ready,_,_ = select.select([self.fd],[],[], self._timeout) >KeyboardInterrupt > > >Apparently this is the place where it gets stuck. The select.select >line does not return, not even for a timeout. > >Fred This seems a real PITA - it looks normal to me - it is as if the device has simply stopped sending for some reason. Can you: 1) set the external device up to ignore flow control? 2) check the cable for loose connections - wriggling it around while the transmission is running might point at something - but be gentle - else you can easily draw false conclusions, or break something that is in fact ok... does anybody else know how to check the value of the time out, what its for and what happens when it times out? - hth - Hendrik |
-- http://mail.python.org/mailman/listinfo/python-list