gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-users] GPSD -G Option Doesn't Always Work


From: B.W. Guffey
Subject: Re: [gpsd-users] GPSD -G Option Doesn't Always Work
Date: Tue, 16 May 2017 19:43:20 -0400

FWIW I'm using the -G option via systemd reliably on Arch (Arm) so long
as I do NOT enable the systemd socket.

 address@hidden cat /etc/gpsd
 # Default settings for gpsd.
 START_DAEMON="true"
 USBAUTO="true"
 OPTIONS="-G -n"
 PORT="2947"
 SOCKET="/var/run/gpsd.sock"
 DEVICES="/dev/ttyAMA0"

 $ cat /etc/systemd/system/multi-user.target.wants/gpsd.service
 [Unit]
 Description=GPS (Global Positioning System) Daemon
 #Requires=gpsd.socket
 After=chronyd.service
 
 [Service]
 EnvironmentFile=-/etc/gpsd
 ExecStart=/usr/sbin/gpsd -N $OPTIONS -P $PORT -F $SOCKET $DEVICES

 [Install]
 WantedBy=multi-user.target
 #Also=gpsd.socket

However I have to do things different on the client machines. 
Evidently a local gpsd instance won't listen to remote gpsd instances
directly.  Instead, I have to use socat and gpspipe to create a virtual
serial GPS, then point the local gpsd instance to that port.  I'm doing
this through a NetworkManager dispatcher script on the client machines.

$ cat /etc/NetworkManager/dispatcher.d/20-RemoteGPS
 #!/bin/sh
 ESSID="MyWiFiNetwork"

 interface=$1 status=$2
 case $status in
   up)
    if iwgetid | grep -qs ":\"$ESSID\""; then
       sudo socat exec:"'gpspipe -w rpi3-1:2947'"
PTY,link=/dev/gpsRMT0,raw &

       sleep 5
       sudo chown root:uucp /dev/gpsRMT0
       sudo chmod 0777 /dev/gpsRMT0
       sudo systemctl restart gpsd.service
     fi
     ;;
   down)
     sudo killall gpspipe
     ;;
 esac
 
It's cludgy but it works reliably.



On Tue, 2017-05-16 at 15:27 -0700, Gary E. Miller wrote:
> Yo Joshua!
> 
> On Tue, 16 May 2017 18:23:22 -0400
> "Joshua Quesenberry" <address@hidden> wrote:
> 
> > Systemd has worked really well so far. This issue crops up also
> > when
> > running gpsfake (unrelated to systemd) and this is the use case I'm
> > targeting currently. Seems that since two different methods of
> > starting gpsd are having the same outcome that there may be a bug
> > on
> > the gpsd side?
> 
> Can you put together a simple test for what you see, that does not
> use
> systemd?
> 
> RGDS
> GARY
> -------------------------------------------------------------------
> --------
> Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
>       address@hidden  Tel:+1 541 382 8588
> 
>           Veritas liberabit vos. -- Quid est veritas?
>     "If you can’t measure it, you can’t improve it." - Lord Kelvin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]