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
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
char inSerial[5];
int i=0;
delay(2000);
Check_SMS(); //Check if there is SMS
}
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.
Recieved text from (sim position 65534
. The GSM Shiels knows there is a text there but it isn't reading or printing it.