Pages: [1]   Go Down
Author Topic: Cellular Shield (Sagem HI-LO) - How to recieve a text?  (Read 470 times)
0 Members and 1 Guest are viewing this topic.
Ireland
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've recently purchased a cell shield, the Sagem hi-lo model metioned here http://www.libelium.com/squidbee/index.php?title=New_GPRS_module_for_Arduino_(Hilo_-_Sagem). While I'm able to use the example code on this page for making a call and sending an SMS, I cannot find any program to read a received SMS. Any sample libraries I've downloaded don't seem to work with this model.
The aim of my code is to receive an SMS to turn on the cell shield, which will return an SMS with a command, then receive another SMS, read it, and turn on an LED.
Any help would be very appreciated.

Thanks,
Steve.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 46107
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The aim of my code is to receive an SMS to turn on the cell shield
If the shield isn't on, is there any reasonable expectation that it will receive a text message?
Logged

Ireland
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am also using a RTC along with this program so I can have the GSM Shield turning on every 10 or 20 mins to check the texts. That shouldn't be a problem. My problem is getting the GSM Shield to read a text.
To turn on the unit I am using this code
Code:
void setup()
{
  Serial.begin(9600);
  Serial.println("system startup");
  gsm.TurnOn(9600);          //module power on
  gsm.InitParam(PARAM_SET_1);//configure the module 
  gsm.Echo(0);               //enable AT echo

}
And in the void loop I have
Code:
char inSerial[5];   
  int i=0;
  delay(2000);
 
    Check_SMS();  //Check if there is SMS
}

Code:
void Check_SMS()  //Check if there is an sms 'type_sms'
 {
     char pos_sms_rx;  //Received SMS position     
     pos_sms_rx=gsm.IsSMSPresent(type_sms);
     if (pos_sms_rx!=0)
     {
       //Read text/number/position of sms
       gsm.GetSMS(pos_sms_rx,number_incoming,sms_rx,120);
       Serial.print("Received SMS from ");
       Serial.print(number_incoming);
       Serial.print("(sim position: ");
       Serial.print(word(pos_sms_rx));
       Serial.println(")");
       Serial.println(sms_rx);
       if (del_sms==1)  //If 'del_sms' is 1, i delete sms
       {
         error=gsm.DeleteSMS(pos_sms_rx);
         if (error==1)Serial.println("SMS deleted");     
         else Serial.println("SMS not deleted");
       }
     }
     return;
 }

This is all taken from an example library. But after sending a text i get this on the serial prompt.
Quote
Recieved text from (sim position 65534
. The GSM Shiels knows there is a text there but it isn't reading or printing it.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
it's time to...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe this will be help.
http://www.elecrow.com/wiki/index.php?title=GPRS/GSM_Shield_v1.0#Using_Sms_to_Control_an_LED_Status
Logged

Pages: [1]   Go Up
Jump to: