Mailinglist Archive: opensuse (2162 mails)

< Previous Next >
Re: [opensuse] Long standing serial port issue in openSuse
  • From: Per Jessen <per@xxxxxxxxxxxx>
  • Date: Wed, 27 Aug 2008 12:14:57 +0200
  • Message-id: <g939f1$jrq$1@xxxxxxxxxxxxxxxx>
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.
Your pseudo-code looks pretty much like mine (for the temp controller),
except I write a command to the serial port before I read the
temperature.


/Per Jessen, Zürich

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References