Help - Search - Members - Calendar
Full Version: Communicating With Modem Through A Shell Script
OESF Portables Forum > General Forums > General Discussion
suruaZ
Hello,

Is there a way to communicate with modem (send commands and receive answers) from a shell script? I want to automate some typing in minicom.

Thanks,
suruaZ
iamasmith
As minicom would have the port locked for use whilst running your only option would be to use the features (if any) of minicom.
suruaZ
QUOTE(iamasmith @ Feb 27 2005, 07:13 AM)
As minicom would have the port locked for use whilst running your only option would be to use the features (if any) of minicom.
*


Interesting but seems port is not locked. When minicon is opened and I have typed something like: echo "atd12345" > /dev/ttyS3 in other console it appeared in the minicom window (but I need to press enter to finish the command).
Anyway I'm going to use the shell script without minicom running. So the question is still remains.

suruaZ
ScottYelich
without getting into the nitty gritty about having both sides of the serial speaking the "same language" (ie: data bits, stop bots, parity, flow control (hw/sw), etc.) -- if the serial port
and the modem are speaking the same language, then you can open the serial port
for reading/writing as any other file.

Scott
datajerk
If you want to automate typing look at Expect. Expect will launch minicom and monitor your input and output and then assist as needed.
suruaZ
QUOTE(datajerk @ Feb 28 2005, 07:17 AM)
If you want to automate typing look at Expect.  Expect will launch minicom and monitor your input and output and then assist as needed.
*


Could you provide some links please. I never heard about Expect. What is it?

Thanks,
suruaZ
nilch
Here is the IPK for Expect.

Expect is a unix tool to automatically enter parameters or user inputs without the user having to actually enter the input - but autmated.

So if your program at a particular pint reqwuired the user to press 'Y' to continue - you can make expect enter the 'Y' at the appropraite point in the program flow.
So if a program (or shell script) is 'expecting' an input, expect provides the input based on user definition.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.