SIM800L & Airtel SMS Issue

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.

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.

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.

Glad it worked with new SIM :slight_smile:

I am also having same issue with new airtel 4g sim card but when I inserted old airtel sim card then problem is fix. but new airtel sim is showing this issue on my device and this issue is only on airtel sim card, I had checked with vodafone, Idea, BSNL. I had also used CMGF=1 in my code.
I am searching for reason for such a strange behavior.

forgot to say I am using SIM800C not SIM800L

You should create separate thread for your question, not post in others. Content not supported is a problem that normally occurs when you are sending unsupported characters. Scan through the bytes sent on the SMS packet and see if any non-ASCII character is present.