WHEN THE SCRIPT AND PPP WORKS:
CHAT: sending ‘ATZ’
CHAT: expecting ‘ok’
CHAT: found it!
CHAT: sending ‘AT+CGDCONT=1,“IP”,“ibox.tim.it”,0,0’
CHAT: expecting ‘ok’
CHAT: found it!
CHAT: sending ‘ATD99**1#’
CHAT: expecting ‘CONNECT’
CHAT: found it!
CHAT: not sending anything
CHAT: expecting ‘~’
CHAT: found it!
CHAT: end of script
AttivaPPP: Indirizzo IP: 217.202.9.18 in 11 s
WHEN DOES’NT:
CHAT: sending ‘ATZ’
CHAT: expecting ‘ok’
CHAT: found it!
CHAT: sending ‘AT+CGDCONT=1,“IP”,“ibox.tim.it”,0,0’
CHAT: expecting ‘ok’
CHAT: found it!
CHAT: sending ‘ATD991#’
CHAT: expecting ‘CONNECT’
CHAT: found it!
CHAT: not sending anything
CHAT: expecting ‘~’
CHAT: found it!
CHAT: end of script
CHAT: sending ‘ATZ’
CHAT: expecting ‘ok’
CHAT: found it!
CHAT: sending ‘AT+CGDCONT=1,“IP”,“ibox.tim.it”,0,0’
CHAT: expecting ‘ok’
CHAT: found it!
CHAT: sending 'ATD991#’
CHAT: expecting ‘CONNECT’
CHAT: timed out
CHAT: sending ‘ATH0’
CHAT: expecting ‘ok’
CHAT: found it!
CHAT: end of script
CHAT: sending ‘ATZ’
CHAT: expecting ‘ok’
CHAT: found it!
CHAT: sending ‘AT+CGDCONT=1,“IP”,“ibox.tim.it”,0,0’
CHAT: expecting ‘ok’
CHAT: found it!
CHAT: sending 'ATD99**1#’
CHAT: expecting ‘CONNECT’
CHAT: found it!
CHAT: not sending anything
CHAT: expecting ‘~’
CHAT: found it!
CHAT: end of script
AttivaPPP: errore di connessione
wHE CAN FIND THE CHAT END BUT DOES’NT STARTS THE LCP AND IP HANDSHAKE.
I use these commands:
for(count = 0; count < 3; count++)
{
#ifdef CONNMSG
printf( "AttivaPPP: tentativo n. %d
", count+1);
#endif
//configure PPP for dialing in to ISP and bring it up
ifconfig(IF_DEFAULT, IFS_PPP_INIT, IFS_END);
ifconfig(IF_DEFAULT,
IFS_PPP_SPEED, VELMODEM,
IFS_PPP_USEMODEM, 1,
IFS_PPP_RTSPIN, PBDR, NULL, 7, // Note: the NULL is for the shadow register. From DC9.0,
// this is computed automatically - the value passed here
// for the shadow register is ignored.
IFS_PPP_CTSPIN, PBDR, 0,
IFS_PPP_FLOWCONTROL, 0,
IFS_PPP_SENDEXPECT, DIALUP_SENDEXPECT,
#ifdef GPRSEN
IFS_PPP_HANGUP, “ATH0 #ok”,
#else
IFS_PPP_HANGUP, “ATH #ok”,
#endif
IFS_PPP_MODEMESCAPE, 1,
IFS_PPP_ACCEPTIP, 1,
IFS_PPP_ACCEPTDNS, 1,
IFS_PPP_REMOTEAUTH, DIALUP_NAME, DIALUP_PASSWORD,
IFS_UP,
IFS_END);
while(ifpending(IF_DEFAULT) & 1) {
tcp_tick(NULL);
}
if (ifstatus(IF_DEFAULT)) break;
}