Skip to content

RaspberryPi library for interfacing with GPS hardware

Notifications You must be signed in to change notification settings

LanVukusic/RaspiGPS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RaspiGPS 📡

RaspberryPi GPS library written in Go for interfacing with GPS serial hardware

This is a library that was written to work with any serial enabled gps module. I only had an option to test the Neo 8 gps, but it should work with any NMEA compliant device. It was written for a series of serial enabled extension boards available from Aliexpress.
Please leave a star if you end up using this library. It means a lot to me. ⭐

Hardware list:

Tested hardware:

Probably working hardware:
All serial and Nmea compliant GPS modules

  • Probably all Ublox series gps
  • Contact me if you find that your device works

Installation:

go get github.com/LanVukusic/RaspiGPS

Pinout:

Pins on the raspberry are labeled according to the diagram below, referenced with numbers from 1 to 40

  • PIN 8 serial TX (gpio15) - gps RX
  • PIN 10 serial RX (gpio14) - gps TX

Library is dependent on an external library:

Here is a sample code which connects and recieves data from a gps module.

package main

import (
	"fmt"
	"time"

	"github.com/LanVukusic/RaspiGPS/gps"
)

var a gps.Neo8

func main() {
	// replace "/dev/serial0" with the serial interface you are using
	a.Init("/dev/serial0")

	for {
		time.Sleep(1 * time.Second)
		fmt.Printf("Position: %g %s, %g %s with %d satelites\n", a.Lat, a.NS, a.Lng, a.WE, a.SatTracking)
	}

}

Following functions are available:

Name DataType Description
Lat float64 Latitude
NS string North / South part of latitude
Lng float64 Longitude
WE string West / East part of Longitude
Fix uint64 GPS fix type; described below
SatTracking uint64 Number of satellites used in tracking
SatInView uint64 Number of satellites in view
Hdop float64 Horizontal dilution of precision aka accuracy on land.[meters]
Alti float64 Altitude above sea level [meters]
TrueTrack float64 Heading track [degrees azimuth]
GroundSpeedKmh float64 Speed above ground in [Km/h]
SNR float64 Signal to noise ratio

GPS fix types: 0 = invalid 1 = GPS fix (SPS) 2 = DGPS fix 3 = PPS fix 4 = Real Time Kinematic 5 = Float RTK 6 = estimated (dead reckoning) (2.3 feature) 7 = Manual input mode 8 = Simulation mode

About

RaspberryPi library for interfacing with GPS hardware

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages