Topics

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


Daniel VE3NI
 

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


Basil Gunn
 

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


 

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

   


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

 


 

I am replicating the failure of gpsd to start automatically on reboot.  

I have not found the cause yet.


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

 

   

 


Daniel VE3NI
 

Basil/John,

 

The only way I found to automatically start GPSD on boot is as follows:

 

Ubuntu/Debian

The .deb package supplied for the Debian and Ubuntu Linux distributions launch at boot either using systemd with gpsd.socket and gpsd.service, or on older releases from the system V-like script /etc/init.d/gpsd. However, both are governed by a control file, /etc/default/gpsd. If necessary, edit the control file as root.

Please note that systemd will only start gpsd on request by clients connecting to the unix or tcp socket. In case you need gpsd to run always, you'll need to configure systemd to start it. One way would be to create /etc/systemd/system/gpsd.service with the following content:

[Unit]

Description=GPS (Global Positioning System) Daemon

Requires=gpsd.socket

# Needed with chrony SOCK refclock

After=chronyd.service

 

[Service]

EnvironmentFile=-/etc/default/gpsd

EnvironmentFile=-/etc/sysconfig/gpsd

ExecStart=/usr/sbin/gpsd -N $GPSD_OPTIONS $DEVICES

 

[Install]

WantedBy=multi-user.target

Also=gpsd.socket

 

Not sure if this is applicable . . . .

 

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 9:43 PM
To: udrc@nw-digital-radio.groups.io
Subject: Re: [udrc] State of GPSD on boot and PPS2 #pps #gpsd #chrony

 

I am replicating the failure of gpsd to start automatically on reboot.  

I have not found the cause yet.


 



On Thu, Dec 27, 2018 at 6:51 PM Daniel VE3NI <dgoodier@...> wrote:

Hi Joh

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



The reason you have a PPS and PPS2 is because you have both of these un-commented.  Pick one or the other.  Put prefer at the end of the line for the PPS you want to use.  You can also remove require from the GPS entry.

refclock SHM 2 refid PPS precision 1e-9 poll 3 trust  
refclock PPS /dev/pps0 lock GPS trust prefer

--


John D. Hays
Edmonds, WA
K7VE

   


Daniel VE3NI
 

Thanks John.

 

I will give that a go and report back on the result.

 

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 10:14 PM
To: udrc@nw-digital-radio.groups.io
Subject: Re: [udrc] State of GPSD on boot and PPS2

 

 

 

On Thu, Dec 27, 2018 at 6:51 PM Daniel VE3NI <dgoodier@...> wrote:

Hi Joh

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

 

 

The reason you have a PPS and PPS2 is because you have both of these un-commented.  Pick one or the other.  Put prefer at the end of the line for the PPS you want to use.  You can also remove require from the GPS entry.

 

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

refclock PPS /dev/pps0 lock GPS trust prefer

 

--

 


John D. Hays
Edmonds, WA

K7VE

 

   

 


Daniel VE3NI
 

John,

 

That did the trick.

 

Thanks for catching that.

 

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 10:14 PM
To: udrc@nw-digital-radio.groups.io
Subject: Re: [udrc] State of GPSD on boot and PPS2

 

 

 

On Thu, Dec 27, 2018 at 6:51 PM Daniel VE3NI <dgoodier@...> wrote:

Hi Joh

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

 

 

The reason you have a PPS and PPS2 is because you have both of these un-commented.  Pick one or the other.  Put prefer at the end of the line for the PPS you want to use.  You can also remove require from the GPS entry.

 

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

refclock PPS /dev/pps0 lock GPS trust prefer

 

--

 


John D. Hays
Edmonds, WA

K7VE

 

   

 


Art - KC7SDA
 

I was messing around last night and I think that if you don't remove 'require' at the end of the gps line it won't update based on the ntp server time chrony just hangs.

testing:
- shutdown pi
- remove gps antenna
- wait 10+ minutes
- boot pi
- use chronyc sources to verify

if you add the -v flag you get this output:


one of the time servers should be selected (either * or +).


Daniel VE3NI
 

Hi Art,

 

Thanks for having a look at this.

 

