Discussion:
[chrony-users] time sync query
Jahagirdar, Bhushan
2017-08-07 17:07:45 UTC
Permalink
Hi,

I am using chrony stable 3.1 version.

Below is my cfg:
#For GPS data feed
refclock SOCK /var/run/chrony.ttyS1.sock poll 2 refid GPS maxsamples 4 prefer
#For CAN data feed
refclock SOCK /var/run/chrony.ttyS2.sock poll 2 delay 0.5 refid CAN maxsamples 5

#target is one hop reachable
local stratum 1

keyfile /etc/chrony/chrony.keys

makestep 0.01 -1



Below is the chrony sources o/p:

210 Number of sources = 2

.-- 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
===============================================================================
#? GPS 0 2 377 2 -4509h[ -4509h] +/- 6567m
#? CAN 0 2 0 - +0ns[ +0ns] +/- 0ns


My query:
Although I have given makestep 0.01 -1 and maxsample for GPS refclock is set to 4, I am still not able to see the synch happening.
I am feeding offset data to GPS refclock for every 1 sec.
Can you please suggest any configuration changes here. However sometimes it works.
Similar issue I am finding in chrony 2.2 that's where I thought of testing with 3.1 if this has to do with some bug.

--
Thanks and Regards,
Bhushan J.
Bill Unruh
2017-08-07 18:00:01 UTC
Permalink
Post by Jahagirdar, Bhushan
Hi,
 
I am using chrony stable 3.1 version.
 
#For GPS data feed
refclock SOCK /var/run/chrony.ttyS1.sock poll 2 refid GPS maxsamples 4 prefer
#For CAN data feed
refclock SOCK /var/run/chrony.ttyS2.sock poll 2 delay 0.5 refid CAN maxsamples 5
No idea what CAN data feed is.
Post by Jahagirdar, Bhushan
 
#target is one hop reachable
local stratum 1
You have this why? A refclock is stratum 0. A clock that gets its time from a
refclock is stratum 1. Why are you putting this into the confic file.
Post by Jahagirdar, Bhushan
 
keyfile /etc/chrony/chrony.keys
 
makestep 0.01 -1
 
 
 
 
210 Number of sources = 2
 
  .-- 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
===============================================================================
#? GPS                           0   2   377     2   -4509h[ -4509h] +/-  6567m
#? CAN                           0   2     0     -     +0ns[   +0ns] +/-    0ns
 
 
Although I have given makestep 0.01 -1 and maxsample for GPS refclock is set to 4, I am still not able to see the synch
happening.
You have two sources. If there is a disagreeement chrony has no way of know
ing which is correct, making it impossible to decidee on a source.

Also what is your GPS? Is it supposed to be a PPS? They you need to have some
other source to give what second that pps refers to.
Post by Jahagirdar, Bhushan
I am feeding offset data to GPS refclock for every 1 sec.
How?

Note that it says that gps is over 4000 hours out.

I think that there is something very wrong is whatever is feeding time to the
SOCK.
Post by Jahagirdar, Bhushan
Can you please suggest any configuration changes here. However sometimes it works.
Similar issue I am finding in chrony 2.2 that¢s where I thought of testing with 3.1 if this has to do with some bug.
 
--
Thanks and Regards,
Bhushan J.
 
Miroslav Lichvar
2017-08-08 06:32:34 UTC
Permalink
Post by Jahagirdar, Bhushan
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
#? GPS 0 2 377 2 -4509h[ -4509h] +/- 6567m
#? CAN 0 2 0 - +0ns[ +0ns] +/- 0ns
The error of +/- 6567 minutes is probably what causes chronyd to
ignore the source. The offset of the reference time may be jumping
around. What is on the other side of the socket? Is it gpsd?

You could enable the refclocks log to see what values is chronyd
getting.
--
Miroslav Lichvar
--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Jahagirdar, Bhushan
2017-08-08 12:07:11 UTC
Permalink
Hi Miroslav,

Just to give some background of the current usage:
In my system GPS is a source of time/date which I am getting from some other controller. But I am feeding the offset every one second on the refclock. The other source CAN is not used at all currently. The reason why there is a huge offset is because it is kind of testing in the sense that if the system clock was changed to any extent, I wish chrony to set it right based on the GPS (say generically a source fed every one second to a refclock socket) data input that I am feeding to its socket.

Offset of the reference is not jumping as I am constantly feeding data every one sec.
May I know what is the max offset range that chrony can consider to correct it.

I have already experimented about makestep and found that even if the time is set to epoch, for initial feeds the time gets corrected. But what if abruptly I am setting the time to epoch then I see chrony is not able to sync.
I am trying to test the working of chrony on typical embedded system.

BR,
Bhushan J.
-----Original Message-----
From: Miroslav Lichvar [mailto:***@redhat.com]
Sent: Tuesday, August 08, 2017 12:03 PM
To: chrony-***@chrony.tuxfamily.org
Subject: [EXTERNAL] Re: [chrony-users] time sync query
Post by Jahagirdar, Bhushan
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
#? GPS 0 2 377 2 -4509h[ -4509h] +/- 6567m
#? CAN 0 2 0 - +0ns[ +0ns] +/- 0ns
The error of +/- 6567 minutes is probably what causes chronyd to ignore the source. The offset of the reference time may be jumping around. What is on the other side of the socket? Is it gpsd?

You could enable the refclocks log to see what values is chronyd getting.

