Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

GSM Modem300 message read problems

Status
Not open for further replies.

rebornac3

Newbie level 1
Joined
Jan 14, 2014
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
11
Hi, I'm unable to get a proper response from my GSM modem300, sometimes it responds with nothing, sometimes it replies half of line of ONE message from full inbox, sometimes it just sends the command (AT+CMGR=1) I just sent, back many times.

Print screens:

sends my command back:
https://imgur.com/Lyv8oui

responds with nothing:
https://imgur.com/jHQOSxM

responds with half line of one message from FULL inbox!:
https://imgur.com/zsmDcIc

responds with garbage:
https://imgur.com/vTVSwyf

I'm using Arduino, directly connecting the Tx and Rx of board to Rx and Tx of arduino, and GND to arduino GND.

CODE:

Code:
char incomingByte=0; 

    [COLOR="#00FF00"]void setup[/COLOR]() 

     {

     Serial.begin(9600);
  
      delay(2000);

      Serial.println("AT+CMGF=1");

      delay(2000);

      Serial.println("AT+CMGR=1");

      delay(2000); 
    
          }

     [COLOR="#0000FF"]void loop[/COLOR]()
    {   

        while (Serial.available() > 0) 
        {      
 
               incomingByte = Serial.read();
               
               if(incomingByte!='\n'){

               Serial.print(incomingByte);

               }
               
               if(incomingByte=='\n')

               {

                Serial.print(incomingByte); 

               }              
                   }
        }



It might be worth mentioning that, I can send messages properly, and make and receive calls with no problem...
 

Dont check for '\n'...

Instead check for "OK"...

Until you get "OK", just print the received data in the serial...

Declare an array of buffer and get the data until you get "OK" and then print the buffer...Max sms characters can be 160 only...

Your way of handling might create trouble...As before printing the data you may receive next data...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top