Q2686 GPRS problem


Am using Q2686G.
The firmware version is :: R74_00gg.Q2686G
Application OS :: 06.21
Boot loader version :: V08b0e

When trying to connect to GPRS, getting the Cid Info is giving problem.

what am doing is,

  1. waiting for WIND: 7 event

  2. Then doing GPRS setup [with Cid as ‘1’]and handler subscribe, both are returning OK

  3. In handler, am receving
    i. Event::25[ ADL_GPRS_EVENT_SETUP_OK] with Cid::1. Then am doing adl_gprsAct(1).This also returning OK
    ii. then, receiving Event::27[ADL_GPRS_EVENT_ME_ATTACH] with Cid::1, in shell am getting

            +WIND: 15,1,"Airtel",2,"Airtel",3,"+22",4,"11/01/14,07:56:55+22",6,"0"

    iii. then, Event::16[ADL_GPRS_EVENT_ACTIVATE_OK] with Cid::5. In this event receiving, am calling "adl_gprsGetCidInformations(Cid,info); "

  4. adl_gprsGetCidInformations(Cid,info) giving error as , “ADL_RET_ERR_PARAM -ERROR”

Why the Cid is changed to 5[bcoz, they mentioned it is b/w 0-4 only] when the event “ADL_GPRS_EVENT_ACTIVATE_OK” ?

Am i calling adl_gprsGetCidInformations(Cid,info) in correct place?

Please help me with is… Thank you…

Why do you think that is an appropriate event to wait for?
Check the meaning of this event…

In our forum, one of our friend told to wait for event “WIND : 4”[product is ready to process AT commands.]

I did that. But i cant get anything different. Problem remain the same.

“WIND :7” will come, when the n/w service is available for emergency call. I tried that. that time, i got some more lines in shell,
" +WIND: 15,1,“Airtel”,2,“Airtel”,3,“+22”,4,“11/01/14,09:44:48+22”,6,“0” "

Is it wrong? Why the Cid value changed to 5. Its limit is[0-4] only.

Thank you awneil

It’s ready to process AT commands - but it does not have any network service

In this state, only an emergency call is allowed; no other network access is possible - that includes GPRS attach.

Need to wait until unit is registered - either on the “home” network, or Roaming…

Thank you for your replay. I waited for a long time. But after WIND: 7 , also some events related to SMS and calls are only coming. I checked in user guide. Can not find any API to check or to do registration . Kindly help me .

There isn’t one. :angry:
See: New Features - Complete API - #15 by awneil

So you’ll have to make do with AT Commands - just as you did with the +WIND: unsolicited responses…

Thank you awneil. Now, I installed GPRS hadler after the unit is ready to process the AT commands. Then, after the GPRS handler received, the “ADL_GPRS_EVENT_ME_ATTACH”, am calling the GPRS setup function. Now, the Cid is not changing and am getting the DNS1,local ip .

But, when i call “wip_TCPClientCreate” with one IP and port number[In which am already running server], the create is returning OK . But when i try to transmit some data using GPRS using “wip_write” it is giving error as, " WIP_CEV_ERROR" and error number is “-989”. Saying Destination Host is Un-reachable. But that host is up and waiting in that socket.

Is there any way to confirm the GPRS functionality ?

Thank you,

Note that the unit does not necessarily automatically GPRS-Attach.

You are lucky that yours just happens to - but that might stop if you change settings and/or change provider, etc.

I think it is safer to wait for GSM Registration (GSM Attach).

But is it reachable?

ie, is it a “Public” IP address that the module can “see”?

ok sir. I will change the code to wait for GSM attach.

And regarding the client socket, the server is up and it is public IP. I can connect to that sever using another system, using the same SIM card.

I called “wip_netInit” at the beginning itself.I am creating the client socket after i get the “ADL_GPRS_EVENT_ACTIVATE_OK”.

" if( (client = wip_TCPClientCreate( servIpAddr,port,(wip_eventHandler_f)&Handler2, NULL ))==NULL)
adl_atSendResponse ( ADL_AT_UNS,“\n ERROR:wip_TCPClientCreate\n”);
adl_atSendResponse ( ADL_AT_UNS,“\n OK:: wip_TCPClientCreate\n”);
nwrite=wip_write(client, “HAI”, strlen(“HAI”);

}  "

But, in handler am receiving “WIP_CEV_ERROR” with error number:: -989

Thank you,

If you’re using WIP, then you should use the WIP events - in this case, WIP_BEV_IP_CONNECTED.

thank you awneil. With out using GPRS event handler, now i tried.
I called “wip_netInit” at the beginning. Then waiting for event 15 to occur. [till the CPU receive NITZ info from network]. I get,
" +WIND: 15,1,“Airtel”,2,“Airtel”,3,“+22”,4,“11/01/18,07:01:14+22”,6,“0” "

after that i called gprs bearer function which will do, wip_bearerOpen, wip_bearerSetOpts, and wip_bearerStart . but wip_bearerStart get failed with following error,

wip_bearerStart failed:-27 -ERROR WIP_BERR_OK_INPROGRESS .

it is saying “Connection started, an event will be sent after completion” . But am not at all getting the “WIP_BEV_IP_CONNECTED”

Thank you very much,

Not a good idea, I’m afraid.

Not all networks give NITZ at all, and some that do only give it after GPRS attach.
So it’s no better than waiting for GPRS-Attach - but possibly worse!

As I said to you before:

No, that is not a failure at all - that is perfectly normal behaviour!
See: Documentation Unhelpful/Misleading: WIP_BERR_OK_INPROGRESS - #3 by medhat

If you don’t get WIP_BEV_IP_CONNECTED, you should get WIP_BEV_CONN_FAILED

See also: https://forum.sierrawireless.com/t/wip-initializing-a-gprs-bearer-example-is-wrong/4836/1

thank you awneil… now i am trying with new sim card. As you warned me,this is not returning NITZ. Thank you.
so, i am sending “AT+CREG=1” command using adl_atCmdCreate API. After this API’s success, i am calling gprs setup function.

Now am getting WIP_BERR_OK_INPROGRESS and after some time WIP_BEV_CONN_FAILED. Am getting WIP_BOPT_ERROR value as 4. " WIP_BOPT_ERROR::4 " .

But its not negative, and this error code is not listed in document.

Thank you very much …

how can i know the local ip assigned to the unit after connecting to GPRS when using “WIP” . Is there any thing like getCidInfo API.

Thank you,

s8 err;
ascii IpAddr[15];
wip_in_addr_t appIpAddr;
err = wip_bearerGetOpts(bearer,WIP_BOPT_IP_ADDR,&appIpAddr,WIP_BOPT_END);
wip_inet_ntoa(appIpAddr, IpAddr,15);

got it. thank you josep