AT+CGATT=1 and "CME ERROR: 536"



I made an application that creates a TCP socket via GPRS network to exchange date every 15 minutes.

The pseudo code is:

  1. Make sure that the network is attached AT+CGATT=1
  2. Get the status AT+CREG
  3. Use WIP library to create the TCP socket

SOMETIMES the AT+CGATT=1 locks the class GPRS and does NOT give an answer (so each next GPRS commands will return “+CME ERROR: 536” (class locked).

  • Does somebody have the same problem ?
  • Do I need to issue the AT+CGATT? command before (even if the doc says that I don’t need to do it…) ? I will make the test…
  • Does the OS manage the command timeout ?
  • Is there a command to abort the AT+CGATT=1 command ?
s8 l_Result = adl_atCmdCreate ( p_"AT+CGATT=1", FALSE, CGATT_Handler, "*", NULL );
if (l_Result != OK)
// When my problem occurs this function returns OK and all the next GPRS commands return OK ! To see the +CME ERROR: 536 I need to enter a GPRS command in the terminal....

static bool CGATT_Handler(adl_atResponse_t *p_kParam)
// When my problem occurs this handler is never called !!

Thanks !



Sometines the AT+CGATT=1 alsoe give a “CME ERROR: 148” (unspecified GPRS error) that locks the GPRS class and I can not stop the board with a AT+CPOF=1 command !

What can I do to solve this problem ? or what i’m doing wrong ??

Any ideas ?

Please help me…