gps tracking project

Ask - Discuss - Share everything about your code in embedded for your projects. Processing, Embedded C, Fritzing...
rickyverma
Posts: 4
Joined: Mon May 14, 2012 1:13 pm

gps tracking project

Postby rickyverma » Mon May 14, 2012 1:24 pm

Currently working on project called vehicle tracking project for my collage project. In which I need to send gps data to php script using gprs connection.

I am totally new to the gsm/gprs concept currently what I am trying to do in the project.

When device starts checks if gps data is available. Connect to php script and pass the data to the php script.

Like http://website/gps.php?imei=’’&pwd=’’&nmea=’’;

This is a first part of the project in second part

Check if the mobile password and mobile number 1 ,2 are changed in database then store the new ones in sim.

This is the final part of the project

I need to read the sms received from the authorized mobile number stored by script in sim. And enable disable Arduino pins. Delete sms after reading it. And when requested by the authorized mobile number send device gps location to mobile.

I have already down the php part in which I am storing the NMEA statement in mysql using php. I am stuck with the micro controller part.

Currently I am using a Arduino uno + sparkfun gps retail kit + simcom900 module
rickyverma
Posts: 4
Joined: Mon May 14, 2012 1:13 pm

Re: gps tracking project

Postby rickyverma » Tue May 15, 2012 12:53 pm

i am uploading the image of gsm/ gprs module how module is wired to arduino
Attachments
sim900.gif
sim900.gif (49.77 KiB) Viewed 4483 times
abhimanyu
Posts: 94
Joined: Tue Oct 18, 2011 9:49 pm

Re: gps tracking project

Postby abhimanyu » Mon May 21, 2012 10:45 am

There is a wealth of resources available at the page from Seeed Studio's GPRS Shield.

Also, there is a link to the Module's library at: ITead Studio. [Direct Link to the Library: here]
rickyverma
Posts: 4
Joined: Mon May 14, 2012 1:13 pm

Re: gps tracking project

Postby rickyverma » Mon Jul 09, 2012 2:30 pm

simcom900 module, but I am facing few problems.
1. Let suppose if in the output we see that data is sent 3 times to the php script. But only one time I can see the entry posted in the database or the site vaster history. I am unable to understand why only one entry is inserted while request is sent 3 times.
2. Script is not stable I mean that once I turn on the device and one entry is posted to the php script. I have to turn of the device and restart it to make it post again but second time I star getting errors. From the script in the output.

There are 2 scripts I am trying to use to make thinks work but getting kicked back by each one.
Script 1: gprs_june_27.pde this script I created by using an example from internet
Script2: basicGPRS.pde this script is an example from the advance gprs library I found on the internet.

I am able to post data to php script using both scripts but both scripts are giving me problem about gprs connection most of the time.( like if I start the device infornt of somebody to show the demo of my project it should connect to the gprs and post the data first time. This is how I want but It’s what I am not getting out the script and I am unable to find any reason for the same. I am posting the result of the script along with the confirmation on the server side.

result.gif files show that time date , file accessed and data posted

Please help me out.
BasicGPRS.rar
(29.24 KiB) Downloaded 286 times
result.gif
result.gif (38.88 KiB) Viewed 4404 times
gprs_june_27.rar
(1.68 KiB) Downloaded 219 times
abhimanyu
Posts: 94
Joined: Tue Oct 18, 2011 9:49 pm

Re: gps tracking project

Postby abhimanyu » Mon Jul 09, 2012 6:36 pm

I am unable to understand why only one entry is inserted while request is sent 3 times.

If this is for the BasicGPRS.pde Sketch, then you will find a for loop in the void loop() function
which runs three iterations.

Code: Select all

  for (byte i = 0; i < 3; i++) {


Also, after

Code: Select all

  gsm.DisableGPRS();
your code runs infinitely.
Why do you require an endless loop while(1) in the void loop() function in BasicGPRS.pde sketch?

Code: Select all

 while (1){
    digitalWrite(13, HIGH);   // set the LED on
    delay(400);              // wait for a second
    digitalWrite(13, LOW);    // set the LED off
    delay(400);              // wait for a second
  }


Try removing it to see if your code works.
rickyverma
Posts: 4
Joined: Mon May 14, 2012 1:13 pm

Re: gps tracking project

Postby rickyverma » Tue Jul 10, 2012 3:45 am

its the sample code i got from the library i just changed the disabled the gsm.turnon() function as this function looks for the pins to be activated. rest is as it is. nothing is changed. for ref. i have also attached the advance gsm library with teh basicgprs file.
i also try'd removing the for loop and the while loop along with the gsm.disablegprs(); but script didnt work.
abhimanyu
Posts: 94
Joined: Tue Oct 18, 2011 9:49 pm

Re: gps tracking project

Postby abhimanyu » Tue Jul 10, 2012 11:43 am

Initially, i'd suggest you to change the code to following after gsm.DisableGPRS(); function.

Code: Select all

    gsm.DisableGPRS();       /* The code remains the same till now */
    digitalWrite(13, HIGH);   // set the LED on
    delay(400);              // wait for a second
    digitalWrite(13, LOW);    // set the LED off
    delay(400);              // wait for a second
}                            /* This closing bracket is for the void loop() function. */
 


You don't have to remove the for() loop completely. Just change the value from i<3 to something else, like, i<5 to see if the script runs for that amount of time.

Return to “Code”

Who is online

Users browsing this forum: No registered users and 1 guest