--
Miroslav Lichvar

--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Miroslav Lichvar
2017-08-08 12:23:02 UTC
Permalink
Post by Jahagirdar, Bhushan
Offset of the reference is not jumping as I am constantly feeding data every one sec.
May I know what is the max offset range that chrony can consider to correct it.
If you have enabled makestep, it doesn't matter how large is the
offset. But it does matter how stable it is. The default value of
maxdistance is 3 seconds, which includes the jitter of the refclock.
In your case the reported distance (the +/- value) was in hours.
Post by Jahagirdar, Bhushan
I have already experimented about makestep and found that even if the time is set to epoch, for initial feeds the time gets corrected. But what if abruptly I am setting the time to epoch then I see chrony is not able to sync.
I am trying to test the working of chrony on typical embedded system.
Can you please post the refclocks and statistics logs? We should
better see what is happening.
--
Miroslav Lichvar
--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Jahagirdar, Bhushan
2017-08-14 05:51:26 UTC
Permalink
Hi Miroslav,

Attaching the log files.
Please let me know if you need more data to analyze the use case.

I will again describe the use case that I am testing on my embedded system:
Version of chrony: 2.2.1
Time source : GPS time. Fed through refclock as GPS is connected on other controller than SOC.
Use cases:
1. At system boot up, epoch time should be set to GPS time. --> works well
2. At run time feed bigger time offset for some time and then again start feeding correct GPS data. In this use case I see, chrony is able to set GPS data in case if the offset is smaller or any offset fed for very short time. But if it's bigger offset is fed, then it never syncs the time back soon; at least not within a minute. I need to know the relation between offset, amount of time chrony might need to sync the offset and source stability.

BR,
Bhushan.

-----Original Message-----
From: Miroslav Lichvar [mailto:***@redhat.com]
Sent: Tuesday, August 08, 2017 5:53 PM
To: chrony-***@chrony.tuxfamily.org
Subject: Re: [EXTERNAL] Re: [chrony-users] time sync query
Post by Jahagirdar, Bhushan
Offset of the reference is not jumping as I am constantly feeding data every one sec.
May I know what is the max offset range that chrony can consider to correct it.
If you have enabled makestep, it doesn't matter how large is the offset. But it does matter how stable it is. The default value of maxdistance is 3 seconds, which includes the jitter of the refclock.
In your case the reported distance (the +/- value) was in hours.
Post by Jahagirdar, Bhushan
I have already experimented about makestep and found that even if the time is set to epoch, for initial feeds the time gets corrected. But what if abruptly I am setting the time to epoch then I see chrony is not able to sync.
I am trying to test the working of chrony on typical embedded system.
Can you please post the refclocks and statistics logs? We should better see what is happening.

--
Miroslav Lichvar

--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Bill Unruh
2017-08-14 10:20:02 UTC
Permalink
Post by Jahagirdar, Bhushan
Hi Miroslav,
Attaching the log files.
Please let me know if you need more data to analyze the use case.
Version of chrony: 2.2.1
Why? What is the purpose of this? You are doing it for fun or for your own
learning? What makes you think this will ever come up in practice?
Post by Jahagirdar, Bhushan
Time source : GPS time. Fed through refclock as GPS is connected on other controller than SOC.
1. At system boot up, epoch time should be set to GPS time. --> works well
2. At run time feed bigger time offset for some time and then again start feeding correct GPS data. In this use case I see, chrony is able to set GPS data in case if the offset is smaller or any offset fed for very short time. But if it's bigger offset is fed, then it never syncs the time back soon; at least not within a minute. I need to know the relation between offset, amount of time chrony might need to sync the offset and source stability.
BR,
Bhushan.
-----Original Message-----
Sent: Tuesday, August 08, 2017 5:53 PM
Subject: Re: [EXTERNAL] Re: [chrony-users] time sync query
Post by Jahagirdar, Bhushan
Offset of the reference is not jumping as I am constantly feeding data every one sec.
May I know what is the max offset range that chrony can consider to correct it.
If you have enabled makestep, it doesn't matter how large is the offset. But it does matter how stable it is. The default value of maxdistance is 3 seconds, which includes the jitter of the refclock.
In your case the reported distance (the +/- value) was in hours.
Post by Jahagirdar, Bhushan
I have already experimented about makestep and found that even if the time is set to epoch, for initial feeds the time gets corrected. But what if abruptly I am setting the time to epoch then I see chrony is not able to sync.
I am trying to test the working of chrony on typical embedded system.
Can you please post the refclocks and statistics logs? We should better see what is happening.
--
Miroslav Lichvar
--
with "unsubscribe" in the subject.
with "help" in the subject.
--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Miroslav Lichvar
2017-08-14 12:22:15 UTC
Permalink
Post by Jahagirdar, Bhushan
Hi Miroslav,
Attaching the log files.
Please let me know if you need more data to analyze the use case.
We need to see also the refclocks log (enabled by log refclocks in
chrony.conf).

I suspect the problem happens when the refclock is stepped right in
the middle of the 4-second polling interval, so there are two samples
before step and two samples after step. The median filter can't handle
that well and the dispersion jumps to a large value, which then takes
a long time to settle down. As a workaround, I think you could add
"filter 1" to the refclock log, which will prevent the dispersion from
changing. As others said, this might not be the best way to test
things. Reference clocks are not supposed to jump by months.
--
Miroslav Lichvar
--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Loading...