I would like to hookup a GPS receiver to my Pi so that I can:
- Get my geographical position
- Synchronise clock when not connected to network
What are my options? Will any hardware supported by gpsd work with the Pi?
I would go for a generic usb GPS receiver such as the BU-353
It works with the Raspberry Pi, just like a normal linux computer.
Most usb GPS receivers are just USB-to-Serial adapters that read the NMEA data from the GPS receiver. Look into pl2303 (many units i've seen use this particular chip) drivers, should be available.
You can also use GPIO and a traditional NMEA 0183 GPS receiver, but then you need to worry about power, and the prices are often higher. GPS antannas are common onboard boats and ships, and usually consume 12v.
The usb solution is cheaper.
The gps receiver I mentioned is compatible with gpsd.
sudo apt-get install gpsd gpsd-clients python-gps
This will install gpsd and related software. Check gps status with
To synchronize the clock with NTP, you need to install ntp.
sudo apt-get install ntp
See this blog post: http://blog.retep.org/2012/06/18/getting-gps-to-work-on-a-raspberry-pi/. It covers ntp in detail.
Useful GPS Module for Raspberry Pi Tutorial!
It’s got everything you want and more:
-165 dBm sensitivity, 10 Hz updates, 66 channels
5V friendly design and only 20mA current draw
Breadboard friendly + two mounting holes RTC battery-compatible
Built-in datalogging PPS output on fix
Internal patch antenna + u.FL connector for external active antenna
Fix status LED
…all for under $40!
If you do not want to use USB you can use TTL GPS recievers. Sparkfun does a very fast 50 channel GPS receiver but you can find other ones on eBay or other sites.
You can use this by disabling the serial console on the Pi and connect the receiver directly to the UART pins.
* Remember to check the voltages of the GPS device you are using