Re: [chrony-users] Help with GPS timesync/config

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


I difficulty with gpsd and pps and I found that I had to compile gpsd without pps support. I also had to build chrony with pps support which I'm assuming you already did. Below are my gpsd notes from when I did this a couple years ago. Hopefully it's still relatively current. Apologies if some steps are obvious to you. I wrote the instructions so they could be followed by someone with limited knowledge of BBB, Linux, Chrony, etc (this includes myself especially since my memory is not so good). The instructions are also specific to the way I set my BBB up (Serial GPS data on ttyS4) so please keep that in mind. Hope this helps. I'm now happier that I took some decent notes on this so that I can help someone from this group since all of the folks here were so incredibly helpful when I was bumbling my way through.

Build gpsd Instructions

The built-in gpsd package (gotten using apt-get install) for BBB has PPS support compiled in. This causes issues because gpsd creates a PPS device for /dev/ttyS4 (serial port where GPS data is coming in). We don’t want that PPS device. Before you build all this make sure to stop the gpsd service using:

sudo systemctl stop gpsd

Get the latest source package from http://download-mirror.savannah.gnu.org/releases/gpsd

sudo apt-get install scons

sudo apt-get install chrpath

Refer to the build.txt file in the source directory for details on build options and whatnot. You can also look at SConstruct file to get more details

scons prefix=/usr pps=no

scons testregress

sudo scons uninstall

sudo scons udev-install

sudo scons install (Not sure this is even necessary)

Then restart gpsd using sudo systemctl start gpsd


On Wed, Mar 25, 2020 at 5:53 PM Dave Hajoglou <dhajoglou@xxxxxxxxx> wrote:
My scenario: I have a beablebone black with a GPS module. I can get some stability but I need some guidance on cleaning up my config/design. One behavior that I'm seeing is that gpsd is creating /dev/pps0 though it appears unusable.  ppstest returns time_pps_fetch() error -1 (Connection timed out). I configured the device tree to pickup pps off of the GPIO and that does work though I get the clear 0, seq 0, which another post highlighted as a kernel bug (source 0 - assert 1585167111.891016501, sequence: 19101 - clear  0.000000000, sequence: 0).

Never the less, this configuration does work though it's not as stable as I'd like as.  I get the "Can't synchronise: no majority" error from time to time. chrony indicates "time in error", then after a bit it reestablishes. It's worth noting that this solution is for off-grid use and will never be able to see network time as a source.

My questions are:
Can I improve my configuration settings?

Since I'm technically offline is there any option for a third time source (an earlier thread noted this can resolve the no majority issue). Would an external RTC help?

Config file:
keyfile /etc/chrony/chrony.keys

driftfile /var/lib/chrony/chrony.drift

logdir /var/log/chrony

log statistics tracking refclocks tempcomp

maxupdateskew 100.0

rtconutc

makestep 1 -1

refclock SHM 0 refid GPS precision 1e-1 

refclock PPS /dev/pps1 lock NEMA



Thanks

-hojo



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/