FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 12-16-2008, 01:22 PM
Martin McCormick
 
Default Setting Up RS-232 Ports for Data Logging

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
Systems Engineer
OSU Information Technology Department Telecommunications Services Group

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-16-2008, 02:36 PM
Nils Kassube
 
Default Setting Up RS-232 Ports for Data Logging

Martin McCormick wrote:
> 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?

It's a long time since I played with RS-232 but IIRC you can use stty to
set the RS-232 ports to clocal. Then the handshake signals are ignored and
only data are sent / received. Have a look at the stty man page to find
out if you need other settings as well.


Nils

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-16-2008, 03:09 PM
Martin McCormick
 
Default Setting Up RS-232 Ports for Data Logging

Nils Kassube writes:
> It's a long time since I played with RS-232 but IIRC you can use stty to
> set the RS-232 ports to clocal. Then the handshake signals are ignored and
> only data are sent / received. Have a look at the stty man page to find
> out if you need other settings as well.

That should get me started. Many thanks.

Martin

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 07:49 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org