[ILUG] Serial Port Logging
Niall O Broin
niall at linux.ie
Wed Sep 19 18:37:34 IST 2001
On Wed, Sep 19, 2001 at 02:16:16PM +0100, Paul Jakma wrote:
> On Wed, 19 Sep 2001, Paul Jakma wrote:
>
> > you need a pty. and you need to hack together a little c proggy to
> > allocate it and spit and suck the various bits to where you want em.
>
> as someone else pointed out, it's a serial printer. so there won't be
> anything coming back.
>
> sounds to me like the filter route "cat - | tee ..." suggested
> already is the best way to go.
Jeez Louise - I wonder if some of the people making suggestions have ever
actually used serial printers ? (Yes, I have, and it's never pleasant unless
it's the nth use of the same printer/OS/hardware setup, n > 2). Unless
you've got either a very fast printer or are using a very low baud rate, the
printer will be sending "stuff' back to the logging device. What it will
send back is handshaking information, which may be hardware i.e. using
various combinations of RTS/CTS/Lord alone knows what or software e.g.
XON/XOFF (though you can have other sequences used too, if you're unlucky
enough). So I'd say your chances of tee printer.log </dev/ttyS0 >ttyS1
working absolutely reliably are slim. However it may be close enough for
government work, so if it's a government contract . . . . If you're trying
to e.g. catch the call records coming out the back of a PBX it'll probably
work well enough, but if you absolutely can't risk losing a single character
coming out of the driving device, it's not a flier.
The bulletproof way to do this on a Linux box is to write a program which
emulates a printer i.e. accepts data on a serial port and logs said data and
sends it to the real printer via another port, handling handshaking on both
ports as necessary. I'd be surprised if you'd write such a program for less
than one of the devices Kenn mentioned will cost you. (Just curious Kenn -
with your heavy use of loggers, I did expect you to jump in here. Have you
never needed such a program, or do you just use those cute little boxes with
a fast enough Linux box [and it's not going to need to be all that fast] ?)
Niall
More information about the ILUG
mailing list