ts-7000
[Top] [All Lists]

[ts-7000] Re: Capturing serial port to text

To:
Subject: [ts-7000] Re: Capturing serial port to text
From: "yoobb" <>
Date: Sat, 03 Mar 2007 22:20:26 -0000
--- In  "yoobb" <> wrote:
>
> Does anybody have any ideas on how to easily capture serial port input 
> (either COM1 or 
> COM2) to a text file?  Ideally, I would like the TS-7200 to continuously 
> direct serial port 
input 
> to a text file, appending to the same file (or a new file) with each restart.
> 
> The only idea I have so far is to install minicom and set up a boot script 
> that starts 
minicom 
> and directs it to a text file automatically.
> 
> TIA!
>

Thanks to both people who've replied so far!

For now, I am successfully redirecting COM2 to a log file.  The device file is 
/dev/ttyAM1.  I 
found out (on this board) that I first have to comment out the line in the file 
/etc/inittab 
containing "getty" and "ttyAM1".  Apparently, getty is a program that, by 
default, uses the 
serial port.  Commenting out this line frees up the serial port for my own use.

I then added a boot script to /etc/rc2.d, naming it "S99datarecord".  The 
script contains:

stty -F /dev/AM1 ispeed 4800
stty -F /dev/AM1 ospeed 4800
stty -F /dev/AM1 igncr
cat /dev/AM1 >> /home/me/log

The first two lines set the desired speed.  The third line says to ignore 
carriage returns.  
Before I put in the igncr, I was getting double-spaced output.  Apparently, my 
device uses 
<CR><LF> to end a line (like DOS) and the serial port must've been converting 
the CR to a 
second LF.  igncr throws out the extraneous CR.

I also had to set executable permissions: chmod +x S99datarecord.

This is crude, but it works.  The only problem is the data capture occurs 
midstream and 
stops midstream, so the first and last lines of data are partial lines.  If I 
were to use the 
text file as is, I would have to strip out the the first and last lines of 
every session.

I'll explore more sophisticated methods as time permits.  The previous response 
lists 
some very promising suggestions.

Thanks to all!



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Something is new at Yahoo! Groups.  Check out the enhanced email design.
http://us.click.yahoo.com/kOt0.A/gOaOAA/yQLSAA/CFFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU