Hello , I am currently working on a project which involved the HiLo Sagem GPRS quadband module from libellum http://www.libelium.com/squidbee/index.php?title=New_GPRS_module_for_Arduino_(Hilo_-_Sagem) and http://www.cooking-hacks.com/index.php/shop/arduino/arduino-gprs-module.html
I am currently trying to the get device to work in standalone mode to send a text (based off the tutorial given by libellum). I have solved the power issues with the module by adding a 220uf capacitor and I soldered the HiLo sagem chip to the shield now with the device in standalone mode I receive "OK" responses from the board however despite receiving "OK" after sending an SMS the message is never received, I have tried sending it to multiple different numbers and in different places (I thought signal strength might be the problem) however I am at a loss to understand why the texts aren't being received on the other end.
Here's the code I'm working off and it's outputs:
int led = 13;
int onModulePin = 2; // the pin to switch on the module (without press on button)
int timesToSend = 1; // Numbers of SMS to send
int count = 0;
//==========================DEBUG===================
char debug[500]="";
char debugTwo[500]="";
int hh=0;
byte in = 0;
int i;
int test = 0;
//=========================================
void switchModule(){
digitalWrite(onModulePin,HIGH);
delay(2000);
digitalWrite(onModulePin,LOW);
}
void reset()
{
switchModule(); // swith the module ON
for (int i=0;i<12;i++){
delay(5000);
} //Wait 1 min to register with network
}
void setup(){
Serial.begin(9600); // the GPRS baud rate
delay(2000);
pinMode(led, OUTPUT);
pinMode(onModulePin, OUTPUT);
reset(); //Turn module on
}
void loop(){
while(test<1)//While carrier information is not recieved
{
Serial.println("AT+COPS?"); //Ask for carrier info
delay(5000); //Wait 5 seconds
for(i=0;i<25;i++) //Read the carrier info
{
in=Serial.read();
debug[i] = in;
Serial.print(debug[i]);
if(debug[i]=='+') //If you receive a '+' carrier info is returned e.g. +COPS: 0,0,"Vodafone IE"
{
test++;
break;
}
}
Serial.println();
reset(); //Otherwise if no carrier information is returned reset the module
}
while (count < timesToSend){
Serial.println("AT+CREG?"); //Verify netowrk status e.g +CREG: 0,1
delay(1000);
Serial.println("AT+CMGF=1"); // set the SMS mode to text
delay(1000);
Serial.println("AT+CSCS=\"IRA\"");
delay(1500);
Serial.print("AT+CMGS=\"**********\""); // send the SMS number
//(change ********* by the actual number)
delay(1500);
Serial.print("Hello"); // the SMS body
delay(500);
Serial.write(char(26)); // end of message command 1A (hex)
Serial.println();
delay(60000);//Wait for 1 min to ensure text has sent
count++;
}
if (count == timesToSend){
Serial.println("AT*PSCPOF"); // switch the module off
count++;
while(Serial.available()>0) //Collect all debug info and print it out
{
in = Serial.read();
debug[hh] = in;
Serial.print(debug[hh]);
hh++;
}
}
}
What this returns (when I have appropriate signal) is;
+COPS: 0,0,"Vodafone IE" --Asking for carrier info
+CREG: 0,1 --Asking for network statusOK --Setting SMS mode to text AT+CMGF=1
OK --Set SMS mode AT+CSCS="IRA"
OK --Finished Writing text and sending (received from 0x1a at end of message)
Then the device turns off with the AT*PSCPOF command
I am very curious as to why this does not work as if it was a carrier issue I would have received some error message from the carrier, has anyone encountered this problem before or could anyone shed some light on anything I might be doing wrong ?
---Update--
The OK responses appear not to be from the sending SMS part of the code anyway I do not think the code manages to execute the send SMS part due to some error which I cannot see. Can anyone please help me with this problem.