peter145
Posts: 54
Joined: Wed Dec 04, 2013 3:48 pm

Re: How to Setup GPS Module and Use it as a Geolocator?

Fri Dec 20, 2013 1:17 am

ame wrote:That's fantastic!

The first photo tells you everything you need to know. It shows you the following things:

1) The module has power
2) The module is running
3) You have successfully wired the serial data lines
4) You have successfully taken control of the serial port
5) You have the correct baud rate

The most important thing is the line that starts $GPRMC. The third field is "V" which means there is no satellite fix. It's working perfectly!

Do the same thing (ignore gpsd for now) and put the GPS module near a window. The GPS signal is too weak to work well indoors. If you can get a signal through the window then when you watch the screen eventually you will see latitude and longitude results. The third field of the $GPRMC sentence will change to "A" which means there is enough satellite information for a valid lat/lon fix.

When that is working, try gpsd.
do I have to have a SkyView with my gps? I've waited for 40+ minutes and it only said Caught signals 2.... so I need 3 or 4 right?

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: How to Setup GPS Module and Use it as a Geolocator?

Fri Dec 20, 2013 1:34 am

Yes you do, but you're not there yet. You have successfully connected the module but it is not getting satellite data. Have you put it in the window? Are there tall buildings outside your window? The GPS module needs a clear view of as much of the sky as possible to work well.

When you get "A" in the $GPRMC sentence you are ready to roll.

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: How to Setup GPS Module and Use it as a Geolocator?

Fri Dec 20, 2013 1:41 am

Try xgps instead of cgps. It is a graphical viewer and might show things more nicely.

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: How to Setup GPS Module and Use it as a Geolocator?

Fri Dec 20, 2013 3:03 am

Actually cgps has a 'sky view'. The panel on the right, with the heading "PRN ELEV AZIM SNR USED" is showing you a list of satellites 'in view'. In your picture the list is empty because you can't see any satellites. I suspect that the device is on your desk and not near a window.

You have to imagine the position of the satellites. ELEV will give you the angle above the horizon, and AZIM will give you the bearing from true north. Other programs just take the same data and try to draw a dot representing the position of the satellite.

peter145
Posts: 54
Joined: Wed Dec 04, 2013 3:48 pm

Re: How to Setup GPS Module and Use it as a Geolocator?

Fri Dec 20, 2013 4:35 am

ame wrote:Actually cgps has a 'sky view'. The panel on the right, with the heading "PRN ELEV AZIM SNR USED" is showing you a list of satellites 'in view'. In your picture the list is empty because you can't see any satellites. I suspect that the device is on your desk and not near a window.

You have to imagine the position of the satellites. ELEV will give you the angle above the horizon, and AZIM will give you the bearing from true north. Other programs just take the same data and try to draw a dot representing the position of the satellite.
It's near a window but we have a terrace so its block again :(

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: How to Setup GPS Module and Use it as a Geolocator?

Fri Dec 20, 2013 4:41 am

Ok, well I suspect that is the reason for getting no data. The satellites move, so if you can see a little bit of the sky you might get a short burst of data from one satellite as it moves through your field of view, but you need several satellites in view to get a lat/lon fix. Maybe you'll have to go outside or onto the roof, so you'll have to solve the problem of making the Pi transportable, which I assume you were going to do in the future anyway.

I think it's all quite exciting, and I am looking forward to your next post.

peter145
Posts: 54
Joined: Wed Dec 04, 2013 3:48 pm

Re: How to Setup GPS Module and Use it as a Geolocator?

Mon Dec 23, 2013 12:13 pm

ame wrote:Ok, well I suspect that is the reason for getting no data. The satellites move, so if you can see a little bit of the sky you might get a short burst of data from one satellite as it moves through your field of view, but you need several satellites in view to get a lat/lon fix. Maybe you'll have to go outside or onto the roof, so you'll have to solve the problem of making the Pi transportable, which I assume you were going to do in the future anyway.

I think it's all quite exciting, and I am looking forward to your next post.
Good news!

My GPS got a signal from 7-10 satellites the trick was I attached my gps antenna on a roof of our Study lounge haha..

man it worked wonders! last week friday was our project design 75% checking and it WORKED Thanks man
I used CGPS and foxtrotgps for GUI now for sending it to google maps.

