Re: State of GPSD on boot and PPS2 #chrony #gpsd #pps


Daniel VE3NI
 

Hi John,

 

I have performed the instructions as specified here (https://nw-digital-radio.groups.io/g/udrc/wiki/DRAWS%E2%84%A2%3A-Setup-GPSD-for-Time-and--Position).  On the beta images gpsd comes installed but I have gone through step by step to make sure that I have not missed anything.

 

The thing that confuses me is that upon the GPSD status displays that it is loaded BUT I am still trying to find out what the INDIRECT refers to as I thought it would say ENABLED instead.

 

pi@draws:~ $ sudo systemctl status gpsd
gpsd.service - GPS (Global Positioning System) Daemon
  Loaded: loaded (/lib/systemd/system/gpsd.service; indirect; vendor preset: enabled)
  Active: inactive (dead)

 

 

Here is the chrony.conf

 

pi@draws:~ $ cat /etc/chrony/chrony.conf

# Welcome to the chrony configuration file. See chrony.conf(5) for more

# information about usuable directives.

pool 2.debian.pool.ntp.org iburst

 

# This directive specify the location of the file containing ID/key pairs for

# NTP authentication.

keyfile /etc/chrony/chrony.keys

 

# This directive specify the file into which chronyd will store the rate

# information.

driftfile /var/lib/chrony/chrony.drift

 

# Uncomment the following line to turn logging on.

#log tracking measurements statistics

 

# Log files location.

logdir /var/log/chrony

 

# Stop bad estimates upsetting machine clock.

maxupdateskew 100.0

 

# This directive tells 'chronyd' to parse the 'adjtime' file to find out if the

# real-time clock keeps local time or UTC. It overrides the 'rtconutc' directive.

#hwclockfile /etc/adjtime

 

# This directive enables kernel synchronisation (every 11 minutes) of the

# real-time clock. Note that it can't be used along with the 'rtcfile' directive.

#rtcsync

 

# Step the system clock instead of slewing it if the adjustment is larger than

# one second, but only in the first three clock updates.

makestep 1 3

 

refclock SHM 0 refid GPS precision 1e-3 offset 0.5 delay 0.2 poll 3 trust require

refclock SHM 2 refid PPS precision 1e-9 poll 3 trust

refclock PPS /dev/pps0 lock GPS trust prefer

 

# Configure broadcast and allow for your network and uncomment (Multiple declarations for each allowed)

broadcast 30 192.168.1.255

#allow 192.168.0.0/16

#allow 10.0.42.0/16

#allow 44.0.0.0/8

allow 192.168.1.0/24

pi@draws:~ $

 

Let me know if I can do or provide any additional information.

 

Daniel

 

From: udrc@nw-digital-radio.groups.io <udrc@nw-digital-radio.groups.io> On Behalf Of John D Hays - K7VE
Sent: Thursday, December 27, 2018 8:57 PM
To: udrc@nw-digital-radio.groups.io
Subject: Re: [udrc] State of GPSD on boot and PPS2

 

If the gpsd has been enabled, it should start on boot.

sudo systemctl enable gpsd

The PPS2 is likely a configuration issue in /etc/chrony/chrony.conf  send your version along for review.

 

 

 

On Thu, Dec 27, 2018 at 5:32 PM Basil Gunn <basil@...> wrote:


First thanks for all the data. It would also be good to see the output of
this script.
cd
n7nix/gps/verify_time.sh

So just some observations from my setup which is a clean boot of the
DRAWS image.

My gpsd also does not start automatically. I will look into that.
It does start when I run gpsmon

If I look for any pps devices I only have one.
Perhaps you can do the following & see what you get.

ls /dev/pps*
/dev/pps0

When I google 'raspberry pi PPS2' it comes up with:
Duracell PPS2 Instant USB charger
Are you powering your RPi with an external battery pack?

Thanks,
/Basil



Daniel VE3NI <dgoodier@...> writes:

> Hi,
>

>
> First let me apologize for what will be a long email.
>

>
> There has been lots of good discussion and learning going on about the DRAWS hat.
>

>
> I have been hoping that someone else might be experiencing this issue and would bring up to the group for discussion but so far no one has so it is possible that I am the only one.
>

>
> I have the DRAWS hat with the GPS antenna.
>

>
> I have experienced this issue on both beta5 and beta6.
>

>
> I use the ./app_config.sh core command to configure my system.
>

>
> I modify /etc/chrony/chrony.conf to uncomment the refclock PPS /dev/pps0 lock GPS trust prefer line and add the lines to broadcast to the local network and allow client on the local network to sync to the rPi.
>

>
> Upon reboot if I check the state of GPSD is shows:
>

>
> pi@draws:~ $ sudo systemctl status gpsd
>
> gpsd.service - GPS (Global Positioning System) Daemon
>
>    Loaded: loaded (/lib/systemd/system/gpsd.service; indirect; vendor preset: enabled)
>
>    Active: inactive (dead)
>
> pi@draws:~ $
>

>
> In addition when I check the state of CHRONY after the reboot I see:
>

>
> pi@draws:~ $ sudo systemctl status chrony
>
> chrony.service - chrony, an NTP client/server
>
>    Loaded: loaded (/lib/systemd/system/chrony.service; enabled; vendor preset: enabled)
>
>    Active: active (running) since Thu 2018-12-27 16:33:04 EST; 3min 56s ago
>
>      Docs: man:chronyd(8)
>
>            man:chronyc(1)
>
>            man:chrony.conf(5)
>
>   Process: 562 ExecStart=/usr/sbin/chronyd (code=exited, status=0/SUCCESS)
>
> Main PID: 607 (chronyd)
>
>    CGroup: /system.slice/chrony.service
>
>            +-607 /usr/sbin/chronyd
>

>
> Dec 27 16:33:03 draws systemd[1]: Starting chrony, an NTP client/server...
>
> Dec 27 16:33:04 draws chronyd[607]: chronyd version 3.0 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SECHASH +SIGND +ASYNCDNS
>
> Dec 27 16:33:04 draws chronyd[607]: Frequency 6.975 +/- 0.038 ppm read from /var/lib/chrony/chrony.drift
>
> Dec 27 16:33:04 draws systemd[1]: Started chrony, an NTP client/server.
>

>
> It is only when I either specifically start the GPSD (sudo systemctl start gpsd) or open a terminal window and run gpsmon that the GPSD and CHRONY status are what I expect.
>

>
> pi@draws:~ $ sudo systemctl status gpsd
>
> gpsd.service - GPS (Global Positioning System) Daemon
>
>    Loaded: loaded (/lib/systemd/system/gpsd.service; indirect; vendor preset: enabled)
>
>    Active: active (running) since Thu 2018-12-27 16:37:28 EST; 7s ago
>
> Main PID: 1318 (gpsd)
>
>    CGroup: /system.slice/gpsd.service
>
>            +-1318 /usr/sbin/gpsd -N -n /dev/ttySC0 /dev/pps0
>

>
> Dec 27 16:37:28 draws systemd[1]: Started GPS (Global Positioning System) Daemon.
>

>
> pi@draws:~ $ sudo systemctl status chrony
>
> chrony.service - chrony, an NTP client/server
>
>    Loaded: loaded (/lib/systemd/system/chrony.service; enabled; vendor preset: enabled)
>
>    Active: active (running) since Thu 2018-12-27 16:33:04 EST; 4min 57s ago
>
>      Docs: man:chronyd(8)
>
>            man:chronyc(1)
>
>            man:chrony.conf(5)
>
>   Process: 562 ExecStart=/usr/sbin/chronyd (code=exited, status=0/SUCCESS)
>
> Main PID: 607 (chronyd)
>
>    CGroup: /system.slice/chrony.service
>
>            +-607 /usr/sbin/chronyd
>

>
> Dec 27 16:33:03 draws systemd[1]: Starting chrony, an NTP client/server...
>
> Dec 27 16:33:04 draws chronyd[607]: chronyd version 3.0 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SECHASH +SIGND +ASYNCDNS
>
> Dec 27 16:33:04 draws chronyd[607]: Frequency 6.975 +/- 0.038 ppm read from /var/lib/chrony/chrony.drift
>
> Dec 27 16:33:04 draws systemd[1]: Started chrony, an NTP client/server.
>
> Dec 27 16:37:51 draws chronyd[607]: Selected source 2001:4168:1::1
>
> Dec 27 16:37:51 draws chronyd[607]: System clock wrong by 9.542856 seconds, adjustment started
>
> Dec 27 16:38:01 draws chronyd[607]: System clock was stepped by 9.542856 seconds
>
> Dec 27 16:38:01 draws chronyd[607]: Selected source PPS
>
> Dec 27 16:38:07 draws chronyd[607]: Can't synchronise: no required source in selectable sources
>

>
> Any suggestion as to which step I might have missed?  It almost looks like it is waiting for a request before it starts.  I know that I can force it to start on reboot by adding commands to systemd but would like to know if it is working by design before I make any changes.
>

>
> This brings leads me to by question.
>

>
> Where is PPS2 coming from?  PPS2 is not defined in my chrony.conf file but does show up when I run chronyc sources.
>

>
> pi@draws:~ $ sudo systemctl status chrony
>
> ? chrony.service - chrony, an NTP client/server
>
>    Loaded: loaded (/lib/systemd/system/chrony.service; enabled; vendor preset: enabled)
>
>    Active: active (running) since Thu 2018-12-27 16:33:04 EST; 13min ago
>
>      Docs: man:chronyd(8)
>
>            man:chronyc(1)
>
>            man:chrony.conf(5)
>
>   Process: 562 ExecStart=/usr/sbin/chronyd (code=exited, status=0/SUCCESS)
>
> Main PID: 607 (chronyd)
>
>    CGroup: /system.slice/chrony.service
>
>            +-607 /usr/sbin/chronyd
>

>
> Dec 27 16:33:04 draws chronyd[607]: chronyd version 3.0 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SECHASH +SIGND +ASYNCDNS
>
> Dec 27 16:33:04 draws chronyd[607]: Frequency 6.975 +/- 0.038 ppm read from /var/lib/chrony/chrony.drift
>
> Dec 27 16:33:04 draws systemd[1]: Started chrony, an NTP client/server.
>
> Dec 27 16:37:51 draws chronyd[607]: Selected source 2001:4168:1::1
>
> Dec 27 16:37:51 draws chronyd[607]: System clock wrong by 9.542856 seconds, adjustment started
>
> Dec 27 16:38:01 draws chronyd[607]: System clock was stepped by 9.542856 seconds
>
> Dec 27 16:38:01 draws chronyd[607]: Selected source PPS
>
> Dec 27 16:38:07 draws chronyd[607]: Can't synchronise: no required source in selectable sources
>
> Dec 27 16:38:09 draws chronyd[607]: Selected source PPS
>
> Dec 27 16:38:17 draws chronyd[607]: Can't synchronise: no required source in selectable sources
>

>
> pi@draws:~ $ chronyc sources
>
> 210 Number of sources = 7
>
> MS Name/IP address         Stratum Poll Reach LastRx Last sample
>
> ===============================================================================
>
> #x GPS                           0   3   377     6   -131ms[ -131ms] +/-  102ms
>
> #- PPS                           0   3   377     7  -6012ns[-6012ns] +/-  571ns
>
> #- PPS2                          0   4   377    10  -6152ns[-6152ns] +/-  439ns
>
> ^- t1.time.tw1.yahoo.com         2   6   377   116  -3401us[-3401us] +/-   94ms
>
> ^- moe.nexellent.net             2   6   377    62  -1831us[-1831us] +/-   80ms
>
> ^- 2001:470:1f0e:9b0:fed::1      2   6   377     2  +4267us[+4267us] +/-   80ms
>
> ^- ns2.admincmd.com              2   6   377     1   +642us[ +642us] +/-   72ms
>
> pi@draws:~ $ chronyc tracking
>
> Reference ID    : 50505300 (PPS)
>
> Stratum         : 1
>
> Ref time (UTC)  : Thu Dec 27 21:38:05 2018
>
> System time     : 0.000000005 seconds fast of NTP time
>
> Last offset     : +0.000018873 seconds
>
> RMS offset      : 0.000018873 seconds
>
> Frequency       : 6.975 ppm fast
>
> Residual freq   : +0.841 ppm
>
> Skew            : 0.059 ppm
>
> Root delay      : 0.000000 seconds
>
> Root dispersion : 0.001019 seconds
>
> Update interval : 8.0 seconds
>
> Leap status     : Normal
>

>
> . . . .  ONE HOUR LATER . . . selected source becomes PPS2
>

>
> pi@draws:~ $ sudo systemctl status chrony
>
> ? chrony.service - chrony, an NTP client/server
>
>    Loaded: loaded (/lib/systemd/system/chrony.service; enabled; vendor preset: enabled)
>
>    Active: active (running) since Thu 2018-12-27 16:33:04 EST; 1h 4min ago
>
>      Docs: man:chronyd(8)
>
>            man:chronyc(1)
>
>            man:chrony.conf(5)
>
>   Process: 562 ExecStart=/usr/sbin/chronyd (code=exited, status=0/SUCCESS)
>
> Main PID: 607 (chronyd)
>
>    CGroup: /system.slice/chrony.service
>
>            +-607 /usr/sbin/chronyd
>

>
> Dec 27 16:33:04 draws systemd[1]: Started chrony, an NTP client/server.
>
> Dec 27 16:37:51 draws chronyd[607]: Selected source 2001:4168:1::1
>
> Dec 27 16:37:51 draws chronyd[607]: System clock wrong by 9.542856 seconds, adjustment started
>
> Dec 27 16:38:01 draws chronyd[607]: System clock was stepped by 9.542856 seconds
>
> Dec 27 16:38:01 draws chronyd[607]: Selected source PPS
>
> Dec 27 16:38:07 draws chronyd[607]: Can't synchronise: no required source in selectable sources
>
> Dec 27 16:38:09 draws chronyd[607]: Selected source PPS
>
> Dec 27 16:38:17 draws chronyd[607]: Can't synchronise: no required source in selectable sources
>
> Dec 27 17:37:33 draws chronyd[607]: Selected source PPS2
>
> Dec 27 17:37:41 draws chronyd[607]: Can't synchronise: no required source in selectable sources
>
> pi@draws:~ $ chronyc sources
>
> 210 Number of sources = 7
>
> MS Name/IP address         Stratum Poll Reach LastRx Last sample
>
> ===============================================================================
>
> #x GPS                           0   3   377    11   -128ms[ -128ms] +/-  102ms
>
> #- PPS                           0   3   377    11   -452ns[ -452ns] +/-  549ns
>
> #- PPS2                          0   4   377    15   -365ns[ -365ns] +/-  282ns
>
> ^- t1.time.tw1.yahoo.com         2   9   377   361  -3063us[-3076us] +/-  103ms
>
> ^- moe.nexellent.net             2   9   377   184  -1854us[-1864us] +/-   79ms
>
> ^- 2001:470:1f0e:9b0:fed::1      2   9   377   377  +4241us[+4228us] +/-   70ms
>
> ^- ns2.admincmd.com              2   9   377   183   +470us[ +459us] +/-   72ms
>
> pi@draws:~ $ chronyc tracking
>
> Reference ID    : 50505332 (PPS2)
>
> Stratum         : 1
>
> Ref time (UTC)  : Thu Dec 27 22:37:26 2018
>
> System time     : 0.000000000 seconds fast of NTP time
>
> Last offset     : +0.000000060 seconds
>
> RMS offset      : 0.000000060 seconds
>
> Frequency       : 6.989 ppm fast
>
> Residual freq   : +0.000 ppm
>
> Skew            : 0.003 ppm
>
> Root delay      : 0.000000 seconds
>
> Root dispersion : 0.000083 seconds
>
> Update interval : 0.0 seconds
>
> Leap status     : Normal
>
> pi@draws:~ $
>

>
> So where is PPS2 coming from and how to have GPSD start running automatically?  Inquiring minds would like to know.
>

>
> Let me know if you require any further information.
>

>
> Cheers es 73,
>
> Daniel  VE3NI / NI2D



 

--

 


John D. Hays
Edmonds, WA

K7VE

 

   

 

Join udrc@nw-digital-radio.groups.io to automatically receive all group messages.