SM5100B sending text problem

Hi,

Im using the Sparkfun shield and it works ok. The problem I’m having is that a sketch i wrote 2 weeks ago doesn’t work now, which worked before.
Its my first time with 5100 module and its hard for me to understand what is wrong…
When i use the sample sketch from jhon boxal blog it’s working as expected and sending the text. but when i"m uploading my sketch nothing happens, and also the messages that used to be on the serial monitor are not printed anymore.
this the sketch for the sample code:

#include <SerialGSM.h>
#include <SoftwareSerial.h>
SerialGSM cell(2,3);
int SMS_Relay = 9;
void setup()
{ 
 //delay(30000); // wait for GSM module
 cell.begin(9600);
 pinMode(SMS_Relay,OUTPUT);
 digitalWrite (SMS_Relay,LOW);// relay control
}
void sendSMS()
{
 cell.Verbose(true); // used for debugging
 cell.Boot(); 
 cell.FwdSMS2Serial();
 cell.Rcpt("+xxxxxxxxxxxx"); // replace xxxxxxxxx with the recipient's cellular number
 cell.Message("09:51 02/09/13...");
 cell.SendSMS();
}
void loop()
{
 delay (3500);
 digitalWrite (SMS_Relay,HIGH);
 delay (10000);
  sendSMS();
do // remove this loop at your peril
 { 
 delay(1); 
 }
 while (1>0);
}

this the sketch that I wrote:

#include <SerialGSM.h>
#include <SoftwareSerial.h>
SerialGSM cell(0,1);
int SMS_Relay = 9;
byte relay_flag = 0;
byte sms_flag=1;
long sms_millis=0;
void setup()
{ 
 //delay(30000); // wait for GSM module
 cell.begin(9600);
 Serial.begin (9600);
 Serial.println("start of test");
 pinMode(SMS_Relay,OUTPUT);
 digitalWrite (SMS_Relay,LOW);// relay control
 sms_millis = millis();
}
void sendSMS()
{
  //Serial.println(" sms procedure start");
 cell.Verbose(true); // used for debugging
 cell.Boot(); 
 //cell.FwdSMS2Serial();
 cell.Rcpt("+xxxxxxxxxx"); // replace xxxxxxxxx with the recipient's cellular number
 cell.Message("start of september");
 cell.SendSMS();
 //Serial.println("sms procedure end");
}
void loop()
{
 if (millis() - sms_millis > 5000 && relay_flag ==0){//opens the relay
       Serial.println("relay opens");
       digitalWrite( SMS_Relay, HIGH);
       sms_millis = millis();
       relay_flag = 1;
}
  if ((millis() - sms_millis > 12000) && sms_flag == 1){//send the sms
    Serial.println( "call to sms procedure");
    sendSMS();   
    Serial.println( "out of sms procedure"); 
    sms_flag= 0 ;
    sms_millis = millis();
  }
   
   if (millis() - sms_millis > 45000  && relay_flag ==1){//close the relay
     Serial.println("relay closed");
    digitalWrite( SMS_Relay, LOW);
    sms_millis = millis();
   // relay_flag = 1;
  }
  
 
/*
do // remove this loop at your peril
 { 
 delay(1); 
 }
 while (1>0);*/
}

is it possible that i did the millis delay wrong? casuse without the millis its working
The reason i’m using the relay is because its connected to a car and when i start it there is a momentary shut down of power, which after the SM5100B won’t respond. But i found out that even with the relay i wont wotk because the arduino itself will shut down and that’s bad…

Thanks for all the helpers.

You've commented out this line in your code, you need this line of code to fully configure the gsm module :)

//cell.FwdSMS2Serial();

Hi ,

Can you explain to me why please? because in the first code segment it's not commented out and it still doesn't send the sms. And why do I need to fully configure the module? it is just a display function...

Is there a certain wake up procedure for the module? I can't understand why sometime it is working and some times not... This is what i get when I try to send sms:

AT+CFUN=1,1
AT+CMGD=1,4
...............
AT+CMGF=1
     
AT+CNMI=3,3,0,0
+SIND: 1
+xxxxxxxxxxxx
12:35 03/09/13...
AT+CMGF=1

AT+CMGS=+xxxxxxxxxxxx+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"RC",1
12:35 03/09/13...
OK

Ok, after further testing, I can call the module and text it, but i can't get him to talk to the arduino or the terminal. If i'm resetting the SM5100B then I can get him to show the basic stuff that john boxal made in his sketch (to show the connection to the network...) I haven't tried yet to send text again as i can't get any response from it. Does anyone know of a way to make the module talk again to the arduino? Is there a way to restore the default? Can it Be damaged from wrong sequence of waking up? All help is appreciated...

Gili

Any one? Is there a way to check if the serial port (or communication?) is damaged?