Help Me To Initialise GPRS


#1

I am using Wavecom Q2406b module with Open At SDK 3.14.I am using an airtel sim with Gateway IP:202.056.231.117, port 9201,APN: airtelgprs.com.
Please help me from scratch to start my first GPRS session and to ping to a particular IP.


#2

Do you want to this this from first principles, with nothing but standard AT commands?

Or are you using WIPSOFT?

Or are you using the GPRS Service in ADL?

Or are you using the WIP plug-in?

or what :question:


#3

I want to use standard AT-Commands at first and then ADL APis.Please help


#4

For the above settings I have given

AT+CGCLASS=“CG”
OK
AT+CGDCONT=1,“IP”,“airtelgprs.com
OK
AT+CGATT=1
OK
AT+CGACT=1,1
OK
ATD99**1#
CONNECT 4800
~ }#À!}!}!} }6}!}$}%Ãœ}"}&} } } } }’}"}(}"}#}$À#&´~~ }#À!}!}!} }6}!}$}%Ãœ}"}&} } }
} }’}"}(}"}#}$À#&´~~ }#À!}!}!} }6}!}$}%Ãœ}"}&} } } } }’}"}(}"}#}$À#&´~~ }#À!}!}!
} }6}!}$}%Ãœ}"}&} } } } }’}"}(}"}#}$À#&´~~ }#À!}!}!} }6}!}$}%Ãœ}"}&} } } } }’}"}(}
“}#}$À#&´~~ }#À!}!}!} }6}!}$}%Ãœ}”}&} } } } }’}"}(}"}#}$À#&´~~ }#À!}!}!} }6}!}$}%
Ãœ}"}&} } } } }’}"}(}"}#}$À#&´~~ }#À!}!}!} }6}!}$}%Ãœ}"}&} } } } }’}"}(}"}#}$À#&´~
~ }#À!}!}!} }6}!}$}%Ãœ}"}&} } } } }’}"}(}"}#}$À#&´~~ }#À!}!}!} }6}!}$}%Ãœ}"}&} } }
} }’}"}(}"}#}$À#&´~
NO CARRIER

After this the module hangs.
I cannot find any AT command to specify the Gateway IP,PORT and DNS.
I am really in a fix.Please help me.


#5

That’s PPP data - you are now connected, so your application needs to start doing the PPP authentication and stuff, …

Because that’s beyond the scope of AT Commands - your external application needs to do that.

Remember that GPRS is a Packet network…!

Or, you need to have WIPSoft to do it for you

Or, use the WIP Plug-In in your Open-AT embedded application


#6

I have given AT+CGDCONT=1,“IP”,“airtelgprs.com
So how PPP is established? and if the connection is established then why it is giving NO CARRIER at the end and the module stops responding to the hyperterminal?
Where can I find the WIP plugins?
Please help.
And it is also not clear to me that without giving the Gateway IP and port how the connection is established.
Please help me to solve the problem.


#7

That specifies your APN, and says that you’re going to use IP

Much the same as when you dial your ISP on a landline;
the modems connect, then PPP (or SLIP) starts.

Because you don’t respond with the appropriate PPP stuff, so the far end eventually gives up - and drops the “call”.

They should be in your Open-AT SDK - if not, ask your distributor.


#8

en.wikipedia.org/wiki/Point-to-Point_Protocol

cisco.com/univercd/cc/td/doc … oc/ppp.htm


#9

Thanks Awneil.
How can I give the PPP stuff response with AT-COMMANDS?


#10

You can’t.

As I said before,


#11

Any kind of AT Wip commands are not working and is responding ERROR.
for example

AT+WIPCFG=1
ERROR

AT+WIPBR=1,6
ERROR

how can I enable WIP commands in my wismo Q2406b?
Please help.


#12

I think you need to order them specifically from your distributor.


#13

Now I am using the WIP Plugins to start the GPRS session. My code is as follows

#include "adl_global.h"
#include "wip.h"


#define SERVER_PORT 9201   //  TCP Port number
#define SERVER_ADD "202.056.231.117"  // TCP server address

