Problems by reconnect to GPRS


#1

Hi,

I’ve written an application which is sending a file to a FTP-server every three minutes. If the application receives an incoming call, it stops the GPRS-Connection with ‘ed_DialupConnectionStop(DialupCallback);’. After the Function ‘DialupCallback()’ is called with the response code ‘ED_OK_ON_HOOK’, the incoming call will be answered. When the call has ended, the application restarts the GPRS connection with ‘ed_DialupConnectionStart(DialupCallback)’ two seconds later. Normally this works fine, but sometimes the function DialupCallback() isn’t called with the response code ‘ED_OK_GPRS_SESSION_SET’ after the GPRS handler got the event ‘ADL_GPRS_EVENT_SETUP_OK’. So the next FTP transfers failed.

How can I solve this problem without reseting my application? I’m using a Q2406B with Firmware v6.55 and OpenAT 3.10

Regards, Ralf Ebert


#2

Hi Ralf,

Did you try to shutdown the GPRS with AT+CGATT=0?
Best Regards,

gdt


#3

Hi gdt,

Yes — and after theGPRS handler got the event ‘ADL_GPRS_EVENT_ME_DETACH’ I sent a new ‘AT+CGATT=1’. But this don’t work :frowning:

Regards,

Ralf


#4

ADL_GPRS_EVENT_ME_DETACH response is normal, you must retry AT+CGATT=1 every 2 seconds e.g. until response is OK and it will works. I use that to reboot the gprs ans it works perfectly.

Best regards,

gdt

From the wavecom samples :

void SetupHandler(u8 ID)
{
   TRACE( ( 2, "Inside SetupHandler" ) );
   adl_atCmdCreate("AT+CGATT=1",FALSE,AttRspHandler,"*",NULL);
}

bool AttRspHandler(adl_atResponse_t *params)
{
  
	
	TRACE( ( 2, "Inside AttRspHandler" ) );
   //if an OK is received as response to AT+CGATT=1 command then set GPRS settings.
   if( !wm_strncmp( params->StrData, "\r\nOK", 4 ) )
   {
      //Ready
      TRACE( ( 2, "Received OK" ) );
         adl_tmrSubscribe(FALSE,20,ADL_TMR_TYPE_100MS,GPRSWait);//Give modem time to process CGATT=1   


   }
   //if an OK is not received then create AT+CGATT=1 again.
   else
   {
      adl_atCmdCreate( "AT+CGATT=1", FALSE, AttRspHandler, "*", NULL );
   }
   return FALSE;
}

#5

Which sample do you mean? I took a look to the samples which are shipped with OpenAT v3.10 but I found no sample which contains a function called GPRSwait. Which task does this function perform?

Regards,
Ralf


#6

Hi again,

meanwhile I found the mentioned example. Thank you for your suggestion, I’ll follow it.

Regards
Ralf


#7

Maybe I didn’t understand something right…

Do you actually need to shutdown GPRS? I thought you may do voice calls while still attached? I thought GPRS data transfer just gets suspended… Haven’t tried it yet… Is that not so?

Best Regards,
Jan


#8

Normally not. But I need a workaround if the reconnection started with ‘ed_DialupConnectionStart(DialupCallback)’ fails. And it seems that a detach/attach cycle is better than a restart of the whole application. If there is an other way to reestablish the GPRS-connection so let me know.

Best regards,
Ralf


#9

Thanks, Ralf!

Looks like I will also need to implement that workaround once we finally get to use GPRS… Restarting the application is not a good option…

Best Regards,
Jan


#10

Hi Ralf & Jan,

I found that in the OpenAT 4.0 sample for the Q2686.
These functions try to reattach GPRS every 2 seconds until it succeeded.
You can ask the full sample to your distributor. I think the name of the sample is pingGPRS.

Best regards,

gdt


#11

Jan,

I did an application that sends infos to a TCP server every 30 secounds.

When I receive a call, I just answer to it (like you said the GPRS get suspended). When I hangup, the GPRS connection restart with no problem.

I do not lose the GPRS and even the TCP socket !!!

Rgds,
Gus


#12

Hi Gus,

That is pretty cool! That’s exactly how I thought it should work!!

Which module / OpenAT version are you using?

Thanks for your information!!

Best Regards,
Jan


#13

Jan,

I am using Q2501/Open At 3.10 !!! :stuck_out_tongue:

Rgds,
Gus