Go Down

Topic: GSM shield stops recieving text messages... until I put SIM card in a phone. (Read 185 times) previous topic - next topic

MK45

Hello,

My project was happily recieving text messages until after 3 months it stopped working recieving texts.

Initialisation appeared to work. 


I removed the EE SIM and tested it in a phone. The SIM was still working. When I send a test message to the phone, all the messages I had tried to send to the project began to arrive.

At this point it looked like a hardware fault with my project. However, when I put the SIM back it was now working fine.

It has since done this twice.

I am going to try a new SIM but I wondered if anyone had seen this before, or if they could recommend a network.


Thanks for any help you can offer.



my initialisation code;

 boolean notConnected = true;
  Serial.println (F("Starting GSM"));
  // Start GSM connection
  while(notConnected)
  {
    led.on();
    if(gsmAccess.begin(PINNUMBER)==GSM_READY)
      notConnected = false;
    else
    {
      Serial.println(F("Not connected"));
      led.off();
      delay(1000);
    }
  }
  led.off();
  Serial.println(F("GSM initialized"));
}





the bit the reads the text messages;



String SMStxt = "";
  int SMScode = 0;
  char c;
  // If there are any SMSs available() 
  if (sms.available())
  {
    Serial.println(F("Message from:"));
   
    // Get remote number
    sms.remoteNumber(senderNumber, 20);
    Serial.println(senderNumber);

    // message disposal   
    // Any messages not starting with & should be discarded
    if(sms.read()!='&')
    {
      Serial.println(F("Discarded SMS"));
      sms.flush();
      return 0;
    }
    // Read message into string
    while(c=sms.read())
      SMStxt += c;
    // Delete message from modem memory
    sms.flush();
    Serial.print(F("incoming text: "));
    Serial.println(SMStxt);
    SMStxt.trim();



Go Up