u32 wm_apmCustomStack [ 256 ];
const u16 wm_apmCustomStackSize = sizeof ( wm_apmCustomStack );

enum state
{
	JUST_OPEN
};
int c;
/**************************************************************************/
void evHandler( wip_event_t *ev, enum state *ctx);
static enum state state = JUST_OPEN;
void Timerhdl1( u8 ID);
/***************************************************************************/
/*  Local variables                                                        */
/***************************************************************************/
/* bearer events handler: when the bearer connection is completed,
 * start IP services (used both in PPP and GPRS modes). */
void evh_bearer( wip_bearer_t b, s8 event, void *ctx)
{
	switch (event)
	{
	case WIP_BEV_IP_CONNECTED:
		wip_TCPClientCreate( SERVER_ADD,SERVER_PORT, (wip_eventHandler_f) evHandler, &state);
		adl_atSendResponse ( ADL_AT_RSP, "/r/n IP connected /r/n");
		
		break;
    case WIP_BEV_IP_DISCONNECTED:
		 adl_atSendResponse ( ADL_AT_RSP, "/r/n IP Disconnected /r/n");
		break;

	}
    
}
void evHandler( wip_event_t *ev, enum state *ctx)
{
	wip_channel_t c = ev->channel;
	ascii Buffer[50]="abcdefghijklmnopqrstuvwxyz";
	switch (ev->kind)
	{
	case WIP_CEV_DONE:
		break;
	case WIP_CEV_ERROR:
		break;
	case WIP_CEV_OPEN:
		break;
	case WIP_CEV_PEER_CLOSE:
		break;
	case WIP_CEV_PING:
		break;
	case WIP_CEV_READ:
		break;
	case WIP_CEV_WRITE:
			wip_write( c, Buffer, strlen(Buffer));
			//wip_close((wip_channel_t) c);
			break;
	default:
		break;
	}
}
/***************************************************************************/
/*  SIM Handler                                                            */
/***************************************************************************/
static void evh_sim( u8 event)
 {
  int r;
  wip_bearer_t b;
  adl_atSendResponse ( ADL_AT_RSP, "/r/n SIM Handler /r/n");
  if( ADL_SIM_EVENT_FULL_INIT != event) return;
  // Subscribing for GPRS
  r = wip_bearerOpen( &b, "GPRS", evh_bearer, NULL);
  // Setting APN Server 
  r = wip_bearerSetOpts( b, WIP_BOPT_GPRS_APN, "airtelgprs.com",  //Enter your APN server address
                         WIP_BOPT_LOGIN,       "",
                         WIP_BOPT_PASSWORD,    "",
                         WIP_BOPT_END);
  adl_atSendResponse ( ADL_AT_RSP, "/r/n APN Parameters Set/r/n");
  r = wip_bearerStart( b);
}


/***************************************************************************/
/*  Function   : adl_main                                                  */
/*-------------------------------------------------------------------------*/
/*  Object     : Customer application initialisation                       */
/*                                                                         */
/*-------------------------------------------------------------------------*/
/*  Variable Name     |IN |OUT|GLB|  Utilisation                           */
/*--------------------+---+---+---+----------------------------------------*/
/*  InitType          |   |   |   |  Application start mode reason         */
/*--------------------+---+---+---+----------------------------------------*/
/***************************************************************************/
void adl_main ( adl_InitType_e InitType )
{
	int r;
    TRACE (( 1, "Embedded Application : Main" ));
	adl_atSendResponse ( ADL_AT_RSP, "/r/n TCP IP Program /r/n");
	// Opening GPRS Connection
	r = wip_netInit();
	// SIM Subscribe
    adl_simSubscribe( evh_sim, NULL);
}

And I can see IP CONNECTED.
Now I want to ping to a particular IP address. How can I do that. And I want to give the ping reasult as unsolicited response to the hyperterm.
Please Help.


#14

Look at the WIP Samples included with your SDK…

There is also a PING sample in the ADL samples folder…


#15

Now I have added the following code to my previous code

void evh_bearer( wip_bearer_t b, s8 event, void *ctx)
{wip_in_addr_t ipv4l,ipv4d,dns1,dns2;
 char localip[30],destip[30],dns1b[30],dns2b[30];
	switch (event)
	{
	case WIP_BEV_IP_CONNECTED:
		wip_TCPClientCreate( SERVER_ADD,SERVER_PORT, (wip_eventHandler_f) evHandler, &state);
		adl_atSendResponse ( ADL_AT_RSP, "\r\n IP connected \r\n");
		//wip_pingCreate( "203.212.180.190",(wip_eventHandler_f) evHandler,&state);
		//adl_gprsGetCidInformations (1,gprs);
		wip_bearerGetOpts( b, WIP_BOPT_IP_ADDR,ipv4l,WIP_BOPT_IP_DST_ADDR,ipv4d,WIP_BOPT_IP_DNS1,dns1,WIP_BOPT_IP_DNS2,dns2,WIP_BOPT_END);
		adl_atSendResponse ( ADL_AT_RSP, "\r\nLocal IP= ");
		wip_inet_ntoa(ipv4l,localip,28);
		adl_atSendResponse ( ADL_AT_RSP, localip);
		adl_atSendResponse ( ADL_AT_RSP, "\r\nDestination IP= ");
		wip_inet_ntoa(ipv4d,destip,28);
		adl_atSendResponse ( ADL_AT_RSP, destip);
		adl_atSendResponse ( ADL_AT_RSP, "\r\nDNS1=  ");
		wip_inet_ntoa(dns1,dns1b,28);
		adl_atSendResponse ( ADL_AT_RSP, dns1b);
		adl_atSendResponse ( ADL_AT_RSP, "\r\nDNS2= ");
		wip_inet_ntoa(dns2,dns2b,28);
		adl_atSendResponse ( ADL_AT_RSP, dns2b);
		
		break;
    case WIP_BEV_IP_DISCONNECTED:
		 adl_atSendResponse ( ADL_AT_RSP, "\r\n IP Disconnected \r\n");
		break;

	}
    
}

and the reasult what I can see in Hyperterminal is

IP connected

Local IP= 206.19.6.1
Destination IP= 176.19.6.1
DNS1= 146.19.6.1

But the destination IP what I have givven is different and the DNS what I have given is blank. So what is this destination IP and DNS1 value displaying?

Next, I want to send data packets to a remote system with IP 192.168.1.93 and gateway address 192.168.1.99. What should I do.
Please help me with step by step information.
Thank You.


#16

You can’t!

Those are private IP addresses - see:

wavecom.com/modules/movie/sc … ht=192+168

wavecom.com/modules/movie/sc … ht=192+168


#17

Now, I have a LAN network and the IP of my PC is 192.168.1.93 and gateway IP is 192.168.1.99 which is connected to the internet.
Now I got another IP, say 74.125.x.x in a different domain as you can see.Now what is the general procedure to send dat from the first IP to the second IP.
My main problem is that, I have connected my wavecom module to an airtel GPRS network and after registering I got a dynamic IP. now I want to send data from this dynamic IP(which I know) to the IP 192.168.1.93(which I also know).
Please help me step by step as I am a newbie in IP networking.


#18

These are both IP addresses on the LAN - neither of them is visible outside the LAN on the internet.

Your “gateway” will have an IP address that is visible on the internet.
If you don’t know what it is, you can find out with a site like whatsmyip.net

You will need to configure Port Forwarding on your “gateway” - so that it forwards packets received from the internet on a specific port to a specific private IP address within the LAN.
You will have to read the manuals for your “gateway” for this.

Also, read about Network Address Translation (NAT) in the links already provided.

And study the following tutorial:
compnetworking.about.com/od/tcpi … tation.htm

No, that’s not a problem - so long as you are connecting from the module to your PC…


#19

Thanks Awneil for your help.
Now please tell me one thing that if I connect the server end and the client end program to the internet in two different domains(say one in Airtel Domain and the other in the Vodafone domain) by two different dialup connections, then can I establish a connection between them by the two different dynamic IPs(which I will know)?
Please Help.


#20

You’re missing the point again - go back and review the earlier posts!

Whether they’re dynamic or not is irrelevant - it’s whether they’re Public or not that matters!