Q2686 GPRS problem


#1

Hai,

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…


#2

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


#3

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


#4

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…


#5

Sir,
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 .


#6

There isn’t one. :angry:
See: https://forum.sierrawireless.com/t/new-features-complete-api/3305/15

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


#7

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,


#8

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”?


#9

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");
else
{
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,


#10

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


#11

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,


#12

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: https://forum.sierrawireless.com/t/documentation-unhelpful-misleading-wip-berr-ok-inprogress/3706/3

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


#13

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


#14

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 …


#15

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,


#16
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);

#17

got it. thank you josep