Configure Usb GPS
Fairly easy to install and get working. Making the start up processes work is the slightly tricky part. I had a Prolific GPS with Usb cable attached. I am doing this on a Raspberry Pi with Rasbian installed.
First, check if you have your GPS plugged in and recognising by typing following into your terminal:
lsusb
Result should show (for current used GPS):
ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Do the installation:
apt-get update apt-get install gpsd gpsd-clients python-gps
Testing GPS is working
Once installed, run this process to confirm you are receiving data. Confirm your GPS device is recognizing by:
tail -500 /var/log/syslog | grep usb
Should produce result like this…
Jan 29 02:03:00 piferry kernel: [ 3.606171] usb 1-1.3: new full-speed USB device number 5 using dwc_otg Jan 29 02:03:00 piferry kernel: [ 3.738658] usb 1-1.3: New USB device found, idVendor=067b, idProduct=2303 Jan 29 02:03:00 piferry kernel: [ 3.756046] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 Jan 29 02:03:00 piferry kernel: [ 3.764968] usb 1-1.3: Product: USB-Serial Controller D Jan 29 02:03:00 piferry kernel: [ 3.786039] usb 1-1.3: Manufacturer: Prolific Technology Inc. Jan 29 02:03:00 piferry kernel: [ 7.803436] usbserial: USB Serial support registered for pl2303 Jan 29 02:03:00 piferry kernel: [ 7.921070] usb 1-1.3: pl2303 converter now attached to ttyUSB0
As you can see, results show my GPS device is set to ttyUSB0. Run below to test the GPS is receiving data
killall gpsd gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock cgps -s
(-s makes sure the GPS produces only processed data not just raw data)
The above code kills all programs running for gpsd by default then directs where your GPS receiver is located and what socket file to direct to. It then runs the program to test we are receiving information.
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqklqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x Time: 1995-06-15T02:12:06.000Z xxPRN: Elev: Azim: SNR: Used: x x Latitude: 16.936993 S xx x x Longitude: 145.772012 E xx x x Altitude: 2.8 m xx x x Speed: 0.4 kph xx x x Heading: 180.0 deg (true) xx x x Climb: 2.2 m/min xx x x Status: 3D FIX (0 secs) xx x x Longitude Err: +/- 8 m xx x x Latitude Err: +/- 9 m xx x x Altitude Err: +/- 37 m xx x x Course Err: n/a xx x x Speed Err: +/- 68 kph xx x x Time offset: 619315200.770 xx x x Grid Square: QH23vb xx x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
If this is producing information and NOT timing out, that means the GPS is installed correctly.
Configure Startup
To add the device location when the daemon starts on boot, Add the following to /etc/rc.local;
# Starts GPS on boot killall gpsd gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock
Test this by restarting the server and then running;
cgps -s
You should have a working gps on startup!!!
Good links on:
- http://learn.adafruit.com/downloads/pdf/adafruit-ultimate-gps-on-the-raspberry-pi.pdf
- http://ava.upuaut.net/?p=600
- http://www.pihomeserver.fr/en/2013/11/15/raspberry-pi-home-server-connecter-un-gps/
- http://blog.iteadstudio.com/a-huge-wave-of-raspberry-pi-shields-is-coming-soon/
- http://www.adafruit.com
- http://www.catb.org/gpsd/troubleshooting.html