pberrett
Posts: 51
Joined: Sun Jan 29, 2012 1:44 pm

GPS problem solved

Tue Feb 05, 2013 11:48 am

Hi all

As many of you would be aware I have been trying to get my bu-353 GPS mouse to work with my modem B raspberry Pi. Thanks to the help of Dan Mandle, rst and others i have succeeded. There were 2 things I was trying to achieve

1. Get my Pi's clock set from the GPS and
2. Have a python script I could modify that would bring the GPS details (eg latitude, longitude) into python variables.

I am writing this so that others will find it a bit easier to setup and hopefully use as a basis for their projects.

First up the GPS is plugged into the Pi through a usb plug. You can pick the GPSs off Ebay at a relatively low price. I found mine even worked indoors.

1. Getting GPSD installed

I followed Dan Mandle's instructions here

http://blog.retep.org/2012/06/18/gettin ... pberry-pi/

up to "Next we need to start the daemon:"

At this point I did

sudo dpkg-reconfigure /etc/gpsd

to set gpsd to automatically boot. I added -n in the options but didn't put in /dev/ttyUSB0 as the port but rather left it to automatically find the USB plug.

I then manually edited GPSD and added in

chmod a+rw /dev/ttyUSB0 at the beginning

when I ran cgps -s or xgps I now got location text or a visual display of the satellites.

2. Setting the system time

There is a python module called Gpstime which you can get here

http://code.google.com/p/gpstime/

I unpacked it into my /Pi directory and there was a subdirectory with a number of files.

Important; Delete the gps.py script in the subdirectory

gps.py should already have been installed with GPSD so you don't want two python scripts with the same name otherwise bad things will happen.

To set the system time from the gps just run the gpstime script.

3. Reading the GPS variables

Dan Mandle has a useful script which prints out the various GPS variables

http://www.danmandle.com/blog/getting-g ... th-python/

Copy that to your Pi and run it and you should see the data. It can be modified for other uses.

Thanks again to everyone who got me this far. Now onto interfacing my compass!.

cheers Peter

tdunn599
Posts: 3
Joined: Mon Dec 09, 2013 4:53 pm

Re: GPS problem solved

Thu Jun 23, 2016 6:11 pm

Hi,

The address for Dan Mandle's scripts is not usable:
http://www.danmandle.com/blog/getting-g ... th-python/

Can someone send me the correct address?

Thanks, tdunn599@yahoo.com

User avatar
B.Goode
Posts: 10191
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: GPS problem solved

Thu Jun 23, 2016 8:39 pm

The link in the previous post works for me, but I'll repost it here in case it helps: http://www.danmandle.com/blog/getting-g ... th-python/

User avatar
bensimmo
Posts: 4577
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: GPS problem solved

Sun Jun 26, 2016 2:18 pm

Thanks for the GPStime hint, up that will hopefully easy something for me when out away from WiFi to add correct time to our logging.

I use pynmea2 to collect data from gps messages.

DavidGMX
Posts: 9
Joined: Sun Jun 19, 2016 2:30 pm

Re: GPS problem solved

Wed Jul 06, 2016 9:25 am

Hi,all

There is a cheap but powerful Lora/GPS HAT for your projects,you can get the example about "Getting GPS to work on a Raspberry Pi" from this link: http://wiki.dragino.com/index.php?title ... spberry_Pi

Image

Hope it help to the people who need it!

Cheers!

User avatar
bensimmo
Posts: 4577
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: GPS problem solved

Wed Jul 06, 2016 7:11 pm

It's a shame the camera hole is not there and the a antenna connectors stick out the side and not over the USB port area and so keeping it within the dimensions. Nice idea though.
I'm width limited so no use to me.

The instructions, from experience, are out of date for current Raspian setups, that seems to be the way I did it under Wheezy?

Return to “Python”