0 Replies Latest reply: Feb 5, 2013 5:52 AM by vk3pb RSS

GPS Problem solved (Pi + BU-353)


The following is reproduced from a post I placed in the Raspberry Pi forums. Folks here may get some benefit from it also.



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




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