GPSd provides a human readable and HTTP interface about GPS-device informations.
_/!\ Work in progress /!_
Tested with this GPS Module cover L80 gps protocol specification v1.0.pdf.
- Read GPS message from USB-Serial device like
/dev/ttyUSBx
. - Auto-detect GPS device mode (hot-plug like udev or lookup existing device).
- Provide HTTP API to get GPS informations and state.
go get github.com/pilebones/go-gpsd
go test ./...
go build
./go-gpsd -help
-autodetect
Allow to enable auto-detection of the GPS device (already plugged or hot-plugged)
-autodetect-timeout duration
Time spent to try to autodetect the GPS device (exit 2 if fail) (default 5s)
-input string
Char device path related to the serial port of the GPS device (default "/dev/ttyUSB0")
-target string
HTTP listener to get GPS state (default "127.0.0.1:1234")
-timeout duration
Max duration allowed to read and parse a GPS sentence from serial-port (default 5s)
Note: you should run binary by user with elevated privileges to have access to /dev kernel struct.
To auto-detect GPS device and handle GPS message:
(sudo) ./go-gpsd -autodetect
Don't hesitate to notice if you detect a problem with this tool or library.
go-udev is available under the GNU GPL v3 - Clause License.