How can i read sms message from Telit

HI

How can I read a message that arrive to module Telit GM862?

I use the at commands

Serial.print("AT+CMGF=1"); delay(1000); Serial.print("AT+CNMI=1,2,0,0,0");

and when the module receive a sms comunicate with arduino and sends something like this:

+CMT: "+351933482729",,"09/10/26,16:00:44+00" Teste teste

But i don't know how to read this message

Anyone know how to wait for this message.

I tried to use de serial.read().

But I can't catch that text.

How did you try to read from the gsm modem? It may take some time before the gsm modem responds to AT-commands. Did you use Serial.available() to check if there is something to read? For example:

// wait for the response
while(!Serial.available()) delay(10);

// start reading ...

I already try to do that

but don't work.

any other suggestion?

How do you know that sending AT-commands from Arduino to Telit worked if you don't get any response from Telit? Can you, for example, send a SMS from Arduino to your mobile? And how do you physically connect Arduino to Telit?

You can also post your code here and we might see what's wrong with it.

Hi

Yes I can send sms to my mobile phone.

I’m doing something like this:

char linea[300] = “”;
char comandoGPR[5] = “+CMT:”;

void setup(){
Serial.begin(38400); // the GPRS baud rate
delay(1000);
Serial.println(“AT+CMGF=1”); // set the SMS mode to text
delay(1500);
Serial.println(“AT+CNMI=1,2,0,0,0”);
}

loop{

byteSMS=Serial.read(); // Read a byte of the serial port
if (byteSMS == -1) { // See if the port is empty yet
delay(100);
} else {
linea[conta]= byteSMS; // If there is serial port data, it is put in the buffer
conta++;
if (byteSMS ==13){ // If the received byte is = to 13, end of transmission
bien=0;
for (int i=1;i<6;i++){ // Verifies if the received command starts with +CMT:
if (linea*==comandoGPR[i-1]){*

  • bien++;*
  • }*
  • }*
  • if(bien==5){*
  • //process SMS data*
  • }*
  • }*
    }

Hmm. I can't see any obvious errors in your code. Perhaps the there is something wrong in the wiring? How do you phycically connect Arduino to Telit? Could it be, for example, that you have to set the DTR signal before Telit can write back to Arduino?

Hi

How can a do it .

How can a do it .

Do what? Set the DTR signal? Do yo know that it is the problem? It depens how you physically connect Arduino Telit’s serial port, i.e., how wires goes between Arduino and Telit. You haven’t told that yet.

sorry

I am using a arduino diecimila board and a board arduino - gprs with a telit GM862.

like image on link http://www.libelium.com/squidbee/index.php?title=GPRS_/_GPS_module_for_Arduino

Ok, it is a GPRS shield. That probably excludes the wiring problems. Did you managed to complete all three steps in the page your linked?

Btw, the code for sending SMSs in the page you linked has lines that turn the module on:

switchModule(); // swith the module ON the led on the module starts blinking
for (int i=0;i<5;i++){
delay(5000);
}

I didn’t see that in the code sample you sent before. Are you sure the module is on (leds blinking) when you try to read the SMSs?

Hi

Yes the module blinks.

And I can send sms.

But I can't read the status of any command AT.

for example i what to read the response of command AT for "AT" that should result in a OK .

so for do that a do:

Serial.println("AT");

while(!Serial.Available()){delay(100)} byte response = Serial.Read();

but I never read Anything. never out from while

anyone know why?

Thanks

Hello - I will soon be doing a similar application and was wondering if anyone has figured out this "reading in of sms" issue.

Thanks!