GPS Tracking device Project not receiving sms

Hi,

We’re working on a GPS Tracking device project and we’re using the steps and codes from http://www.instructables.com/id/Athena-The-Global-Car-Tracking-System/?&sort=ACTIVE&limit=40&offset=40#DISCUSS. The materials we’re using is arduino uno, sim 900 and gps module.

This is the code:
#include <SoftwareSerial.h>
#include <string.h>
#include <TinyGPS.h>
SoftwareSerial Sim900Serial(2, 3);
byte buffer[64]; // buffer array for data recieve over serial port
int count=0; // counter for buffer array
SoftwareSerial GPS(4, 5);
TinyGPS gps;
unsigned long fix_age;
long lat, lon;
float LAT, LON;
void gpsdump(TinyGPS &gps);
bool feedgps();
void getGPS();
void setup()
{
Sim900Serial.begin(19200); // the SIM900 baud rate
GPS.begin(9600); // GPS module baud rate
Serial.begin(9600); // the Serial port of Arduino baud rate.
delay(500);
Sim900_Inti();
}

void loop()
{
Sim900Serial.listen();
if (Sim900Serial.available()) // If date is comming from from GSM shield)
{
while(Sim900Serial.available()) // reading data into char array
{
buffer[count ]=Sim900Serial.read(); // writing data into array
if(count == 64)break;
}
Serial.write(buffer,count); // if no data transmission ends, write buffer to hardware serial port
Cmd_Read_Act(); //Read the ‘COMMAND’ sent to SIM900 through SMS
clearBufferArray(); // call clearBufferArray function to clear the storaged data from the array
count = 0; // set counter of while loop to zero

}
if (Serial.available()) // if data is available on hardwareserial port ==> data is comming from PC or notebook
Sim900Serial.println(Serial.read()); // write it to the GPRS shield
}
void clearBufferArray() // function to clear buffer array
{
for (int i=0; i<count;i )
{ buffer*=NULL;} // clear all index of array with command NULL*
}
void Sim900_Inti(void)
{

  • Sim900Serial.println(“AT CMGF=1”); // Set GSM shield to sms mode*
  • Serial.println(“AT CMGF=1”);*
  • delay(500);*
  • Sim900Serial.println(“AT CNMI=2,2”);*
  • Serial.println(“AT CMGF=1”);*
  • delay(500);*
    }
    void Cmd_Read_Act(void) //Function reads the SMS sent to SIM900 shield.
    {
  • char buffer2[64];*
  • for (int i=0; i<count;i )*
    { buffer2_=char(buffer*);} *_

* if (strstr(buffer2,“INSTRUCTABLES”)) //Comparing password entered with password stored in program *
* {*
* Serial.println(“Password Authenticated.”);*
* Serial.println("Sending reply SMS. ");*
* SendTextMessage(); *
* }*

}
void SendTextMessage()
{

Sim900Serial.print(“AT CMGF=1\r”); //Sending the SMS in text mode
delay(100);
Sim900Serial.println(“AT CMGS = “**********””);//The predefined phone number
delay(100);
Sim900Serial.println(“Please wait while Module calculates position”);//the content of the message
delay(100);
Sim900Serial.println((char)26);//the ASCII code of the ctrl z is 26
delay(100);
Sim900Serial.println();
int counter=0;
GPS.listen();
for (;:wink:
{
* long lat, lon;*
* unsigned long fix_age, time, date, speed, course;
_ unsigned long chars;_
unsigned short sentences, failed_checksum;
_ long Latitude, Longitude;*_

* // retrieves /- lat/long in 100000ths of a degree*
* gps.get_position(&lat, &lon, &fix_age);
_ getGPS();
Serial.print("Latitude : “);
Serial.print(LAT/1000000,7);
Serial.print(” :: Longitude : ");
Serial.println(LON/1000000,7);
if (LAT == 0 && LON == 0)
{
continue;
}
counter ;
if (counter<30)
{
continue;
}*_

* Sim900Serial.print(“AT CMGF=1\r”); //Sending the SMS in text mode*
* delay(100);*
_ Sim900Serial.println("AT CMGS = """);//The predefined phone number_
_ delay(100);

Sim900Serial.print("Latitude : ");

Sim900Serial.print(LAT/1000000,7);

Sim900Serial.print(" :: Longitude : ");

Sim900Serial.println(LON/1000000,7);//the content of the message

* delay(100);
Sim900Serial.println((char)26);//the ASCII code of the ctrl z is 26*
* delay(100);
Sim900Serial.println();
counter=0;
break;
}
}
void getGPS()
{
bool newdata = false;
unsigned long start = millis();
while (millis() - start < 1000)
{
if (feedgps ())
{
newdata = true;
}
}
if (newdata)
{
gpsdump(gps);
}
}
bool feedgps()
{
while (GPS.available())
{
if (gps.encode(GPS.read()))
return true;
}return 0;
}
void gpsdump(TinyGPS &gps)
{_
gps.get_position(&lat, &lon);
_ LAT = lat;
LON = lon;
{
feedgps();
}
}*
We followed all the steps given but we are not receiving any sms of the location of the device. Do you have any suggestions? Please help.
Thanks!_

Hi,
Can you please post a copy of your sketch, using code tags?
They are made with the </> icon in the reply Menu.
See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

If your sketch is too big, use REPLY rather than QUICK REPLY and it has an attachment facility, so you can post your sketch as an attachment, but try code tags first.

Tom… :slight_smile:

Hi, Do you know if your GPS is working for a start? What appears in the monitor window of the IDE?

Tom.... :) I hope you are not running it with the 7805 regulators circuit that it includes. DO NOT USE THAT 7805 PARALLEL circuit, it is destructive and if it fails, and it will, you will end up with 12V on the 5V line, all your hardware will go up in smoke.