Go Down

Topic: I can not read text messages with Siemens tc35 (Read 528 times) previous topic - next topic

I'm trying to read a text message but the content is missing.

at
OK
AT+CPIN=5134
OK
AT+CMGF=1
OK
AT+CMGR=1
+CMGR: "REC READ","+3598833485**",,"13/04/03,17:07:



char gsm_char=0;      //Stores character from the gsmSerial



void setup()
{
  //Initialize serial ports for communication.
  Serial.begin(9600);
  Serial1.begin(9600);
  Serial.println("Starting TC35 and debug Communication...");
}

void loop() {
  //If a character comes in from the cellular module...
  if(Serial1.available() > 0){
    gsm_char=Serial1.read();    //Store the char in gsm_char.
    Serial.print(gsm_char);  //Print it to debug serial
  }
  //Read serial input
  if(Serial.available() > 0){
    gsm_char=Serial.read();  //Store char in gsm_char (Not really from the gsm, just saving some memory)
    //Evaluate input.
    if(gsm_char=='t'){
      Serial1.print("AT\r");  //Send test command
    } else if(gsm_char=='p'){
      Serial1.print("AT+CPIN=5134\r");  //Enter pin, hardcoded
    } else if(gsm_char=='g'){
      Serial1.print("AT+CMGF=1\r"); //Set text mode.
    } else if(gsm_char=='s'){
      //Send sms!
      Serial1.print("AT+CMGR=1\r"); //AT command to send SMS
     } else if(gsm_char=='z'){
           
    }
  }
}

Is it possible to buffer overflows?


I found that the problem is communication between Arduino and GSM module because when I connect GSM module to the serial port of the computer, the message is read. Where is the error in my program?


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy