Compare commits

...

8 Commits

7 changed files with 49 additions and 9 deletions

View File

@ -1,3 +1,10 @@
# This configuration comes from
# https://wiki.alpinelinux.org/wiki/Chrony_and_GPSD with socket address
# corrected since I had difficulties understanding the manual in a hurry.
# My hardware: ALTHA G-Mouse GPS \n Model GGM308
# Untested suspicion due to rain: it will not announce itself to computer
# or lsusb until it has GPS fix?
refclock SHM 0 poll 3 refid GPS1
# unlikely to work with usb
refclock SHM 1 refid GPS2

View File

@ -1,7 +1,10 @@
# Attempt to use beacondb.net with geoclue. However as I use Sway and I
# don't use .desktop files, nothing has permission to access geoclue and I
# have thus disabled it, but maybe on Plasma, family PC, or just in case this
# should be noted.
# https://beacondb.net & https://beacondb.net/map
[wifi]
enable=true
url=https://beacondb.net/v1/geolocate
# Contributing back
submit-data=true
submission-url=https://beacondb.net/v2/geosubmit
# I doubt this is used, but explicitly set just in case of it suddenly
# becoming $(whoami)
submission-nick=geoclue

View File

@ -0,0 +1,4 @@
[network-nmea]
enable=true
# Refer to ../../systemd/system/gpsd.service.d/aminda-additions.conf
nmea-socket=/var/run/gps-share.sock

View File

@ -1,4 +1,12 @@
# https://positon.xyz
# WARNING: Not held in high regard by GrapheneOS.
# https://grapheneos.org/articles/positon-location-service
[wifi]
enable=true
# https://github.com/microg/GmsCore/issues/2237#issuecomment-2169193229
url=https://api.positon.xyz/?key=74600654-2aec-11ef-aa95-3b7218da6865
# Contributing back
submit-data=true
submission-url=https://api.positon.xyz/v2/geosubmit?key=74600654-2aec-11ef-aa95-3b7218da6865
# Explicitly set just in case of it suddenly becoming $(whoami)
submission-nick=geoclue

View File

@ -2,6 +2,8 @@
# Remember https://wiki.openstreetmap.org/wiki/Precision_of_coordinates
# and https://m.xkcd.com/2170/ !
# Finland: 4 decimal points with radius of 20 metres circles buildings.
# Kotka
60.45 # Latitude (positive values mean north, negative south)
26.94 # Longitude (positive values mean east, negative west)
@ -15,5 +17,4 @@
#2000 # Accuracy radius in metres
# For extra security:
# sudo chown geoclue /etc/geolocation
# sudo chmod 600 /etc/geolocation
# sudo chown geoclue:geoclue /etc/geolocation;sudo chmod 600 /etc/geolocation

View File

@ -1 +1,3 @@
# This is an EnvironmentFile for gpsd.service specified in
# $PWD/systemd/system/gpsd.service.d/aminda-additions.conf
#AMINDAGPSD=""

View File

@ -1,10 +1,25 @@
# As usual this is a systemd drop-in, so I can adjust what gpsd.service does
# without having to fight with package management.
[Service]
Type=exec
# In case the file exists, I can throw my own additional options there
EnvironmentFile=-/etc/gpsd.aminda.conf
ExecStart=
# PRIVACY WARNING! --listenany happily allows anyone to ask where the host is
# Kernel module possibly required for USB GPS devices especially with Chrony?
ExecStartPre=-/usr/sbin/modprobe pps_ldisc
ExecStart=/usr/sbin/gpsd /dev/gps0 --listenany --nowait --foreground $AMINDAGPSD
# Handle failure situation of the socket not going away (ExecStartPost=)
ExecStartPre=-/usr/bin/rm -vf /var/run/gps-share.sock
# Empty ExecStart= before the actual ExecStart= removes the original
# ExecStart= line
ExecStart=
ExecStart=/usr/sbin/gpsd /dev/gps0 --nowait --foreground $AMINDAGPSD
# Creating a socket for geoclue to connect to
# Credit: @schnell at https://gitlab.freedesktop.org/geoclue/geoclue/-/issues/145#note_1772702
ExecStartPost=/bin/sh -c "(sleep 5 && gpspipe --nmea | ( read; read; read; cat ) | ncat --verbose --keep-open --listen --unixsock /var/run/gps-share.sock&)"
# In case of clean shutdown, remove the socket for restart
ExecStopPost=-/usr/bin/rm -vf /var/run/gps-share.sock
# Missing from the original unit, will reconnect all GPS says man gpsd
ExecReload=/usr/bin/killall -HUP gpsd
# Avoiding systemd considering the unit as failed.
Restart=always
RestartSec=5s
# vim: filetype=systemd