gpsd-users
[Top][All Lists]
Advanced

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

Re: use gpsd and chrony time sync with fake gps


From: Lin Zhao
Subject: Re: use gpsd and chrony time sync with fake gps
Date: Tue, 30 Nov 2021 10:02:51 -0500

Hi Gary,

> Most of us here use NTPsec, I'm not very current on chronyd.

I just fllow the tutorial online, that's why I select chronyd. Actually I am a new to gpsd. Maybe it's the setting of chronyd is not right. I will try it later today.

> > /etc/chrony/chrony.conf:
> > > driftfile /var/lib/chrony/drift
> > > allow
> > > # set larger delay to allow the NMEA source to overlap with
> > > # the other sources and avoid the falseticker status
> > > refclock SOCK /var/run/chrony.ttyTHS0.sock refid GPS precision 1e-1 offset 0.9999
> > > refclock SOCK /var/run/chrony.pps1.sock refid PPS precision 1e-7

> Sources are started in the order they are found in the file. You want
> your besst source at the top, and worst at the bottom.
> Your ttyTHS0 offset is crazy. And it should be "noselect".

> Start commands:
> > sudo killall -9 gpsd chronyd

> a) that is no good if you have some init system handling your daemons.
Like openrc or systemd.
> b) sudon't: https://gpsd.io/ubxtool-examples.html#_sudo_sudont

> > sudo chronyd -f /etc/chrony/chrony.conf
> > sleep 2
> > stty -F /dev/ttyTHS0 speed 9600
> > sudo gpsd -n /dev/ttyTHS0 -F /var/run/gpsd.sock

>Dunno why you are using -F, and why you are not using -s.

I got above configuration and comands in https://gpsd.io/gpsd-time-service-howto.html#_feeding_chrony_from_gpsd.

I am just test the pipeline, this operation may not professional, I will modify later. :)

$ sudo ntpshmmon :

ntpshmmon version 1
#      Name Seen@                Clock                Real                 L Prec
sample NTP0 1517155376.157242656 1517155376.125526432 1621258858.000000000 0 -20
sample NTP0 1517155377.124962848 1517155377.124402176 1621258859.000000000 0 -20
sample NTP0 1517155378.124273536 1517155378.123348576 1621258860.000000000 0 -20
sample NTP0 1517155379.122575328 1517155379.122129792 1621258861.000000000 0 -20
sample NTP0 1517155380.121396928 1517155380.120954592 1621258862.000000000 0 -20
sample NTP0 1517155381.120269408 1517155381.119782944 1621258863.000000000 0 -20

> > > # gpsd -nND 4 /dev/ttyTHS0 > tmp.log 2>&1
> > Please see attached log file from you suggested commands

> Broken kernel PPS:
> gpsd:INFO: KPPS:/dev/ttyTHS0 kernel PPS timeout Interrupted system call
> And no regular PPS seen either. Are you sure your PPS is working?

I tested my pps in oscilloscope, it looks good and stable. Also, I can try following:
$ sudo ppstest /dev/pps1

trying PPS source "/dev/pps1"
found PPS source "/dev/pps1"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1517155419.747862112, sequence: 260 - clear  0.000000000, sequence: 0
source 0 - assert 1517155420.746692800, sequence: 261 - clear  0.000000000, sequence: 0
source 0 - assert 1517155421.745509408, sequence: 262 - clear  0.000000000, sequence: 0
source 0 - assert 1517155422.744392160, sequence: 263 - clear  0.000000000, sequence: 0
source 0 - assert 1517155423.743168096, sequence: 264 - clear  0.000000000, sequence: 0
source 0 - assert 1517155424.741953952, sequence: 265 - clear  0.000000000, sequence: 0
source 0 - assert 1517155425.740632640, sequence: 266 - clear  0.000000000, sequence: 0
source 0 - assert 1517155426.739323488, sequence: 267 - clear  0.000000000, sequence: 0
source 0 - assert 1517155427.738036160, sequence: 268 - clear  0.000000000, sequence: 0


> > You at least have to change the time stamps.
> The GPS example I taken from a Ultimate GPS record, I do increase
> time stamp every second and keep other information.

> Care to share your NMEA data? Easy to do, while gpsd is running:
> $ gpspipe -R -x 20 > raw.log
> $ gpspipe -w -x 20 > json.log

I am using:
$ gpspipe -R -o raw.log
$ gpspipe -w -o json.log

I don't have -x option, wired. I attached the files. I record the gps messags on my campus, then increase the time stamp based on that day, which is 5/17/2021. The other data is not changed at all.

Thanks for your help.

Bests,
Lin



Attachment: json.log
Description: Binary data

Attachment: raw.log
Description: Binary data


reply via email to

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