gpstime

package module
v0.1.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

README

OVERVIEW

Go Reference Go Report Card Go Build

paepcke.de/gpstime

  • needs go1.20 (currently:rc-status) to compile (sorry)
  • set local system time from usb gps dongle (nmea mode)
  • set local site coord information from usb gps dongle
  • focus on embedded systems, environmental friendly systems
  • focus on low energy use and secure and relyable operation
  • not the right choice for sub second critical applications (!)
  • 100% pure go, minimal(internal-only) imports
  • use as app or api (see api.go)

INSTALL

go install paepcke.de/gpstime/cmd/gpstime@latest
DOWNLOAD (prebuild)

github.com/paepckehh/gpstime/releases

SHOWTIME

set time

gpstime
Apr 25 06:50:25 rpi2b32-pnoc gpstime[49152]:  ### INFORMAL ### LARGE [initial] TIMEJUMP ### TRYING FAST FORWARD 
Apr 25 06:53:02 rpi2b32-pnoc gpstime[49152]: srv  time: 2022-04-25 06:53:02 +0000 UTC 
Apr 25 06:53:02 rpi2b32-pnoc gpstime[49152]: loc  time: 2022-04-25 06:50:25.734559739 +0000 UTC m=+1.230512813 
Apr 25 06:53:02 rpi2b32-pnoc gpstime[49152]: diff time: 2m36.265440261s 

set localtion

gpstime location /dev/gps0
cat /var/gps/.location]
#!/bin/sh
export GPS_MODE="gpstime"
export GPS_LAT="53.56409"
export GPS_LONG="9.95747"
export GPS_ELEVATION="0"
export AIRLOCTAG="128@X3UR-KY-LURRJI-UJ-DXHY"
export GPS_SUN_RISE="03:02:02"
export GPS_SUN_SET="19:33:42"
export GPS_SUN_NOON="11:17:24"
export GPS_SUN_DAYLIGHT="16h31m40s"

DOCS

pkg.go.dev/paepcke.de/gpstime

CONTRIBUTION

Yes, Please! PRs Welcome!

Documentation

Overview

package gpstime ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSetClock

func CheckSetClock(device string)

CheckSetClock anligns continusly the local system to to gpsDevice time

func CheckSetClockD

func CheckSetClockD(dev *gpsfeed.GpsDevice)

CheckSetClockD ...

func CheckSetClockLocation

func CheckSetClockLocation(device string)

CheckSetClockLocation updates the local system time to gpsDevice time and location env file ( when needed ) in a loop

func CheckSetClockLocationD

func CheckSetClockLocationD(dev *gpsfeed.GpsDevice)

CheckSetClockLocationD ...

func CheckSetClockOnce

func CheckSetClockOnce(device string)

CheckSetClockOnce sets the clock to gpsDevice time and exists

func CheckSetClockOnceD

func CheckSetClockOnceD(dev *gpsfeed.GpsDevice)

CheckSetClockOnceD ...

func GetTime

func GetTime(device string) time.Time

GetTime get a single timestamp

func GetTimeD

func GetTimeD(dev *gpsfeed.GpsDevice) time.Time

GetTimeD ...

func Out

func Out(msg string)

Out ...

func WriteLocationFile

func WriteLocationFile(device string)

WriteLocationFile reads gps nmea frames from a gps device and writes the current location as unix shell env include

func WriteLocationFileD

func WriteLocationFileD(dev *gpsfeed.GpsDevice)

WriteLocationFileD ...

func WriteLocationFileOnceD

func WriteLocationFileOnceD(dev *gpsfeed.GpsDevice)

WriteLocationFileOnceD ...

Types

type Coord

type Coord struct {
	Valid                bool
	Lat, Long, Elevation float64
}

Coord is an gps coordinates point

func GetLocation

func GetLocation(device string) Coord

GetLocation gets single location stamp (lat, long, elevation)

func GetLocationD

func GetLocationD(dev *gpsfeed.GpsDevice) Coord

GetLocationD ...

Directories

Path Synopsis
cmd
package gpsfeed
package gpsfeed

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL