I am working with a team to send data from Raspberry Pi over 2G network to a server using a GSM module called “SIM800L EBV”. We encountered an AT+CIPSEND error that has only occurred in Zambia, Africa while having been working correctly in the US (Arkansas, Colorado, and Washington state) for two years. Below is a picture of our SIM log. We noticed from our log that the AT+CIFSR to request an IP address is working. And when AT+CIPSTART is run to start the TCP connection to the server “obfuscated.org” at port 11002, the response is OK and CONNECT OK indicating that the TCP connection to the server has been established. However, when AT+CIPSEND is run, we received an “+CME ERROR: operation not allowed”. Has anyone encountered this problem before? Does anyone know about any supporting information that might help solve the problem? Is there any suggestion on how to get around this CME error? Is there any other command to replace this AT+CIPSEND command? Why does it work fine in America but not in Zambia? Many thanks!

Wrote to sim: AT+CIFSR

Bytes to read: 26
Sim response: AT+CIFSR
172.50.216.113

Wrote to sim: AT+CIPSTART="TCP","redacted.org","11002"

Bytes to read: 58
Sim response: AT+CIPSTART="TCP","redacted.org","11002"
OK

CONNECT OK

Wrote to sim: AT+CIPSEND

Bytes to read: 47
SIM response: AT+CIPSEND
+CME ERROR: operation not allowed
1

There are 1 best solutions below

0
On

This code here works for me. Am using the same exact SIM800L EVB module which seemed not to work on most codes, TinyGSM and other MQTT requests. If found any solutions please share.

#include <SoftwareSerial.h>
#include <ArduinoJson.h>

SoftwareSerial SIM900(17, 16); 
 
 
void setup()
{
  SIM900.begin(9600);       // the GPRS baud rate
  Serial.begin(9600);
  Serial.println("Initializing..");
    
work();
}
 
void loop()
{}

 void work()
{ 
  Serial.println("START");
 
  delay(1000);
 
  if (SIM900.available())
  Serial.write(SIM900.read());
 
  SIM900.println("AT");
  delay(3000);
 
  SIM900.println("AT+SAPBR=3,1,\"Contype\",\"GPRS\""); // untuk cek  GPRS 
  delay(6000);
  ShowSerialData();
 
  SIM900.println("AT+SAPBR=3,1,\"APN\",\"internet\"");//APN mobile phone (cek dekat phone)
  delay(6000);
  ShowSerialData();
 
  SIM900.println("AT+SAPBR=1,1"); 
  delay(6000);
  ShowSerialData();
 
  SIM900.println("AT+SAPBR=2,1");
  delay(6000);
  ShowSerialData();
 
  SIM900.println("AT+HTTPINIT"); // jika keluar error means gagal
  delay(6000);
  ShowSerialData();
 
  SIM900.println("AT+HTTPPARA=\"CID\",1"); //parameters untuk HTTP session
  delay(6000);
  ShowSerialData(); 


  SIM900.println("AT+HTTPPARA=\"URL\",\"http://......./api/v1/testwritter?data=+1234\""); //Server address // tukar pakai lain https://
  delay(4000);
  ShowSerialData();

//  SIM900.println("AT+HTTPPARA=\"REDIR\",1"); 
//  delay(4000);
//  ShowSerialData();
 
  SIM900.println("AT+HTTPPARA=\"CONTENT\",\"application/json\""); //json format
  delay(4000);
  ShowSerialData();


//  SIM900.println("AT+HTTPDATA=" + String(sendtoserver.length()) + ",100000"); // size bytes untuk hantar data dalam masa 10 seconds
//  Serial.println(sendtoserver);
//  delay(6000);
//  ShowSerialData();

  SIM900.println("AT+HTTPACTION=1"); // Post the data (1 means post)
  delay(6000);
  ShowSerialData();
 
  SIM900.println("AT+HTTPREAD"); 
  delay(6000);
  ShowSerialData();
 
  SIM900.println("AT+HTTPTERM");
  delay(10000);
  ShowSerialData;
}
 
void ShowSerialData()
{



  while (SIM900.available() != 0)
//    Serial.write(SIM900.read());
//  delay(1000);
  String response = SIM900.readStringUntil('\n');
Serial.println(response);
 
}