Setting Up RS-232 Ports for Data Logging
martin at dc.cis.okstate.edu
Tue Dec 16 14:22:48 UTC 2008
I wrote 2 applications that listen for serial data on a
RS-232 port. Each application listens on its own port and,
except for sharing the same box, they are supposed to be
independant of each other.
As it stands right now, both applications are trying to
read /dev/ttyUSB0 for one and /dev/ttyUSB1 for the other.
I can start either 1 and it seems to work. When I start
the second app, it either instantly dies with a buffer overflow
or waits until a handfull of characters have gone in and then
croaks while sending the buffer overflow message out the serial
port as well as to the syslog.
I successfully ran 2 instances of ckermit and, as a test
sent a 162-meg syslog file from our DHCP server as test data.
Both instances ran flawlessly so I know the hardware, including
the USB-based RS-232 converters works fine.
The applications just open /dev/ttyXx as a file and read
it. Is there any kind of better definition in /etc/event.d I can
put in for these tty's? I would like to keep it simple but
robust so the applications will keep running and ignore hardware
changes such as when the system at the other end shuts off its
port which happens from time to time.
Flow control is really not an issue because the messages
are short and not continuous. What I want is all the serial data, no
matter what else happens.
Basically, I am asking if there is a way to set up
serial port configurations on the system or is it necessary to
include that code in the applications?
So far, I really like ubuntu server.
Martin McCormick WB5AGZ Stillwater, OK
OSU Information Technology Department Telecommunications Services Group
More information about the ubuntu-users