Hello good day everyone. I seem to be having some problems. i am using an arduino mega 2560 and connected to it i have a gsm module sm5001-B module. I am able to send text messages but recieving is a bit more tricky. I have the following code below,the main problem is, with the arduino i am not able to see the sms, but with the terminal i can see the sms so i know theres something wrong with my code. My plan is to read the data into an array and parse the sms message, but i can't read anything into the array if i have no message
. I have uploaded the pic with the terminal showing the sms, any help would be greatly appreciated.
_______________________________________________________________________________________________________________________________
char character=0;
void setup()
{
Serial.begin(9600);
Serial1.begin(9600);
delay(60000);
}
void loop()
{
int j=0;
char incoming_let=0;
char incoming_char[500]=" ";
String buff1 = String(500);
Serial1.println("AT+CMGF=1");
delay(1500);
Serial1.print("AT+CMGL=");
Serial1.write((byte)34);
Serial1.print("ALL");
Serial1.write((byte)34);
Serial1.println();
delay(1000);
while(Serial1.available())
{
character = Serial1.read();
Serial.print(character);
}
}
_____________________________________________________________________________________________________________________________
Output:
+SIND: 11
+SIND: 3
+SIND: 4
OK
+CMGL: 1,0,"REC READ
OK
+CMGL: 1,0,"REC READ","+18687914655","13/03/21,20:39:00+0
OK
+CMGL: 1,0,"REC READ","+18687914655","13/03/21,20:39:00+0
OK
+CMGL: 1,0,"REC READ","+18687914655","13/03/21,20:39:00+0
OK
+CMGL: 1,0,"REC READ","+18687914655","13/03/21,20:39:00+0
OK
+CMGL: 1,0,"REC READ","+18687914655","13/03/21,20:39:00+0
