thanks GSM Man, I've experienced the variability in different commands to reply! i should have mentioned that to find failures, i use delays, run the system(mcu and module), and
simultaneously monitor Rx and Tx lines by PC(hyper terminal).
concerning SIM508 datasheet(my GSM module), the order of connection states is as below:
0 IP INITIAL
1 IP START
2 IP CONFIG
3 IP IND
4 IP GPRSACT
5
IP STATUS
6 TCP/UDP CONNECTING
7
CONNECT OK
8 IP CLOSE
So, i think that it's enough to check IP status only twice:
1- after calling "AT+CIFSR" command, to check if "IP STATUS" is returned;
2- after calling "AT+CIPSTART", to check if "CONNECT OK" is received.
and you see that i did it by calling "AT+CIPSTATUS" in both situations. what i am getting through hyper terminal,is this:
SHUT OK //
CIPSHUT
OK //
AT+CGATT=1
OK //
AT+CGDCONT=1
OK //
AT+CSTT=...
+PDP: DEACT
OK //
AT+CIICR
10.6.112.130 //
AT+CIFSR
OK //
AT+CIPSTATUS
STATE: IP STATUS:smile:
OK //
AT+CIPHEAD=1
OK //
AT+CDNSORIP=0
OK //
AT+CIPSTART=...
OK //
AT+CIPSTATUS
STATE: TCP CONNECTING:?
as you see, spite of getting "IP STATUS", the connection can't be established and i get "TCP CONNECTING" after calling "AT+CIPSTART".
i got really confused!
what should i do more to receive "CONNECT OK" after receiving "IP STATUS"??? any commands? is 15 seconds few?!(I've tested it by 30 seconds too but not connected again)