Problem in reading sms response

Hi
I have some problem in reading sms
microcontroller ATMEGA128 custom board
here part of code to read serial data

if (Serial1.available() > 0)
  {
    while (Serial1.available())
    {
      inputString = Serial1.readString();
      stringComplete = true;
      if (GSM_DATA.startup_command_flag == 0)
      {
        GSM_DATA.Check_GSM_start_Response_flag = 1;
      }
      GSM_DATA.Check_Response = 1;
      Serial1.println(inputString);
    }
}

here i got response after sms read

+CMGR: "REC UNREAD","+91**********","","25/03/04,18:15:14+20"
2580 DISARM

OK

+CMGR: "REC UNREAD","+91**********","","25/03/04,18:15:14+20"580 DISARM

OK

above is original gsm response and below is string which read by microcontroller
there is some characters are missing
it hapens sometimes and sometimes i get correct string.
anyone knows reason behind it?
please help

Topic moved. Please do not post in "Uncategorized"; see the sticky topics in https://forum.arduino.cc/c/development-tools/uncategorized/184.


I can't really help but is there a reason why you echo the complete received message back over Serial1 (which I suppose is the GSM)?

It's just for check response
I didn't use it in main code

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.