[RDD] [Off Topic] Serial Port logger?

Chris Howard - CBR cbr at elfpen.com
Fri Jan 10 15:53:45 EST 2014

cat serialport >> logfile

is good in theory.

You'll run into the problem of getting the serial port
set up with the right config.

The historical unix tool for that is stty, but it is somewhat painful.
Maybe someone else knows another more modern tool.

With stty you (used to) do things which look unnatural, like

stty -a < /dev/ttyS0
to get the serial settings.

The newfangled way is stty -F /dev/ttyS0

If you do get it set up so that it works you can save them into
a file with 'stty -g' and blast that file at stty on system startup
and then you are good to go.

If it were me, and since I'm used to it,
I would use stty to set the port and then write a perl
script to read from it and write to the log and then I
could timestamp and do other stuff if that is desired.

I could shoot you a shample of that kind of thing if desired.


On 1/10/2014 2:24 PM, Alan Smith wrote:
> WOW!  Its THAT easy???  (okay, I say that now until I get into trying it!).
> Sorry, I'm a windows guy...make that "former windows guy". Windows does NOT like other programs messing with files while they are in use.
> If I understand it, I can use cat to create the initial log file, while logrotate will automatically empty the contents of that file into a new file daily using the current date as the filename, and even email it, and delete the old ones.
> -Alan
> _______________________________________________
> Rivendell-dev mailing list
> Rivendell-dev at lists.rivendellaudio.org
> http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

More information about the Rivendell-dev mailing list