GPRS Module not working

GPRS Module not working

Sorry If this is in the wrong section, etc. New here lol.

Arduino connected with GPRS module and other components.

The code below is part of bigger code and should work on its own regardless.

It worked before but I put it away until needed and now doesn't work.

The code here is ultimately what needs to be ran.

void setup()
{
  Serial.begin(9600);  //Baud rate of the GSM/GPRS Module 
  Serial.print("\r");
  delay(1000);                  
  Serial.print("AT+CMGF=1\r");    
  delay(1000);
  Serial.print("AT+CMGS=\"+44**********\"\r");    //Number to which you want to send the sms
  delay(1000);
  Serial.print("Testings SMS -Jay" "\r");   //The text of the message to be sent
  delay(1000);
  Serial.write(0x1A);
  delay(1000); 
}
void loop()
{
}

OR

I have no clue to why it's not working, here is the output I get.

AT+CMGF=1
AT+CMGS="+44**********"
Testings SMS -Jay

The GPRS Module flashes away quite happily.

Previous problems were the number being not right.

Eg. +4407******* instead of +447******* and missing out the 0.

Really not sure, could it be the room? It's worked before here.

Are you using the serial pins (D0 & D1) to talk to the GPRS device, or to serial monitor? You cannot do both!

Here: http://i.imgur.com/dQQzktt.jpg

That's how it is.

I'm not sure what you mean, how can I check?

Also, I can't recall when testing now, the Rx and Tx LEDs flashing... I'll check again.

Edit: The Tx and Rx LEDs do flash so now I really don't know what's happening.

It always has taken a while to send, not this long.

Use SoftwareSerial to talk to the GPRS device and use D0 & D1 to talk to Serial Monitor. You should be able to adapt the ideas in the link in my signature to suit your requirements.

Also, see here for some general hints and tips, specifically regarding power.

Right, but you see, I needed it to work offline by battery. Not connected to a computer.

It worked before, just don’t know why not now.

Thanks anyway.

EDIT: Another thought is I’m using a contract sim card, does it need to be pre-paid? Then again, it worked like this before.

EDIT 2: Sim card was wrong way around… Lol… Fingers crossed.

Once you have it all working using Serial Monitor to debug any issues you can then swap it over to use D0 & D1 and remove SoftwareSerial.

I don't understand.

So, at the moment using "serial.*" it only works when the serial monitor is opened on the computer.

Or could I directly attach batteries to it?

When you open Serial Monitor it communicates with the Arduino Uno using pins D0 & D1, so if you are going to debug your program that way you need to keep the pins free hence the suggested use of SoftwareSerial. Once you have a program working you can then modify it so that it uses those pins to communicate with the GPRS device instead. Of course this may introduce bugs of its own! I have a small CP2012 based device that allows me to use serial monitor with SoftwareSerial should the need arise.

The use of batteries doesn't affect the use of serial unless you have written a program that waits for input on the serial pins.

Right, so please can you confirm the following.

Right now, It's being run connected to a computer and the arduino software serial thing.

Can I run it straight on batteries now, when it works? Or does that mess up things?

EDIT:

Right yes, so when it is just connected and the serial thing is closed it runs parts of the code as the LED I put on flashes like it's supposed to... But the "Tx" doesn't flash when the code below should run. Does it only run in serial mode, because that's when it says it transmitting...

  Serial.print("AT+CMGS=\"+01234306499\"");  
  delay(1000);
  Serial.print("Test");  
  delay(1000);
  Serial.write(0x1A);
  delay(1000);

That code should work with batteries if your set up is still as your photo. It will send the print commands to the GPRS device. You should ideally prefix the network/operator/area code with the country code - "+441904123456".

Indeed, that's what I've been doing.

The latest is that the "Tx" for transmit flashes suggesting it's sending something.

First port of call is to try different ways of writing the number I guess.

EDIT:

Still not working - Anyone have any other suggestions?