Re: [SLUG] BASH and a comm port

From: Macy1 Hallock (macy1@hallock.net)
Date: Wed Jan 25 2006 - 20:14:31 EST


Ron Youvan wrote:
> A bash question.
>
> My stupid LINUX books only say some special understanding (of some
> kind)
> is required to deal with comm. ports when using bash script files.
> (I can do anything with a few examples, but they are scarce in my books,
> I am just a user.)
>
> I have a project at work where I have DOS text strings constantly
> coming
> into a computer (it will be operating just LINUX with no X windows system
> at all) and I want to append a file (named with the current date) and
> also
> tee to the display (for confidence) to a virtual terminal.
>
> At 0000 hrs a new file will be created and the string will be append
> that
> file. This is a "logging function," I am using a M$ DOS laptop
> currently,
> on a chair, but I need to use it elsewhere.
> I can easily do all of this from a file, but I need to get the
> string from
> a comm. port. I don't want to run any comm. program. (as I am now:
> Telix)
>
> Can anyone point me to some reading that will help me along?
>
Done the same thing for logging data from phone systems, router and
other types of instrumentation over the years,

Intially, I used telix, then cu or minicom. Functional, but required too
much setup.
Then I found the following two small programs that were just the right
solution:

http://freshmeat.net/projects/ttywatch/?branch_id=48611&release_id=158595

http://fresh.t-systems-sfr.com/linux/src/logserial-0.4.2.tar.gz/

As for seeing the input on the screen, I just spawn a "tail -f filename"
command
on the log file I'm writing to in the appropriate tty screen. I suppose
you could
tee off the data in some form in the code to a screen.

FWIW, it's also possible to do this from a perl script...
http://www.aplawrence.com/Unix/logger.html

Now you just need to integrate one of these programs into a log rotation
script
That's where I send the log file off for archiving, billing or analysis
as needed.

I find that discarded P2 or P3 machines with two serial ports, a small HD
with a base linux install and an ethernet port make excellent el cheapo
loggers.

Hope this works for you. If not, your money will be cheerfully refunded.

-- 
 Macy Hallock (personal email account) Medina, OH - Lutz, FL
Tel 813-632-2988 Cell 813-493-8899 Email macy1 (at) hallock.net

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:10:01 EDT