how can control answer of modem?
i must do a little script that send AT command at ttyUSB3 on
my iMX53 and control his answers for example:
- Set serial port ttyUSB3 115200 8N1
- if ttyUSB3 not exist print "MODEM NOT CONNECTED":
if ! [ -e /dev/ttyUSB3 ]; then
echo 'MODEM NOT CONNECTED'
exit 0
fi
send AT -> the answer must be OK
else print "ERROR AT number 1" and resend AT and if
response is still different from OK then Print "ERROR AT
number 2" and exit from script.
If response precedent is OK then do the same thing for
'AT!PADSETUP=1,2,82.91.28.127,0,9940,0,1' --> the answer
must be ok and else resend command and etc...
If response precedent is OK then do the same thing for
'AT!PADCONN=1' --> the answer must be ok and else resend
command and etc...
If is ALL OK print "MODEM CONNECT TO SOCKET"
I saw on the network many script but i have problem with use
of stty /dev/ttyUSB3 115200 because i have this error: stty:
/dev/ttyUSB3:
unable to perform all requested operations
I' ve doing a little script but i not have control of his answers:
#! /bin/sh
cat /dev/ttyUSB3 /home/giuseppe/Scrivania/imsi.txt &
sleep 1
# stty ispeed 115200 ospeed 115200 -echo not work!
# echo AT > /dev/ttyUSB3 not work!
chat -V -s '' 'AT+creg?' '' > /dev/ttyUSB3 < /dev/ttyUSB3
sleep 2
chat -V -s '' 'AT' '' > /dev/ttyUSB3 < /dev/ttyUSB3
sleep 2
chat -V -s '' 'AT!PADSETUP=1,2,82.91.28.127,0,9940,0,1' '' >
/dev/
ttyUSB3 < /dev/ttyUSB3
sleep 2
chat -V -s '' 'AT+CGDCONT=1,"IP","web.omnitel.it"' '' >
/dev/ttyUSB3
< /dev/ttyUSB3
sleep 2
chat -V -s '' 'AT!PADCONN=1' '' > /dev/ttyUSB3 <
/dev/ttyUSB3
sleep 10
killall cat
exit 0
In short i need controll his answers
I hope that you help me...
THANKS for help!!