On Wed, 2008-08-27 at 12:14 +0200, Per Jessen wrote:
Roger Oberholtzer wrote:
I have a C application that access a GPS receiver over a serial port. Over the years, using Linux (SUSE variants back a long way), I have experienced a problem that has never gone away. Although it appears on the surface to be a programming question, I think it is really a kernel / serial port issue. As I see it in openSUSE, I am starting my quest for a solution here.
The problem is that, after a variable amount of time, reads of the serial port stop blocking (as the port has been configured to do) when there is no data, and start returning immediately with errno set to EAGAIN. This can happen after 5 minutes of running the app, or after 5 hours. There is no discernible pattern.
The code in the application is childishly simple:
1. Open the serial port in the C application, controlling it via termio(). 2. Do a blocking read on the port. 3. When data arrived, write it to a disk file. 4. Go to step 2.
Anyone else using the serial port to record data over long periods of time?
Hi Roger
we have two applications that both read/write to/from a serial port. One application reads temperature measurements and writes commands, the other is a standard NTP reading a DCF77 signal from the serial port. The first application is on SUSE 9.0, the second is on openSUSE 10.2. They've both been running for a couple of years, and neither have ever showed any problems.
OOC, do you run X on these systems? Sometimes YAST/SAX seems to put lines like InputDevices "/dev/ttyS0" in the X config file. It does this for 10 or so serial devices. Or it puts in InputDevices "/dev/input/mice" Where are the potential devices for /dev/input/mice defined? -- Roger Oberholtzer OPQ Systems / Ramböll RST Ramböll Sverige AB Kapellgränd 7 P.O. Box 4205 SE-102 65 Stockholm, Sweden Office: Int +46 8-615 60 20 Mobile: Int +46 70-815 1696 And remember: It is RSofT and there is always something under construction. It is like talking about large city with all constructions finished. Not impossible, but very unlikely. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org