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


Daniel VE3NI
 

Hi Basil,

 

Here is the output of ~/n7nix/gps/verify_time.sh

 

pi@draws:~ $ ~/n7nix/gps/verify_time.sh

 

     timedatectl

 

      Local time: Thu 2018-12-27 21:19:48 EST

  Universal time: Fri 2018-12-28 02:19:48 UTC

        RTC time: n/a

       Time zone: America/Toronto (EST, -0500)

Network time on: yes

NTP synchronized: no

RTC in local TZ: no

 

     chronyc sources

 

210 Number of sources = 7

MS Name/IP address         Stratum Poll Reach LastRx Last sample              

===============================================================================

#x GPS                           0   3   377     6   -137ms[ -137ms] +/-  102ms

#- PPS                           0   3   377     5  +3031ns[+3031ns] +/-  514ns

#- PPS2                          0   4   377    18  +3656ns[+3656ns] +/-  294ns

^- t1.time.tw1.yahoo.com         2  10   377   727   -790us[ -790us] +/-   99ms

^- moe.nexellent.net             2  10   377   561  -1213us[-1213us] +/-   71ms

^- 2001:470:1f0e:9b0:fed::1      2  10   377   222  +4311us[+4311us] +/-   83ms

^- ns2.admincmd.com              2  10   377   539   +183us[ +183us] +/-   77ms

 

     chronyc sourcestats

 

210 Number of sources = 7

Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev

==============================================================================

GPS                         8   5    56   +248.617   1251.339   -136ms  8242us

PPS                        26  15   200     +0.016      0.006  +3306ns   389ns

PPS2                       12   7   176     +0.017      0.007  +3683ns   260ns

t1.time.tw1.yahoo.com      37  17  272m     -0.031      0.051  -2184us   367us

moe.nexellent.net          42  27  276m     -0.101      0.025  -1411us   241us

2001:470:1f0e:9b0:fed::1   41  18  282m     -0.101      0.016  +4039us   125us

ns2.admincmd.com           42  22  277m     -0.124      0.025   -239us   231us

 

     chronyc tracking

 

Reference ID    : 50505332 (PPS2)

Stratum         : 1

Ref time (UTC)  : Fri Dec 28 02:20:03 2018

System time     : 0.000003275 seconds fast of NTP time

Last offset     : +0.000003350 seconds

RMS offset      : 0.000011913 seconds

Frequency       : 7.094 ppm fast

Residual freq   : +0.013 ppm

Skew            : 0.006 ppm

Root delay      : 0.000000 seconds

Root dispersion : 0.000017 seconds

Update interval : 440.4 seconds

Leap status     : Normal

 

     chronyc activity

 

200 OK

4 sources online

0 sources offline

0 sources doing burst (return to online)

0 sources doing burst (return to offline)

0 sources with unknown address

 

     systemctl status

 

● 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; 4h 47min 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 21:07:53 draws chronyd[607]: Can't synchronise: no required source in selectable sources

Dec 27 21:10:10 draws chronyd[607]: Selected source PPS2

Dec 27 21:10:26 draws chronyd[607]: Can't synchronise: no required source in selectable sources

Dec 27 21:10:50 draws chronyd[607]: Selected source PPS2

Dec 27 21:11:22 draws chronyd[607]: Can't synchronise: no required source in selectable sources

Dec 27 21:12:10 draws chronyd[607]: Selected source PPS2

Dec 27 21:12:50 draws chronyd[607]: Can't synchronise: no required source in selectable sources

Dec 27 21:12:58 draws chronyd[607]: Selected source PPS2

Dec 27 21:13:06 draws chronyd[607]: Can't synchronise: no required source in selectable sources

Dec 27 21:20:18 draws chronyd[607]: Selected source PPS2

 

I am powering the DRAWS hat with an Alinco DM-330MV using the onboard power port.

 

pi@draws:~ $ sensors

ads1015-i2c-1-48

Adapter: bcm2835 I2C adapter

User ADC Differential:  +0.00 V 

+12V:                  +12.13 V 

User ADC 1:             +0.01 V 

User ADC 2:             +0.01 V 

 

pi@draws:~ $ ./my-pi-temp.sh

 

Thu Dec 27 21:25:50 EST 2018 @ draws

-------------------------------------------

GPU => temp=59.1'C

CPU => 59'C

 

 

When I check /dev/pps* I get

 

pi@draws:~ $ ls -al /dev/pps*

crw-rw---- 1 root root 243, 0 Dec 27 16:32 /dev/pps0

crw------- 1 root root 243, 1 Dec 27 16:37 /dev/pps1

pi@draws:~ $

 

Now that is interesting??

 

The time that /dev/pps1 was created corresponds to the time that the GPSD service started running . . . see below:

 

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; 4h 54min ago

 

It is possible that the /dev/pps0 was created when the system booted.

 

Please advise.

 

Daniel

 

-----Original Message-----
From: udrc@nw-digital-radio.groups.io <udrc@nw-digital-radio.groups.io> On Behalf Of Basil Gunn
Sent: Thursday, December 27, 2018 8:32 PM
To: udrc@nw-digital-radio.groups.io
Subject: Re: [udrc] State of GPSD on boot and PPS2

 

 

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

 

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