Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing modem commands in a script

Status
Not open for further replies.

kiano

Technical User
Nov 21, 2001
19
0
0
GB
I need to create a script using CU and AT commands - I am struggling passing the AT commands to the script - any help would be appreciated.

Script would read as follows....

cu -m -l /dev/tty1
at&f
at&c
at&m
at&w
~.

Help!
 
try this , see if it works

function reset_modem {
{

{
echo "at&f"
echo "at&c"
echo "at&m"
echo "at&w"
echo "~."
} | cu -ml /dev/tty1

}

reset_modem

see how it goes
 
Thanks for the advice - the script now runs but simply echos the command to the screen rather than delivering them to the modem - any advice...
 
forgot to add \r after each echo i.e echo "at&f\r"
basically carriage return
and put a sleep 5 after your last echo

The other thing is post your function or your piece of code
the above has an extra { ( your probably aware of this }

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top