[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: use gpsd and chrony time sync with fake gps
From: |
Gary E. Miller |
Subject: |
Re: use gpsd and chrony time sync with fake gps |
Date: |
Thu, 11 Nov 2021 12:37:30 -0800 |
Yo Lin!
On Wed, 10 Nov 2021 21:56:15 -0500
Lin Zhao <crazymumu0804@gmail.com> wrote:
> Thanks for providing this mail-list. I am using microcontroller as a
> fake GPS in our project for time sync in gps-denied environment.
Odd. That could go wrong many ways.
> The microcontroller generates PPS and NMEA messages to Nvidia Jetson
> computer running Ubuntu 18.04. The PPS is stable as tested in
> Oscilloscope.
What is your definition of "stable"? You realize PPS is not a "message"
but a Pulse (Per Second).
> The NMEA message is copied from a real gps record.
You at least have to change the time stamps.
> I followed the tutorial in Feeding chrony from GPSD <http://Hi,
> Thanks for providing this mail-list. I am using microcontroller as
> fake GPS in our project for time sync in gps-denied environment. The
> microcontroller generates PPS and NMEA message to Nvidia Jetson
> computer which running Ubuntu 18.04. The PPS is stable as test in
> Oscilloscope. The NMEA message is copied from a real gps record. I
> followed the tutorial in>,
Is that just a repeat of your openeing?
> */etc/chrony/chrony.conf*:
>
> > pool ntp.ubuntu.com iburst maxsources 4
> > pool 0.ubuntu.pool.ntp.org iburst maxsources 1
> > pool 1.ubuntu.pool.ntp.org iburst maxsources 1
> > pool 2.ubuntu.pool.ntp.org iburst maxsources 2
> > 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
>
> *Start commands:*
>
> > sudo killall -9 gpsd chronyd
> > sudo chronyd -f /etc/chrony/chrony.conf
> > sleep 2
> > stty -F /dev/ttyTHS0 speed 9600
> > sudo gpsd /dev/ttyTHS0 -F /var/run/gpsd.sock
https://gpsd.io/ubxtool-examples.html#_sudo_sudont
You forgot the "-n" option to gpsd. It is essential for timekeeping.
Why do you have both the serial port, AND a socket connection (-F)?
What is: /dev/ttyTHS0 ? Is it a "tty" like driver? Does it support
KPPS?
> *cgps -s *result:
> [image: cgps.png]
You don't use cgps to debug tim. What does ntpshmmon (run as root)
show?
> *chronyc sources -v* result:
> [image: chronyc.png]
No reach. No idea why.
> *sudo ppstest /dev/pps1* result:
> [image: ppstest.png]
So you do have a real PPS, not a "PPS message".
> Everything looks good,
Not to me.
> gpsd can parse the NMEA right,
How do I know that?
> PPS is showing good.
I don't see that. I pretty sloppy PPS. No idea how you think it is getting
into gpsd.
> But chrony is not working.
Yes.
Send us the "-D 4" log from gpsd. Something like this:
As root:
# gpsd -nND 4 /dev/ttyTHS0 > tmp.log 2>&1
Let that run a minute, then send tmp.log here.
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
gem@rellim.com Tel:+1 541 382 8588
Veritas liberabit vos. -- Quid est veritas?
"If you can't measure it, you can't improve it." - Lord Kelvin
pgp29tAh24SiU.pgp
Description: OpenPGP digital signature