John had pointed out to be that the ‘require’ at the end of the gps line was not required in my case and that the PPS2 was caused by the fact that when I ENABLED the line ‘refclock PPS  . . . . ’  I need to comment out the ‘refclock SHM 2 . . . ’  line in the chrony.conf file.

 

Since I did this I have not had any issue with ‘multiple’ PPSx showing up in sources.

 

pi@draws:~ $ chronyc sources -v

210 Number of sources = 6

 

  .-- Source mode  '^' = server, '=' = peer, '#' = local clock.

/ .- Source state '*' = current synced, '+' = combined , '-' = not combined,

| /   '?' = unreachable, 'x' = time may be in error, '~' = time too variable.

||                                                 .- xxxx [ yyyy ] +/- zzzz

||      Reachability register (octal) -.           |  xxxx = adjusted offset,

||      Log2(Polling interval) --.      |          |  yyyy = measured offset,

||                                \     |          |  zzzz = estimated error.

||                                 |    |           \

MS Name/IP address         Stratum Poll Reach LastRx Last sample              

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

#x GPS                           0   3   377    13   -152ms[ -152ms] +/-  102ms

#* PPS1                          0   4   377    16   +249ns[ +389ns] +/-  251ns

^- zero.gotroot.ca               2   8   377    41  -1336us[-1336us] +/-   43ms

^- 2607:5300:60:975a::           2  10   377   303   -142us[ -142us] +/-   10ms

^- comet.spiderspace.co.uk       2   9   377   439  +1482us[+1483us] +/-   11ms

^- 2620:10a:800f::12             1  10   377    53   +283us[ +283us] +/-  504ms

pi@draws:~ $

 

This however has not resolved the fact that gpsd service does not start automatically on startup until I either issue a systemctl start gpsd.service or run gpsmon.

 

I believe that this is still under investigation.

 

Cheers,

Daniel  VE3NI / NI2D

 

From: udrc@nw-digital-radio.groups.io <udrc@nw-digital-radio.groups.io> On Behalf Of Art - KC7SDA
Sent: Tuesday, January 01, 2019 1:33 PM
To: udrc@nw-digital-radio.groups.io
Subject: Re: [udrc] State of GPSD on boot and PPS2

 

I was messing around last night and I think that if you don't remove 'require' at the end of the gps line it won't update based on the ntp server time chrony just hangs.

testing:
- shutdown pi
- remove gps antenna
- wait 10+ minutes
- boot pi
- use chronyc sources to verify

if you add the -v flag you get this output:


one of the time servers should be selected (either * or +).


Annaliese McDermond
 

On Jan 1, 2019, at 2:01 PM, Daniel VE3NI <dgoodier@...> wrote:

This however has not resolved the fact that gpsd service does not start automatically on startup until I either issue a systemctl start gpsd.service or run gpsmon.

I believe that this is still under investigation.
If you haven’t already checked, make sure that as part of the GPSD_OPTIONS variable in /etc/default/gpsd, it includes the “-n” flag. It should read something like:

GPSD_OPTIONS="-n -G”

This line will cause gpsd to start as a daemon and to answer queries from outside of the Pi (if, for example, you wanted to use it as a GPS source for Xastir or YACC).

--
Annaliese McDermond (NH6Z)
nh6z@...


Cheers,
Daniel VE3NI / NI2D


Daniel VE3NI
 

Hi Annaliese,

I checked /etc/default/gpsd and the GPSD_OPTIONS was set as GPSD_OPTIONS=-n

In my investigation of this issue I checked the www.catb.org/gpsd/ site and under troubleshooting I found:

      Ubuntu/Debian

      The .deb package supplied for the Debian and Ubuntu Linux distributions launch at boot either using systemd with gpsd.socket and gpsd.service, or on older releases from the system V-like script /etc/init.d/gpsd. However, both are governed by a control file, /etc/default/gpsd. If necessary, edit the control file as root.

      Please note that systemd will only start gpsd on request by clients connecting to the unix or tcp socket. In case you need gpsd to run always, you'll need to configure systemd to start it. One way would be to create /etc/systemd/system/gpsd.service with the following content:

      [Unit]

      Description=GPS (Global Positioning System) Daemon

      Requires=gpsd.socket

      # Needed with chrony SOCK refclock

      After=chronyd.service

      [Service]

      EnvironmentFile=-/etc/default/gpsd

      EnvironmentFile=-/etc/sysconfig/gpsd

      ExecStart=/usr/sbin/gpsd -N $GPSD_OPTIONS $DEVICES

      [Install]

      WantedBy=multi-user.target

      Also=gpsd.socket

