Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Redirect Minicom Output

5,200 views
Skip to first unread message

Arto

unread,
Jun 19, 2011, 2:45:57 AM6/19/11
to
Dears,

I am trying to redirect the minicom output to a file, there is the
capture file option in my version of minicom but it only writes to the
file when I choose "close capture file".

I want to add minicom as a startup service, and make its' output
redirected automatically to a file, without having buffer in memory
because that risks losing data in power loss.

Your help appreciated.

Regards,
Arto

Kenny McCormack

unread,
Jun 19, 2011, 6:42:11 AM6/19/11
to
In article <0270ca83-40dc-4983...@k24g2000yqb.googlegroups.com>,

Arto <art...@gmail.com> wrote:
>I am trying to redirect the minicom output to a file, there is the
>capture file option in my version of minicom but it only writes to the
>file when I choose "close capture file".

The best advice I can give you is to toss minicom. It is a painfully hard
program to use. It's one of those "It only ever gained any currency because
it is the built-in default program of its type (in Linux)". Kinda like
"EDLIN" being the only built-in editor in DOS. So everybody started using
it, instead of (quickly) installing something that works.

Anyway, back on topic, use "screen" as your serial comm program. (No, I'm
not joking - screen can do serial communications). I am not sure if it will
fix the buffering problem (I think it will, but I'm not sure), but the point
is, you will have something that you can work with.

--
> No, I haven't, that's why I'm asking questions. If you won't help me, why
> don't you just go find your lost manhood elsewhere.

CLC in a nutshell.

Arto

unread,
Jun 20, 2011, 2:16:13 AM6/20/11
to
On Jun 19, 12:42 pm, gaze...@shell.xmission.com (Kenny McCormack)
wrote:
> In article <0270ca83-40dc-4983-8b45-7fd53f8c6...@k24g2000yqb.googlegroups.com>,

Thank you very MUCH for your help. I managed to use the following
screen command to do what I want:
screen /dev/ttyS0 9600,cs8 -ixon

I found good info on this website:
http://www.cyberciti.biz/faq/unix-linux-apple-osx-bsd-screen-set-baud-rate/

I am just left with two questions which are confusing to me as yet...

1. If I want to redirect the output of screen, should I just use the
traditional way "screen /dev/ttyS0 -blah -blah >file1.out" or should I
try some functionality built in the screen command that supports
redirection? And what is it?

2. If I want to start-up the screen monitoring of the serial port
automatically at each start-up (I'm using CentOs 5.5), should I make a
small script in crontab to initiate an if statement every 5 minutes
and check if screen is UP or NO, ORRRR should I try to set the screen
command/script as a service? And how can I add a script as a service
on Centos 5.6?

Your help is extremely appreciated :D

Regards,
Arto


Stephane CHAZELAS

unread,
Jun 20, 2011, 9:29:45 AM6/20/11
to
2011-06-19, 23:16(-07), Arto:
[...]

> Thank you very MUCH for your help. I managed to use the following
> screen command to do what I want:
> screen /dev/ttyS0 9600,cs8 -ixon
>
> I found good info on this website:
> http://www.cyberciti.biz/faq/unix-linux-apple-osx-bsd-screen-set-baud-rate/
>
> I am just left with two questions which are confusing to me as yet...
>
> 1. If I want to redirect the output of screen, should I just use the
> traditional way "screen /dev/ttyS0 -blah -blah >file1.out" or should I
> try some functionality built in the screen command that supports
> redirection? And what is it?
[...]

It seems to me that what you're trying to achieve would be
answered by:

(stty 115200 cs8 -ixon; cat) < /dev/ttyS0 > some-file.log

wouldn't it?

Or do you need to interact with that?

--
Stephane

Arto

unread,
Jun 26, 2011, 5:53:05 AM6/26/11
to
On Jun 20, 4:29 pm, Stephane CHAZELAS <stephane_chaze...@yahoo.fr>
wrote:
> 2011-06-19, 23:16(-07),Arto:

> [...]> Thank you very MUCH for your help. I managed to use the following
> > screen command to do what I want:
> > screen /dev/ttyS0 9600,cs8 -ixon
>
> > I found good info on this website:
> >http://www.cyberciti.biz/faq/unix-linux-apple-osx-bsd-screen-set-baud...

>
> > I am just left with two questions which are confusing to me as yet...
>
> > 1. If I want to redirect the output of screen, should I just use the
> > traditional way "screen /dev/ttyS0 -blah -blah >file1.out" or should I
> > try some functionality built in the screen command that supports
> > redirection? And what is it?
>
> [...]
>
> It seems to me that what you're trying to achieve would be
> answered by:
>
> (stty 115200 cs8 -ixon; cat) < /dev/ttyS0 > some-file.log
>
> wouldn't it?
>
> Or do you need to interact with that?
>
> --
> Stephane

Thanks a lot for your reply Stephane, the command you provided is
working. Could you please explain it? I don't understand the syntax
meaning at all.

Regards,
Arto

0 new messages