And regarding making it mobile I discovered a USB port rechargable battery which has 5v and 2800mAH of power so transportability wont be an issue except for the internet signals used but its all hardware stuff... so yeah thanks again so much

I'm currently helping my other classmate who have similar problems with their gps module

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: How to Setup GPS Module and Use it as a Geolocator?

Mon Dec 23, 2013 1:16 pm

Excellent! That's fantastic news. And I am glad you are now in a position to help the others. Good job!

peter145
Posts: 54
Joined: Wed Dec 04, 2013 3:48 pm

Re: How to Setup GPS Module and Use it as a Geolocator?

Thu Dec 26, 2013 3:44 am

ame wrote:Excellent! That's fantastic news. And I am glad you are now in a position to help the others. Good job!
Thanks man... now for the GUI part any tips on how to forward the GPSD data through http and then displayed on google maps?

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: How to Setup GPS Module and Use it as a Geolocator?

Thu Dec 26, 2013 4:16 am

peter145 wrote:
ame wrote:Excellent! That's fantastic news. And I am glad you are now in a position to help the others. Good job!
Thanks man... now for the GUI part any tips on how to forward the GPSD data through http and then displayed on google maps?
I'll help you with your homework, but I won't do your homework for you. :)

There are thousands of examples on the web. Choose one and copy it, or break down the problem into small parts and solve each part yourself.

My first tip is that you are going to have to have a database somewhere. The 'moving' Pi with GPS attached will send time and position reports back to the database server over Wifi. The database server will store the series of reported positions. The client program will query the database for the last reported position, to plot a single point on the map. Or the client will request a list of earlier positions to draw a line representing the past movements of the Pi.

Good luck.

peter145
Posts: 54
Joined: Wed Dec 04, 2013 3:48 pm

Re: How to Setup GPS Module and Use it as a Geolocator?

Thu Dec 26, 2013 4:24 am

ame wrote:
peter145 wrote:
ame wrote:Excellent! That's fantastic news. And I am glad you are now in a position to help the others. Good job!
Thanks man... now for the GUI part any tips on how to forward the GPSD data through http and then displayed on google maps?
I'll help you with your homework, but I won't do your homework for you. :)

There are thousands of examples on the web. Choose one and copy it, or break down the problem into small parts and solve each part yourself.

My first tip is that you are going to have to have a database somewhere. The 'moving' Pi with GPS attached will send time and position reports back to the database server over Wifi. The database server will store the series of reported positions. The client program will query the database for the last reported position, to plot a single point on the map. Or the client will request a list of earlier positions to draw a line representing the past movements of the Pi.

Good luck.
What Im planning to do is use the PHP code and HTML code UI from this : http://www.cooking-hacks.com/documentat ... rry-pi#gps

And use the GPSD from adafruit to pass it on my domain through port 2947 : http://learn.adafruit.com/adafruit-ulti ... g-your-gps

Any suggestions if I do it this way?

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: How to Setup GPS Module and Use it as a Geolocator?

Thu Dec 26, 2013 4:36 am

Ok, well all you need is the send_HTTP() function in the Arduino code, and the PHP code. You don't need all the modem control stuff for the GPRS module. You do need something that will check if the Pi is connected to the internet, and if it's moving around you need something that will always try to connect to any open Wifi.

The PHP script does not use a database. It just stores the data in a flat file. You can use a database later if you want.

I suggest you try and make the cooking hack work, then write something that does what *you* want.

peter145
Posts: 54
Joined: Wed Dec 04, 2013 3:48 pm

Re: How to Setup GPS Module and Use it as a Geolocator?

Thu Dec 26, 2013 4:50 am

ame wrote:Ok, well all you need is the send_HTTP() function in the Arduino code, and the PHP code. You don't need all the modem control stuff for the GPRS module. You do need something that will check if the Pi is connected to the internet, and if it's moving around you need something that will always try to connect to any open Wifi.

The PHP script does not use a database. It just stores the data in a flat file. You can use a database later if you want.

I suggest you try and make the cooking hack work, then write something that does what *you* want.
By the way : how do you program in raspberry pi python?I'm such a newbie in python

Can I Use the ADA fruit to send the data through http Im using WEBIde for programming it through the terminal using Putty:

http://learn.adafruit.com/adafruit-ulti ... g-your-gps

import gps

# Listen on port 2947 (gpsd) of localhost
session = gps.gps("localhost", "2947")
session.stream(gps.WATCH_ENABLE | gps.WATCH_NEWSTYLE)

while True:
try:
report = session.next()
# Wait for a 'TPV' report and display the current time
# To see all report data, uncomment the line below
# print report
if report['class'] == 'TPV':
if hasattr(report, 'time'):
print report.time
except KeyError:
pass
except KeyboardInterrupt:
quit()
except StopIteration:
session = None
print "GPSD has terminated"

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: How to Setup GPS Module and Use it as a Geolocator?

Thu Dec 26, 2013 5:19 am

peter145 wrote:
By the way : how do you program in raspberry pi python?I'm such a newbie in python
Write your program in an editor. Execute it with "python programname.py".

Can I Use the ADA fruit to send the data through http Im using WEBIde for programming it through the terminal using Putty:

http://learn.adafruit.com/adafruit-ulti ... g-your-gps
Do you understand what that code does, and how it works?

peter145
Posts: 54
Joined: Wed Dec 04, 2013 3:48 pm

Re: How to Setup GPS Module and Use it as a Geolocator?

Thu Dec 26, 2013 5:32 am


Do you understand what that code does, and how it works?
I just reviewed it... yeah my bad it does not do http file transferring...

I just reviewed the cooking hacks code... I think my gps doesnt support at commands...

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: How to Setup GPS Module and Use it as a Geolocator?

Thu Dec 26, 2013 5:36 am

peter145 wrote:

Do you understand what that code does, and how it works?
I just reviewed it... yeah my bad it does not do http file transferring...

I just reviewed the cooking hacks code... I think my gps doesnt support at commands...
Indeed it does not. The AT commands are for the GPRS modem. I already told you you don't need the GPRS stuff.

You need to think about the problem you are trying to solve. In small pieces. Solve each piece and then the whole problem will magically solve itself.

peter145
Posts: 54
Joined: Wed Dec 04, 2013 3:48 pm

Re: How to Setup GPS Module and Use it as a Geolocator?

Thu Dec 26, 2013 5:53 am

ame wrote:
peter145 wrote:

Do you understand what that code does, and how it works?
I just reviewed it... yeah my bad it does not do http file transferring...

I just reviewed the cooking hacks code... I think my gps doesnt support at commands...
Indeed it does not. The AT commands are for the GPRS modem. I already told you you don't need the GPRS stuff.

You need to think about the problem you are trying to solve. In small pieces. Solve each piece and then the whole problem will magically solve itself.
so first:
1. Create python command to get GPS data from gpsd
2. Send data through http using send_gps wire-protocol?
3.Make UI and Php Code for data received (Google Maps APi)

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: How to Setup GPS Module and Use it as a Geolocator?

Thu Dec 26, 2013 5:59 am

peter145 wrote: so first:
1. Create python command to get GPS data from gpsd
2. Send data through http using send_gps wire-protocol?
3.Make UI and Php Code for data received (Google Maps APi)
Sounds like a plan. Try it. If it doesn't work, then try something else.

I'd split 3 into 3a and 3b.

3a collect data sent by Pi
3b make UI to overlay data in Google Maps

peter145
Posts: 54
Joined: Wed Dec 04, 2013 3:48 pm

Re: How to Setup GPS Module and Use it as a Geolocator?

Thu Dec 26, 2013 6:24 am

ame wrote:
peter145 wrote: so first:
1. Create python command to get GPS data from gpsd
2. Send data through http using send_gps wire-protocol?
3.Make UI and Php Code for data received (Google Maps APi)
Sounds like a plan. Try it. If it doesn't work, then try something else.

I'd split 3 into 3a and 3b.

3a collect data sent by Pi
3b make UI to overlay data in Google Maps
Merry Christmas by the way :)

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: How to Setup GPS Module and Use it as a Geolocator?

Thu Dec 26, 2013 6:29 am

peter145 wrote: Merry Christmas by the way :)
You too.

Return to “General discussion”