Antrax GSM/GPRS/GPS-Shield: Receive SMS HELP ME PLEASE

Hi!

I use the Antrax GSM/GPRS/GPS-Shield for my school-project at the htl-moedling, Austria.
The shield provides a great example for sending the gps coordinates to a phone.

BUT:
Why is the whole internet empty about RECEIVING SMS ON THE ARDUINO SHIELD?
I am searching for anything viable since late october, but everything I find is useless due to the fact that its almost 99% not about receiving SMS on the arduino shield. (Most likely its about sending sms blablabla.) I am not the only person with that problem, but everyone asking for something like that just gets the commands how to send sms or just gets ignored by everybody. Is this basic shit? Am I really that stupid?
It cant be that hard to give me some intel about the AT-Commands I need and how to use them. (I know the AT-Commands, but have no clue about using them...)

Thats the code I use for the receive-Function (its in the .cpp-File)

void GSM::receiveSMS()   
{
    readAnswer =0;
    if(readAnswer == 0)
    {
        inByte = 1;
        char string [50];
        Serial.println("AT+CMGF=1<cr>");
        Serial.println("AT+CMGL=4<cr>");
        for(int i = 0;i < 50; i++)
        {
            string[i] = Serial.read();
        }
        Serial.print("The content: ");
        for(int i = 0; i < 50; i++) 
        {
            Serial.print(string[i]);
        }
        Serial.println();
        Serial.println("AT+CMGD=1,4<cr>");

        readAnswer = 1;
    }
}

So, PLEASE help me if you can.

Hi,

I´m using the same shield and I never would by one again, before I had looked for a well designed library.
In the flyer everything sounds well and easy but, all in all it is a fake in my eyes. It takes most of my Uno pins, and is using spi and serial, so normally one has to use a Mega to work with the board.

My target was to build a batterie-guard, sending me a SMS when the temperatur is lower than 3°C and the voltage is lower than 11.5V for example) additionaly when I call the shield with some keywords in a SMS it should send me the gathered data.

It took hours with testing and reading reading and testing, and I´m not ready yet.
The following code will ask for the time and will list some SMS from the SIM card.

I have to work on it - because I cannot understand why this ff... shield is sendig different results when

using
Serial.p r i n t (char(incomingbyte))
instead of
Serial.p r i n t l n (char(incomingbyte));

Because I am not a coder it is really hard for me, to code that.
Maybe you are more successfull. Would be nice to have a hint.

I think it is important to know about the length of buffer size of the shield, but I havent found any hint to that..
after some testst I used 140 to see any results at all.
Additionally I used some delays, because I think the shield needs some time , but its just a rough work, not well formatted and only for testing.

Try it and you will see, maybe it is helpfull for you.
Good luck

OnkelHotte

#include "Arduino.h"
#include <GSM_GPS_Shield.h>
#include <SPI.h>

GSM gsm(7,9600);                                            // (power_pin, baudrate)
GPS gps(9600);                                              // (baudrate)

void setup()
{
  if(gps.initializeGPS())
    Serial.println("Initialisierung erfolgreich");
  else
    Serial.println("Initialisierung fehlgeschlagen(warum auch immer)");
}

void loop()
{
  gps.getGPS();                  //GPS-Koordinaten abrufen 
  Serial.print(gps.coordinates); //und ausgeben 
  if(gps.coordinates[0] == 'n') // GPS-Fix da ?? 
       { Blink_GPS_NOK(); }     //hektisch blinken 
     else
       { Blink_GPS_OK(); }     //entspannt blinken 
  //------------------------------------------------------------
  //-----  Tel anrufen  ---
  //------------------------------------------------------------
  if(!gps.checkS1())             //linker Taster unter der GPS-Antenne             
  {
    gsm.initializeGSM("5555");                                         
    delay(200);
    gsm.makeCall("055276648");   //funzt einwandfrei                   
  }
  //------------------------------------------------------------
  //-----  SMS Senden ---
  //------------------------------------------------------------
  if(!gps.checkS2())             // rechter Taster  unter der GPS-Antenne    
  {
    gsm.initializeGSM("5552");                                         
    delay(200); 
    // gsm.sendSMS("01713542267",gps.coordinates);
/*    read_Puffer();
    Serial.println("AT+CGMR\r");              //Ausgabe der Software-Version des Boardsnummer des Boards    
    read_Puffer();delay(200);
    Serial.println("AT+CGMM\r");              //Ausgabe der Telit-Modul-Info
    read_Puffer();delay(200);
    Serial.println("AT+CMEE=2");              //Fehlermeldungen in ausführlichem Schriftformat
    read_Puffer();delay(200);
    Serial.print("AT+CMGF=1");                // SMS in Text Modus 
    read.Puffer();delay(200);
    Serial.println("AT+CMGR=1\r");            //Lies SMS an Index Nummer 1
    read_Puffer();delay(200);
*/
    Serial.println("AT+CCLK?");delay(50);     //Uhrzeit und Datum ausgeben (nicht bei allen providern--> funktioniert prima!)
    read_Puffer();delay(500);                        //funktiniert einwandfrei
    Serial.println("AT+CMGL=\"ALL\"\r");      //Liste alle SMS auf
    delay(50);read_Puffer();delay(200);
/*    
    Serial.println("AT+CPMS?\r");
    read_Puffer();
    Serial.println("AT+IPR?");               // Abfrage der baudrate  --> 
    read_Puffer();
*/
  }
}
//------------------------------------------------------------
//-----  GSM-Board-Puffer Behandlung  ---
//------------------------------------------------------------
void read_Puffer()                      //auslesen der länge des GSM-SMS-Puffers
{
int incomingbyte  = 0;                  //Variablenname 
//Serial.flush();                         //seriellen Puffer komplett leeren  hat bei jedem Aufruf zwei Zeichen gelöscht 
for (int i = 0; i < 140; i++)            //140 Stellen des Puffers einlesen 
// while (Serial.available() > 0 ) 
  {
    incomingbyte=Serial.read();         //Variable aus Serieller Schnittstelle einlesen
    //Serial.print(" --> ");
    Serial.println(char(incomingbyte)); // und ausgeben .. 
    }
}
//------------------------------------------------------------
//-----  Blinker für GPS   ---
//------------------------------------------------------------
void Blink_GPS_OK()             //Ja, Koordinaten sind da ... entspannt blinken 
{
  delay(300);  gps.setLED(1);    
  delay(500);  gps.setLED(0); 
}
void Blink_GPS_NOK()           // Nein, Koordinaten nicht da, hektisch blinken ..
{
   delay(20);    gps.setLED(1);  
   delay(20);    gps.setLED(0); 
   delay(20);    gps.setLED(1);
   delay(20);    gps.setLED(0);
   delay(250);
}

Hello and Happy New Year!

Thank you for your answer, this really helps me a lot!
The only thing I got meanwhile (because working with this thing is so frustrating) is a email from the developer.
He only wrote me the AT-Commands I need, but I was glad to have something.
This is what he sent me:

Send: AT<cr>
AT

OK

Send: AT+CPIN?<cr>
AT+CPIN?

+CPIN: SIM PIN

OK

Send: AT+CPIN=1357<cr>                              // ACHTUNG: Das ist MEINE(!) PIN
AT+CPIN=1357

OK

Send: AT+CREG?<cr>
AT+CREG?

+CREG: 0,2

OK

Send: AT+CREG?<cr>                                  // warten bis das Modul eingebucht ist
AT+CREG?

+CREG: 0,1

OK

// bis hier war das das Standard-Einbuchen
// jetzt kommen die SMS-Befehle:

Send: AT+CMGF=1<cr>                                 // SMS-Format auf TEXT einstellen
AT+CMGF=1

OK

Send: AT+CMGL="ALL"<cr>                             // Alle gespeicherten SMS auslesen
AT+CMGL="ALL"

+CMGL: 1,"REC UNREAD","+491717047315","","13/12/19,17:45:06+04"
Dies ist eine Test-SMS ---> Fritz

OK

I didn't have the luck to get it working till now.
Our project is to manipulate the functions of a car, using a GSM;GPS-Shield - controlled from a smartphone app. So we need at least 4 digital outputs from the uno - the gsm-shield doesn't need them all the time, am I right here?

Well, I guess I will spend the next days working on it again.

Thank you very much!

Yes - its frustrating and the support almost doesnt exist.
The AT Commands are discussed very well in the teilt manual (150 .. 200pages..)
There are exapmles included as well, but I am not able to get a sufficient solution.

Did you test my code - I know, its not complete, but it works and You will be able to get an answer
from the shield and You can read a SMS if one exists!!.

Your second topic - yes, it nearly needs all of the UNO-Pins, You can read about the needed pins in their
"SEND SMS" Example. I think, only one Pin is available. ;-(((

Meantime I use a Mega-clone (EBAY ca. 15-18€), where I don# t have this probs.
All in all it was a dumb thing to buy just the expensivst shield of all, hoping a library will be included.

Enviable how nice the "Easy GSM" Shield of Antrax is documented... But that was weeks after I bought 2 of this shields..
Further projects will be with separated GSM and GPS shield, hoping I2C shields are available...

regs onkelhotte

Yeah, I tested your code and it works - however I dont get all the sms I sent to the shield. Don't they show up because the puffer is read only 140 positions?

I can test the funcions with 1 pin aswell, so I won't get myself a mega for now. But thanks for the information!

Yeah, I am dissapointed aswell, I wouldn't get one of those shields again.

Thank you for your help!

Edit: Yeah, expand the puffer, get more messages shown. Thank you again for your advice!

Hi Fritz_S
I saw your post "Antrax GSM/GPRS/GPS-Shield: Receive SMS HELP ME PLEASE" and I am curious if you finished the project. You are 3 years ahead of me :))) I am trying to build pretty much the same. I want to put Arduino UNO and GPS shield together and control my car (lock, unlock, windows, GPS location etc...).
Would you be keen to share some knowledge?