SIM800L & Airtel SMS Issue


#1

I am using the below code to send date-time stamped SMS from SIM800L.


SoftwareSerial SIM800L(3, 2);
String adminNumber="+91xxxxxxxxxx";

void setup(){
SIM800L.begin(9600);
SIM800L.print(“AT+CMGF=1\r”); //SIM800L:SMS Text Mode.
clrSIM800L();
delay(250);
}

void funSMS(String MSG){
delay(250);
clrSIM800L(); // CLEAR BUFFER FOR SAFETY
delay(1000);
MSG=(MSG+"\n@"+net_CLK());
delay(250);
SIM800L.print(“AT+CMGS=”"+adminNumber+""\r");
delay(250);
SIM800L.print(MSG);
delay(250);
SIM800L.write((char)26);
delay(250);
MSG = “”;
delay(1000);
}

void clrSIM800L(){ // function to clear buffer
char clrSim800Lvar;
while (SIM800L.available()){
clrSim800Lvar=SIM800L.read();
delay(50);
}
}

String net_CLK(){ // function to return date and time
char netwCLK[40];
char newCLK[18];
clrSIM800L();
delay(250);
SIM800L.print(“AT+CCLK?\r”);
delay(250);
for(int i = 0; i <= 39; i++){
delay(10);
netwCLK[i]=SIM800L.read();
}
for(int j = 0; j <= 16; j++){
newCLK[j]=netwCLK[j+19];
}
newCLK[17]=0;
String strCLK((char*)newCLK);
return strCLK;
}


The problem is when I am using Airtel SIM in SIM800L, I receive “content not supported”.
This problem does not occur with Vodafone, Idea, Tata
From some research i guess the problem is text mode setting.


#2

The CMGF=1 command is the solution for content not supported. Make sure you are not sending any binary character in the message. All should be ASCII. There might be some buffer contents that are 0x00 or other non ASCII chars. Check before sending each byte.


#3

Thanks for your input. I am already using CMGF=1 command. I am not having any issue with new Airtel SIM. I was getting this issue with old Airtel SIM registered in 2014. So i guess the issue was with old SIM and not Airtel.


#4

Glad it worked with new SIM :slight_smile: