HTTP Server over PPP GPRS link

I’ve written a simple progrm to test a RCM3600 based board connected to internet using Siemens MC35i GPRS Modem and Vodafone Italy as ISP

The PPP connection seems to start correctly but i’m not able to connect to HTTP server over internet.

The LOG of the program is:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++

MODEM - Start Configuration

MODEM - ATV1

MODEM - ATE0

MODEM - AT+CGDCONT=1,“IP”,“web.omnitel.it”,“0.0.0.0”

MODEM - AT+CGATT=1

MODEM - AT+CGREG=0,1

PPP - Start Connection

PPPLINK: baud rate 115200: setting divisor to 5
PPPLINK: bringing up serial PPP interface 0
PPPLINK: baud rate 115200: setting divisor to 5
PPPLINK: Opened PPP serial on iface 0 at 115200 baud
CHAT: sending ‘ATDT99**1#’
PPPLINK: starting modem escape sequence
PPPLINK: sendpacket totlen=1 i/f 0
PPPLINK: sendpacket totlen=1 i/f 0
PPPLINK: sendpacket totlen=1 i/f 0
CHAT: expecting ‘CONNECT’
PPPLINK: sendpacket totlen=14 i/f 0
CHAT: found it!
CHAT: end of script
PPP: sending LCP config req i/f 0
PPPLINK: sendpacket totlen=24 i/f 0
PPP: got packet A7D0 on i/f:0 protocol:0xc021
PPP: LCP NAK on i/f 0
PPP: sending LCP config req i/f 0
PPPLINK: sendpacket totlen=24 i/f 0
PPP: got packet A7D0 on i/f:0 protocol:0xc021
PPP: received LCP ACK i/f 0. local_acked = 1
PPP: got packet A7D0 on i/f:0 protocol:0xc021
PPP: LCP config request i/f 0
PPP: accepting option 2
PPP: accepting option 7
PPP: accepting option 8
PPP: accepting option 5
PPP: NAKing option 3
PPP: sending LCP nak i/f 0
PPPLINK: sendpacket totlen=13 i/f 0
PPP: got packet A7D0 on i/f:0 protocol:0xc021
PPP: LCP config request i/f 0
PPP: accepting option 2
PPP: accepting option 7
PPP: accepting option 8
PPP: accepting option 5
PPP: accepting option 3
PPP: sending LCP ack i/f 0
PPPLINK: sendpacket totlen=28 i/f 0
PPP: sending our credentials /
PPP: sending PAP auth i/f 0
PPPLINK: sendpacket totlen=10 i/f 0
PPP: got packet A7D0 on i/f:0 protocol:0xc023
PPP: sending IPCP config i/f 0
PPPLINK: sendpacket totlen=26 i/f 0
PPP: got packet A7D0 on i/f:0 protocol:0x8021
PPP: IPCP config request i/f 0
IPCP: peer wants IP addr C0A8FEFE
PPP: accepting option 3
PPP: sending IPCP ack i/f 0
PPPLINK: sendpacket totlen=14 i/f 0
PPP: sending IPCP config i/f 0
PPPLINK: sendpacket totlen=26 i/f 0
PPP: got packet A7D0 on i/f:0 protocol:0x8021
PPP: IPCP NAK on i/f 0
PPP: sending IPCP config i/f 0
PPPLINK: sendpacket totlen=26 i/f 0
PPP: got packet A7D0 on i/f:0 protocol:0x8021
PPP: i/f 0 UP

PPP - Connection Established - IP Address = 91.80.89.19

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++

When i try to connect to http://91.80.89.19, i’ve no answer.

Can someone help me ???

In the following the program list.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#define PPP_VERBOSE
#define PPP_DEBUG
#define PPPLINK_VERBOSE
#define PPPLINK_DEBUG
#define CHAT_VERBOSE
#define CHAT_DEBUG

#define HTTP_VERBOSE
#define HTTP_DEBUG

// Serial Port Setting
#define USE_PPP_SERIAL 0x04
#define BAUD_RATE 115200L

// TCP/IP Setting
#define TCPCONFIG 0

#define TIMEZONE +2
#define LCP_TIMEOUT 5000

// GPRS Setting
#define APN “web.omnitel.it”
#define DIALUP_NAME “”
#define DIALUP_PASSWORD “”
#define DIALUP_SENDEXPECT “ATDT99**1# #CONNECT
#define DIALUP_HANGUP “ATH #OK

//-----------------------------------------------------------------

#memmap xmem

#use “eDAS_SP.lib”
#use “eDAS_I2C.lib”
#use “eDAS_SPI.lib”
#use “eDAS.lib”

#use “dcrtcp.lib”
#use “http.lib”

//-----------------------------------------------------------------

#ximport “index.html” index_html

const HttpType http_types[] = {
{ “.html”, “text/html”, NULL},
{ “.gif”, “image/gif”, NULL}
};