Then make sure you ask systemd to reload its config run:

sudo systemctl daemon-reload; systemctl reenable gpsd.service

I have implemented this as suggested and it resolves the problem that I run into.

I suspect that this would not be an issue for anyone who is automatically starting applications that access gpsd on bootup but that is not my case.  My main use of gpsd is for chrony to act as a time server for my local network.

Cheers,

Daniel  VE3NI

-----Original Message-----
From: udrc@nw-digital-radio.groups.io <udrc@nw-digital-radio.groups.io> On Behalf Of Annaliese McDermond
Sent: Tuesday, January 01, 2019 7:32 PM
To: udrc@nw-digital-radio.groups.io
Subject: Re: [udrc] State of GPSD on boot and PPS2

> On Jan 1, 2019, at 2:01 PM, Daniel VE3NI <dgoodier@...> wrote:

> This however has not resolved the fact that gpsd service does not start automatically on startup until I either issue a systemctl start gpsd.service or run gpsmon.

> I believe that this is still under investigation.

If you haven’t already checked, make sure that as part of the GPSD_OPTIONS variable in /etc/default/gpsd, it includes the “-n” flag.  It should read something like:

GPSD_OPTIONS="-n -G”

This line will cause gpsd to start as a daemon and to answer queries from outside of the Pi (if, for example, you wanted to use it as a GPS source for Xastir or YACC).

--

Annaliese McDermond (NH6Z)

nh6z@...


> Cheers,

> Daniel  VE3NI / NI2D


Basil Gunn
 

Daniel,

You may have added a second gpsd.service file.
Package-provided service files are usually located in
/lib/systemd/system, check there for a gpsd.service file.
That's where the current version of compass/raspbian puts that file.

The gpsd.service file in /lib/systemd/system was not that different then the one from
the catb.org site. I added one line and enabled it and gpsd now is
enabled from boot.

This change will be in the Beta7 image.

/Basil


Daniel VE3NI <dgoodier@...> writes:

Hi Annaliese,

I checked /etc/default/gpsd and the GPSD_OPTIONS was set as GPSD_OPTIONS=”-n”

In my investigation of this issue I checked the www.catb.org/gpsd/ site and under troubleshooting I found:

Ubuntu/Debian
The .deb package supplied for the Debian and Ubuntu Linux distributions launch at boot either using systemd with gpsd.socket and gpsd.service, or on older releases from the system V-like script /etc/init.d/gpsd. However, both are governed by a control file, /etc/default/gpsd. If necessary, edit the control file as root.
Please note that systemd will only start gpsd on request by clients connecting to the unix or tcp socket. In case you need gpsd to run always, you'll need to configure systemd to start it. One way would be to create /etc/systemd/system/gpsd.service with the following content:
[Unit]
Description=GPS (Global Positioning System) Daemon
Requires=gpsd.socket
# Needed with chrony SOCK refclock
After=chronyd.service

[Service]
EnvironmentFile=-/etc/default/gpsd
EnvironmentFile=-/etc/sysconfig/gpsd
ExecStart=/usr/sbin/gpsd -N $GPSD_OPTIONS $DEVICES

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

Then make sure you ask systemd to reload its config run:

sudo systemctl daemon-reload; systemctl reenable gpsd.service

I have implemented this as suggested and it resolves the problem that I run into.

I suspect that this would not be an issue for anyone who is automatically starting applications that access gpsd on bootup but that is not my case. My main use of gpsd is for chrony to act as a time server for my local network.

Cheers,
Daniel VE3NI


-----Original Message-----
From: udrc@nw-digital-radio.groups.io <udrc@nw-digital-radio.groups.io> On Behalf Of Annaliese McDermond
Sent: Tuesday, January 01, 2019 7:32 PM
To: udrc@nw-digital-radio.groups.io
Subject: Re: [udrc] State of GPSD on boot and PPS2



On Jan 1, 2019, at 2:01 PM, Daniel VE3NI <dgoodier@... <mailto:dgoodier@...> > wrote:

