Re: [chrony-users] Newbie Help Needed

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


On Thu, Jan 04, 2018 at 02:33:46PM -0800, Stuart Maclean wrote:
> > In a pseudocode the program would do something like this:
> > 
> > 	gettimeofday(&sample.tv);
> > 	sample.offset = sample.tv - CSAC; // or negative value of that?
> > 	sample.pulse = 0;
> > 	sample.leap = 0;
> > 	sample.magic = SOCK_MAGIC;
> 
> Your term 'CSAC' above, does that mean the 'seconds since epoch' string
> that came over serial from the CSAC, converted to an int?

Yes, it needs to be the number of seconds since 1970 as time_t.

> If yes,
> doesn't the exact time at which I do the gettimeofday then matter??

Only so much that chronyd will be able to assign the correct second to
the PPS timestamp. The sub-second offset between the PPS and non-PPS
samples needs to be smaller than 200 milliseconds.

> And I am wary of your comment.  Would I want sample.tv - CSAC, or the
> reverse?  If you are confused by this, then I certainly am ;)

I'm not sure :). You'll have to try. One will work, the other will
make the clock horribly unstable.

> > 	sample.tv_sec = pps_timestamp.tv_sec;
> > 	sample.tv_usec = pps_timestamp.tv_nsec / 1000;
> > 	sample.offset = pps_timestamp.tv_nsec / 1e9;
> > 	sample.pulse = 1;
> > 	sample.leap = 0;
> > 	sample.magic = SOCK_MAGIC;
> 
> Does 'pps_timestamp' above mean the Linux system time value I grabbed,
> using the kernel api call do_gettimeofday(), in the interrupt handler
> attached to the PPS event?

Yes.

> Finally, is there any requirement on how OFTEN I must get PPS events and
> CSAC time strings?  Will it all fail if I 'miss' or discard say a PPS?

A missing sample is not a problem. I think the only requirement for
accepting PPS samples is that the last sample from the "locked"
refclock has to be newer than two seconds and this can be changed with
the maxlockage option.

Ideally, the number of samples per poll should not change much and
correspond to the number of samples set by the filter option on the
refclock line.

-- 
Miroslav Lichvar

-- 
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


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