const HttpSpec http_flashspec[] = {
{ HTTPSPEC_FILE, “/”, index_html, NULL, 0, NULL, NULL},
{ HTTPSPEC_FILE, “/index.html”, index_html, NULL, 0, NULL, NULL},
};
//-----------------------------------------------------------------
int main() {

int Result, Counter, Length;
char Buffer[256];

BoardInit();

LedBlink(0);
LedOff(1);

BitWrPortI(PEDR,&PEDRShadow, 1, 1);

//--------------------------------------------------------------

printf("

MODEM - Start Configuration

");

serCopen(BAUD_RATE);

sprintf(Buffer, "ATV1\r");
serCwrite(Buffer, strlen(Buffer));

Counter = 0;
while(1) {
  		while ((Result = serCgetc()) != -1) Buffer[Counter++] = (char)Result;
  		Buffer[Counter] = 0;
  		if (strstr(Buffer, "OK")) {
      		printf("

MODEM - ATV1

");
break;
}
}

sprintf(Buffer, "ATE0\r");
serCwrite(Buffer, strlen(Buffer));

Counter = 0;
while(1) {
  		while ((Result = serCgetc()) != -1) Buffer[Counter++] = (char)Result;
  		Buffer[Counter] = 0;
  		if (strstr(Buffer, "OK")) {
      		printf("

MODEM - ATE0

");
break;
}
}

sprintf(Buffer, "AT+CGDCONT=1,\"IP\",\"%s\",\"0.0.0.0\"\r", APN);
serCwrite(Buffer, strlen(Buffer));

Counter = 0;
while(1) {
  		while ((Result = serCgetc()) != -1) Buffer[Counter++] = (char)Result;
  		Buffer[Counter] = 0;
  		if (strstr(Buffer, "OK")) {
      		printf("

MODEM - AT+CGDCONT=1,"IP","%s","0.0.0.0"

", APN);
break;
}
}

sprintf(Buffer, "AT+CGATT=1\r");
serCwrite(Buffer, strlen(Buffer));

Counter = 0;
while(1) {
  		while ((Result = serCgetc()) != -1) Buffer[Counter++] = (char)Result;
  		Buffer[Counter] = 0;
  		if (strstr(Buffer, "OK")) {
      		printf("

MODEM - AT+CGATT=1

");
break;
}
}

sprintf(Buffer, "AT+CGREG?\r");
serCwrite(Buffer, strlen(Buffer));

Counter = 0;
while(1) {
  		while ((Result = serCgetc()) != -1) Buffer[Counter++] = (char)Result;
  		Buffer[Counter] = 0;
  		if (strstr(Buffer, "OK")) {
      		if (strstr(Buffer,"0,1")) {
	      		printf("

MODEM - AT+CGREG=0,1

“);
break;
}
else if (strstr(Buffer,“0,5”)) {
printf(”
MODEM - AT+CGREG=0,5

");
break;
}
}
}

//--------------------------------------------------------------

printf("

PPP - Start Connection

");

sock_init();

ifconfig(IF_PPP2,
         IFS_PPP_INIT,
             IFS_PPP_SPEED, BAUD_RATE,
             IFS_PPP_FLOWCONTROL, 0,
             IFS_PPP_SENDEXPECT, DIALUP_SENDEXPECT,
             IFS_PPP_HANGUP, DIALUP_HANGUP,
             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_PPP2) & 0x1) tcp_tick(NULL);

//--------------------------------------------------------------

if (ifstatus(IF_PPP2)) {

  		printf("

PPP - Connection Established - IP Address = %s

", inet_ntoa(Buffer, gethostid()));

	LedBlink(1);

  		http_init();
  		tcp_reserveport(80);

	while(1) {

 	   		if (ifstatus(IF_PPP2)) http_handler();
     		else break;

     		if (getchar() == 'x') break;
  		}

	//------------------------------------------------------

	printf("

PPP - Stop Connection

");

	LedOff(1);

	ifconfig(IF_PPP2, IFS_DOWN, IFS_END);
   	while(ifstatus(IF_PPP2)) tcp_tick(NULL);

	printf("

PPP - Connection Closed

");

	BitWrPortI(PEDR,&PEDRShadow, 0, 1);

  		return(0);

}

//--------------------------------------------------------------

else {
  	LedOn(1);

	ifconfig(IF_PPP2, IFS_DOWN, IFS_END);
   	while(ifstatus(IF_PPP2)) tcp_tick(NULL);

	printf("

PPP - ERROR - Connection Failed

");

	BitWrPortI(PEDR,&PEDRShadow, 0, 1);

  		return(-1);

}

//--------------------------------------------------------------

}

hey i am also geting same problem .i was able to connect the ftp after the ppp connection and send the data .but i am not able to connect the http if u got the ans pls tell me how to resolve the problem