Realtime GPS+GPRS Tracking not working.

I have been following this tutorial ----> https://www.cooking-hacks.com/projects/arduino-realtime-gps-gprs-vehicle-tracking/

I have posted on there forums all ready but just have not had much luck. I have the sim installed and everything set up but i can not get the device to send the server the lat and long of the arduino nor can i get it to send me a txt message.

Here is the code i have! What am i doing wrong?..... >:(

Link to code (site claims i exceeded the max characters.

http://gps.myrobertsautocenter.com/code.txt

That is just plain unreadable. Also, it looks too small to exceed the max characters. Do a cut and paste from inside the IDE, to your post (please please please inside code tags).

If it does turn out to be over, just add the .ino as an attachment.

My apologies, looks fine on my end for some reason. I have attached the ino file.

GPS2.ino (14.6 KB)

Does not compile without errors.

   while( (sendATcommand("AT+CREG?", "+CREG: 0,1", 1000) || sendATcommand("AT+CREG?", "+CREG: 0,5", 1000)) == 0 );

That does NOT compare the return code from each function call to 0.

            Serial.flush();

Wait for all pending outgoing data to be sent. Why is THAT necessary?

        if( a==9){  
            Serial.println("Correct number");
            sendATcommand("ATH", "OK", 1000);
              if(b==1){
                 b=0;
               }else{                  
                 b=1;
                 c=1;

One letter names are fine for for loop indices. They are crap for variables that are supposed to mean something.

but i can not get the device to send the server the lat and long of the arduino nor can i get it to send me a txt message.

Why is the GPRS device connected to the Serial instance? You haven't a hope in hell of debugging the code with the Serial port out of commission.

Well it did till i coped the code… i redid it and attached it. There is no error when uploading.
In the serial monitor it keeps saying AT over and over and over and over.

im using a ATT pay as you go plan with a ATT Sim if you need to know that as well

GPS5.ino (13.7 KB)

I agree with you the code is not that good at all by any means. Unnaturally im new to programming arduino sadly…im a php programmer. like i said though im just following the tutorial trying to make everything work then i will start redesigning the code as i have time.

PaulS:

   while( (sendATcommand("AT+CREG?", "+CREG: 0,1", 1000) || sendATcommand("AT+CREG?", "+CREG: 0,5", 1000)) == 0 );

That does NOT compare the return code from each function call to 0.

            Serial.flush();

Wait for all pending outgoing data to be sent. Why is THAT necessary?

        if( a==9){  

Serial.println(“Correct number”);
            sendATcommand(“ATH”, “OK”, 1000);
              if(b==1){
                b=0;
              }else{                 
                b=1;
                c=1;



One letter names are fine for for loop indices. They are crap for variables that are supposed to mean something.
Why is the GPRS device connected to the Serial instance? You haven't a hope in hell of debugging the code with the Serial port out of commission.

Copying and pasting crap that you don't understand is NOT the way to get functioning code. Study what you are copying. Understand it BEFORE you paste it. If it is crap, fix it.

"I'll do it right later" is nonsense. Do it right NOW.

Kelly: In the serial monitor it keeps saying AT over and over and over and over.

You can't use Serial to talk to both Serial Monitor and your GPS/GPRS shield! You can't have both devices sending to the same pin and your debug messages sent to both will confuse the GPS/GPRS. I recommend you use SoftwareSerial to talk to the shield. That should be covered in the documentation for the shield.

Thank you caption know it all glad you know how to run my project and how to orchestrate my project.

PaulS: Copying and pasting crap that you don't understand is NOT the way to get functioning code. Study what you are copying. Understand it BEFORE you paste it. If it is crap, fix it.

"I'll do it right later" is nonsense. Do it right NOW.

Thank you