Hi all
I created a project utilising a Mega2560, GSM 800L, and Nextion display.GSM will deliver the SMS when I provide the command using Nextion.Nextion will display "Success" or "Failed" after the sms has been sent.
So, after sending the SMS GSM, I opted to read the AT Command response over serial communication.
After sms sent,GSM response is here
AT+CMGS="+649575610284"
> Current HMR: 3558
>
+CMGS: 115
OK
if i received the +CMGS:
command from GSM display will shows "Success".
i have tried ,but its not get success
Here is my code
void sendSMS1(char * message4)
{
EEPROM.get(addr_Ph1,adminNumber);
x=String(adminNumber);//+("\"");
String sendnum = String ("\"")+"+91"+(x)+("\"");
GPRS.print("AT+CMGS=");
GPRS.println(sendnum);
delay(1000);
GPRS.println (message4);
delay(1000);
GPRS.write( 0x1a ); // ctrl+Z character
delay(1000);
if (GPRS.available())
{
String indata = GPRS.readString();
Serial.println(indata);
if (indata.indexOf ("+CMGS:") > -1)
{
byte position1 = indata.indexOf("+CMGS:");
Serial.println(position1);
}
}
}
Arduino read all content
How can i derived only +CMGS:
from the all content
S/o Out put
AT+CMGS="+649575610284"
> Current HMR: 3558
>
+CMGS: 115
51
Please advice .