day@grand.UUCP (Dave Yost) (10/23/87)
I tried many tricky things before I finally found a reliable solution.
Perhaps others will find it useful.
--dave yost
=========
#!/bin/sh
# Send settings to MultiTech 224E modem
# Use as a template for how to send settings to the modem of your choice.
# You must edit the 5551212 entries below to store fast-dial phone numbers.
# If you are on system V, you have to change the "stty >" to "stty <"
# Last modified 87.10.23
# Copyright 1987 Dave Yost, Grand Software, Inc.
# Permission granted to all to copy for own use or noncommercial distribution.
# 213-650-1089 {uunet,attmail}!grand!dyost or dyost@grand.COM
# This notice must be retained in any copy.
#
# If you use this software, please send me electronic or postal mail,
# and please introduce yourself to me the next time you see me. Thanks.
case $1 in
"")
echo "Usage: 224e modem-device-name"
exit 2
;;
*)
tty=$1
;;
esac
cat -u < $tty &
pid=$!
stty 300 -echo nl > $tty
sed 's/ *#.*//
s/#.*//
/^$/d' << 'EOF' \
| awk '{ printf ("sleep 2 ; echo -n '"'"'%s\r'"'"'\n", $1) }' \
| sh > $tty
atV1 # V1 result codes as words, like "CONNECT"
atQ0 # Q0 enable result codes
atE1 # E1 Echo command mode characters
atX1 # X0 enable extended result codes, e.g. "CONNECT 2400"
atB1 # B0 Wait for dialtone
at&E1 # &E0 Auto-Reliable mode
at&E3 # &E5 No serial port flow control
at&E8 # &E8 Enq/Ack pacing off
at&E10 # &E10 Normal mode flow control off (questionable)
at&G0 # &G0 CCITT guard tones off
at&T5 # &T5 Disable response to request for digital loopback
at&C1 # &C1 Disable forcing Carrier Detect on
at&R0 # &R0 Disable forcing Clear to Send on
at$BA1 # &BA1 Baud Adjust is on (questionable)
at&A0 # ? The ATL5 status command says this is set to &A0
at&Q0 # &Q0 Not strictly compatible with (dumb) Hayes result codes
at$MB2400 # $MB2400 Try for 2400 baud connections
at$SB2400 # $SB2400 Set default serial port baud rate
ats10=7 # ats10=7 Set Carrier loss disconnect delay time to default
ats11=50 # ats11=70 Faster tone dialing
ats12=255 # ats12=50 Maximum time delay for +++ escape to command mode
#atdt5551212n1
#atdt5551212n2
#atdt5551212n3
#atdt5551212n4
#atdt5551212n5
#atdt5551212n6
#atdt5551212n7
#atdt5551212n8
#atdt5551212n9
at&W0 # - none - saves settings in eerom
EOF
kill $pid
echo '
Switch settings should be:
1 UP DTR not forced on (Factory setting is DOWN)
2 UP
3 DOWN
4 UP
5 UP
6 UP
7 UP
8 DOWN
Done setting the modem
'