<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>"Frederic Wenzel" <<A
href="mailto:fred@osuosl.org">fred@osuosl.org</A>> Wrote:<BR><BR>>On
9/9/06, Frederic Wenzel <<A
href="mailto:freeed@gmail.com">freeed@gmail.com</A>> wrote:<BR>>> On
9/9/06, Hendrik van Rooyen <<A
href="mailto:mail@microcorp.co.za">mail@microcorp.co.za</A>>
wrote:<BR>>> > | I wrote a script on Linux that uses pyserial to read
status messages<BR>>> > | from a serial line using readlines(). For
now, it just displays what<BR>>> > | it gets on stdout:<BR>>>
> | (...)<BR>>> > | ser = serial.Serial(port=1,<BR>>> >
|
baudrate=1200,<BR>>> >
|
rtscts=1,<BR>>> > |<BR>>> > | If the script does not time out
there, I am not sure what else it is<BR>>> > | doing. It seems to be in
a wait state it does not get out of.<BR>><BR>>When it stopped working
again (unfortunately) I pressed ctrl c and got the<BR>following
outputÖ<BR>><BR>>14:53 | 0008 | 02 | | 5 |Rack
Abs.| - | --752<BR>>14:53 | 0005 | 02 | | 2
|Rack Abs.| - | 00752<BR>>14:53 | 0008 | 02 |Traceback (most
recent call last):<BR>> File "serialhandler.py", line 34, in
?<BR>> lines = sh.readLines()<BR>> File
"serialhandler.py", line 29, in readLines<BR>> return
self.ser.readlines()<BR>> File
"/usr/lib/python2.3/site-packages/serial/serialutil.py", line 78,
in<BR>readlines<BR>> line =
self.readline(eol=eol)<BR>> File
"/usr/lib/python2.3/site-packages/serial/serialutil.py", line 60,
in<BR>readline<BR>> c = self.read(1)<BR>> File
"/usr/lib/python2.3/site-packages/serial/serialposix.py", line 269,
in<BR>read<BR>> ready,_,_ = select.select([self.fd],[],[],
self._timeout)<BR>>KeyboardInterrupt<BR>><BR>><BR>>Apparently this
is the place where it gets stuck. The select.select<BR>>line does not return,
not even for a timeout.<BR>><BR>>Fred<BR><BR>This seems a real PITA - it
looks normal to me - it is as if the device has<BR>simply stopped sending for
some reason. Can you:<BR><BR>1) set the external device up to ignore flow
control?<BR>2) check the cable for loose connections - wriggling it around while
the<BR>transmission is running might point at something - but be gentle - else
you can<BR>easily draw false conclusions, or break something that is in fact
ok...<BR><BR>does anybody else know how to check the value of the time out, what
its for and<BR>what happens when it times out?<BR><BR>- hth -
Hendrik<BR></DIV></BODY></HTML>