logging serial port to a file

1 view
Skip to first unread message

doug cooper

unread,
May 14, 2003, 4:17:17 AM5/14/03
to
hello
I would like to log data being received on a serial port to a flat file.

The serial port needs to be set up as ,4800baud, 8bits, No parity and 2
stop bits (yeah 2).
I can get minicom logging the data but I want it to go straight to a
file. I have tried the following

stty -f /dev/ttyd0 4800 cs8 cstopb -parenb
then
cat < /dev/ttyd0 > /tmp/file.txt

Thanks in advance


Frank da Cruz

unread,
May 16, 2003, 1:36:25 PM5/16/03
to
In article <3EC1FB8D...@optusnet.com.au>,
doug cooper <coop...@optusnet.com.au> wrote:
: hello

: I would like to log data being received on a serial port to a flat file.
:
: The serial port needs to be set up as ,4800baud, 8bits, No parity and 2
: stop bits (yeah 2).
: I can get minicom logging the data but I want it to go straight to a
: file....
:
Use Kermit:

http://www.columbia.edu/kermit/ckermit.html

Commands:

set line /dev/whatever
set serial 8N2
set speed 4800
set flow none ; or whatever
set carrier-watch off ; if there is no carrier signal
log session xxx ; xxx is the desired log file name

At this point you have to give a command to make it read input from the
port. CONNECT makes it enter terminal mode, so you can also see the
stuff scroll by on the screen. You can also use the INPUT command for
this. Various tricks can be used to have it stop at a certain time,
or if a certain string appears, or if Carrier drops (if it eve was up),
etc. For more ideas, see the Kermit script library:

http://www.columbia.edu/kermit/ckscripts.html

- Frank

doug....@fmlynet.org

unread,
May 17, 2003, 6:25:48 AM5/17/03
to
From: doug....@fmlynet.org

From: doug cooper <coop...@optusnet.com.au>

hello
I would like to log data being received on a serial port to a flat file.

The serial port needs to be set up as ,4800baud, 8bits, No parity and 2 stop
bits (yeah 2).

I can get minicom logging the data but I want it to go straight to a file. I
have tried the following

stty -f /dev/ttyd0 4800 cs8 cstopb -parenb then cat < /dev/ttyd0 >
/tmp/file.txt

Thanks in advance

-+- BBBS/NT v4.01 Flag-4
+ Origin: FamilyNet Sponsored by http://www.christian-wellness.net (8:8/2002)

--- BBBS/NT v4.01 Flag-4
* Origin: FamilyNet Sponsored by http://www.christian-wellness.net (8:8/2)

Frank....@fmlynet.org

unread,
May 17, 2003, 6:25:50 AM5/17/03
to
From: Frank....@fmlynet.org

From: f...@columbia.edu (Frank da Cruz)

In article <3EC1FB8D...@optusnet.com.au>, doug cooper
<coop...@optusnet.com.au> wrote:

: hello


: I would like to log data being received on a serial port to a flat file.
:
: The serial port needs to be set up as ,4800baud, 8bits, No parity and 2
: stop bits (yeah 2).
: I can get minicom logging the data but I want it to go straight to a

: file....
:
Use Kermit:

http://www.columbia.edu/kermit/ckermit.html

Commands:

set line /dev/whatever
set serial 8N2
set speed 4800
set flow none ; or whatever
set carrier-watch off ; if there is no carrier signal
log session xxx ; xxx is the desired log file name

At this point you have to give a command to make it read input from the port.
CONNECT makes it enter terminal mode, so you can also see the stuff scroll by
on the screen. You can also use the INPUT command for this. Various tricks
can be used to have it stop at a certain time, or if a certain string appears,
or if Carrier drops (if it eve was up), etc. For more ideas, see the Kermit
script library:

http://www.columbia.edu/kermit/ckscripts.html

- Frank

-+- BBBS/NT v4.01 Flag-4

Reply all
Reply to author
Forward
0 new messages