Results 1 to 5 of 5
I'm on an embedded platform, trying to use microcom to talk to a modem device from a script. I made a named pipe with mkfifo and I'm trying to do ...
- 07-14-2010 #1Just Joined!
- Join Date
- Jul 2010
- Posts
- 2
Named pipes into program
I'm on an embedded platform, trying to use microcom to talk to a modem device from a script. I made a named pipe with mkfifo and I'm trying to do something like:
I've tried variations on a theme such as:Code:microcom /dev/ttyUSB0 <pipe1 >/tmp/responses & echo "at" > pipe cat /tmp/responses #returns "at" the first time, doesn't change after echoing other things to the pipe.
I've tried a few things and haven't been able to get anything to work. I know about tools like expect and its cousins, but I can't use that because this is a very limited platform. Any suggestions?Code:tail -f pipe | microcom >> /tmp/responses & tail -f /tmp/responses & echo "at" > pipe #causes microcom to exit, nothing comes out.
- 07-15-2010 #2
No idea at all really, but I like doing this:
Then, on another terminal:Code:$ cat > pipe1 enter some text <ctrl+d>
Then the text comes out of the other terminal. ctrl+d ends the process.Code:$ cat < pipe1 <return>
Y'know, it just clarifies what pipes do.
- 07-15-2010 #3Just Joined!
- Join Date
- Oct 2007
- Posts
- 8
My suspicion is that because you start the microcom process reading in from a pipe, once the contents of the pipe are exhausted and the ctrl-d (end of data) signal is sent as the input to microcom that the microcom process terminates and the subsequent cat/echo statements directed to the pipe are ignored, because microcom isn't listening anymore. You may want to put a sleep between the first echo and the cat and then use a second shell window to see if the microcom process still exists. That would validate or repudiate this hypothesis.
- 07-19-2010 #4
Add the remark about screen.
As waynemot points out, echo > pipe also produces the EOF symbol, which makes microcom exit.
I've tried the same thing subsituting microcom with cat and it worked as expected. This most probably means that something is wrong with the microcom application or with the data you are trying to supply to it.
And yes, I used more than one shell sessions (via screen).
- 07-20-2010 #5Just Joined!
- Join Date
- Jul 2010
- Posts
- 2
I've tried the same thing subsituting microcom with cat and it worked as expected. This most probably means that something is wrong with the microcom application or with the data you are trying to supply to it.
And yes, I used more than one shell sessions (via screen).
Thanks, folks. Looks like I have some more to try.


Reply With Quote