This however has not resolved the fact that gpsd service does not start automatically on startup until I either issue a systemctl start gpsd.service or run gpsmon.

I believe that this is still under investigation.
If you haven’t already checked, make sure that as part of the GPSD_OPTIONS variable in /etc/default/gpsd, it includes the “-n” flag. It should read something like:

GPSD_OPTIONS="-n -G”

This line will cause gpsd to start as a daemon and to answer queries from outside of the Pi (if, for example, you wanted to use it as a GPS source for Xastir or YACC).


Daniel VE3NI
 

Basil,

Made the changes as you suggested and it now works as expected. Not sure which missing line you added so I added both of them, hi hi.

Looking forward to the next beta image release.

I have installed linBPQ and now to work my way through making it work with Direwolf. My goal is to replace my existing rPi Packet BBS/KPC 9612+ TNC with the rPi DRAWS hat.

Thanks,
Daniel

-----Original Message-----
From: udrc@nw-digital-radio.groups.io <udrc@nw-digital-radio.groups.io> On Behalf Of Basil Gunn
Sent: Wednesday, January 02, 2019 6:50 PM
To: udrc@nw-digital-radio.groups.io
Subject: Re: [udrc] State of GPSD on boot and PPS2


Daniel,

You may have added a second gpsd.service file.
Package-provided service files are usually located in /lib/systemd/system, check there for a gpsd.service file.
That's where the current version of compass/raspbian puts that file.

The gpsd.service file in /lib/systemd/system was not that different then the one from the catb.org site. I added one line and enabled it and gpsd now is enabled from boot.

This change will be in the Beta7 image.

/Basil


Daniel VE3NI <dgoodier@...> writes:

Hi Annaliese,

I checked /etc/default/gpsd and the GPSD_OPTIONS was set as GPSD_OPTIONS=”-n”

In my investigation of this issue I checked the www.catb.org/gpsd/ site and under troubleshooting I found:

Ubuntu/Debian
The .deb package supplied for the Debian and Ubuntu Linux distributions launch at boot either using systemd with gpsd.socket and gpsd.service, or on older releases from the system V-like script /etc/init.d/gpsd. However, both are governed by a control file, /etc/default/gpsd. If necessary, edit the control file as root.
Please note that systemd will only start gpsd on request by clients connecting to the unix or tcp socket. In case you need gpsd to run always, you'll need to configure systemd to start it. One way would be to create /etc/systemd/system/gpsd.service with the following content:
[Unit]
Description=GPS (Global Positioning System) Daemon
Requires=gpsd.socket
# Needed with chrony SOCK refclock
After=chronyd.service

[Service]
EnvironmentFile=-/etc/default/gpsd
EnvironmentFile=-/etc/sysconfig/gpsd
ExecStart=/usr/sbin/gpsd -N $GPSD_OPTIONS $DEVICES

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

Then make sure you ask systemd to reload its config run:

sudo systemctl daemon-reload; systemctl reenable gpsd.service

I have implemented this as suggested and it resolves the problem that I run into.

I suspect that this would not be an issue for anyone who is automatically starting applications that access gpsd on bootup but that is not my case. My main use of gpsd is for chrony to act as a time server for my local network.

Cheers,
Daniel VE3NI


-----Original Message-----
From: udrc@nw-digital-radio.groups.io
<udrc@nw-digital-radio.groups.io> On Behalf Of Annaliese McDermond
Sent: Tuesday, January 01, 2019 7:32 PM
To: udrc@nw-digital-radio.groups.io
Subject: Re: [udrc] State of GPSD on boot and PPS2



On Jan 1, 2019, at 2:01 PM, Daniel VE3NI <dgoodier@... <mailto:dgoodier@...> > wrote:

This however has not resolved the fact that gpsd service does not start automatically on startup until I either issue a systemctl start gpsd.service or run gpsmon.

I believe that this is still under investigation.
If you haven’t already checked, make sure that as part of the GPSD_OPTIONS variable in /etc/default/gpsd, it includes the “-n” flag. It should read something like:

GPSD_OPTIONS="-n -G”

This line will cause gpsd to start as a daemon and to answer queries from outside of the Pi (if, for example, you wanted to use it as a GPS source for Xastir or YACC).