Hello,
On Tuesday, July 5, 2005 at 10:49:46 AM +0200, Serge Bets wrote:
> Now the idea: Patch radioclkd to feed 2 SHM slots with same values
> from only 1 receiver
The dirty experimental patch is:
================================================================================
--- radioclk-1.0/radioclkd.c Tue Jan 21 12:20:03 2003
+++ radioclk-1.0.mod/radioclkd.c Fri Jul 15 12:50:35 2005
@@ -658,7 +658,7 @@ void ProcessTimeCode(struct clockInfo *c
{
time_t decoded,last;
struct timeval computer,received;
- int i,shmid,average;
+ int i,shmid,shmid2,average;
/* decode the time */
@@ -701,6 +701,12 @@ void ProcessTimeCode(struct clockInfo *c
"memory for %s", c->line);
return;
}
+ cts.stamp = AttachSharedMemory(cts.unit, &shmid2);
+ if ((shmid2==-1) || (cts.stamp==NULL)) {
+ syslog(LOG_INFO, "unable to attach shared "
+ "memory for %s", c->line);
+ return;
+ }
}
/* if possible use an averaged offset */
@@ -721,6 +727,7 @@ void ProcessTimeCode(struct clockInfo *c
received.tv_sec = decoded;
received.tv_usec = 0;
PutTimeStamp(&computer, &received, c->stamp, LEAP_NOWARNING);
+ PutTimeStamp(&computer, &received, cts.stamp, LEAP_NOWARNING);
/* log any errors in getting the time */
last = decoded-c->last;
================================================================================
I tried various ntp.conf settings. The "prefer" keyword is necessary,
otherwise ntpd makes syspeer of one of the 2 slots randomly. There are
surprising interactions between poll intervalls of SHM() refclocks.
Forcing SHM(1) to minpoll 10 is necessary, otherwise poll intervall
never raises while not syspeer. And if it's selected as syspeer,
intervall raises just to fall down to 64s at the bad moment. I ended
with:
| server 127.127.28.0 maxpoll 6 prefer
| fudge 127.127.28.0 time1 0.020 refid DCF1
| server 127.127.28.1 minpoll 10
| fudge 127.127.28.1 time1 0.020 refid DCF2
So far the result seem good, in normal operations:
| remote refid st t when poll reach delay offset jitter
| ==============================================================================
| *SHM(0) .DCF1. 0 l 41 64 377 0.000 0.116 0.238
| +SHM(1) .DCF2. 0 l 10 1024 377 0.000 0.116 0.194
And sync survives well over an hour with radioclkd stopped. I seem to
get the expected low offsets and high autonomy. Now I wait next
thuderstorm and will update you. Hey, nobody said me my idea was stupid,
so I experimented it... ;-)
Serge.
--
Serge point Bets arobase laposte point net
_______________________________________________
questions mailing list
[email protected]
https://lists.ntp.isc.org/mailman/listinfo/questions