AT+CIICR responding with OK and Error.

I am trying to connect GPRS GSM A6 module to arduino. AT+CIICR command sometime works fine, but most of the time it respond with OK and +CME ERROR:50 at same time.

Here’s an example:

#include <SoftwareSerial.h>
SoftwareSerial myGsm(7,8);

void setup()
{
myGsm.begin(115200);
Serial.begin(9600);
delay(500);

myGsm.println(“AT+CIPMUX=0”);
delay(2000);
printSerialData();

myGsm.println(“AT+CGATT=1”);
delay(1000);
printSerialData();

myGsm.println(“AT+CSTT=“internet”,”",""");//setting the APN
delay(5000);
printSerialData();

myGsm.println(“AT+CIICR”); //Bring up the wireless connection
delay(5000);
printSerialData();

myGsm.println(“AT+CIFSR”); //init the HTTP request (returns the ip alloated to gsm)
delay(2000);
printSerialData();

myGsm.println(“AT+CIPSTART=“TCP”,“159.203.180.107”,80”);
delay(5000);
printSerialData();

myGsm.println(“AT+CIPSEND”);
delay(2000);
printSerialData();

myGsm.println(“Data Sent from GPRS GSM A6 Using Arduino!!!”);
myGsm.write(0x1A); //0x1A
delay(3000);
}

void printSerialData()
{
while(myGsm.available()!=0)
{
Serial.write(myGsm.read());
}
}

void loop()
{
}

Here is my Serial Response:
AT+CIPMUX=0

OK

AT+CGATT=1

OK

AT+CSRT=“internet”,"",""

OK

AT+CIICR

OK

+CME ERROR:50

AT+CIFSR

+CME ERROR:50

…and all remaining instructions returns error.

So as you can see, AT+CIICR first responds with OK and then it responds with error. Why is that?

Have you looked at the official documentation to see if it sheds any light on what CME ERROR:50 means?

Yes, CMS ERROR: 50 Requested facility not subscribed.
But sometimes it does work fine.

Muzahir:
Yes, CMS ERROR: 50 Requested facility not subscribed.
But sometimes it does work fine.

A CMS error and a CME error are not the same.