[ntp:questions] Re: Jonathan Buzzard's radioclkd and FreeBSD

Hans Jørgen Jakobsen hjj at wheel.dk
Sun Nov 9 18:15:07 UTC 2003


On 09 Nov 2003 16:08:47 GMT, Hans Jørgen Jakobsen wrote:
> On Thu, 6 Nov 2003 22:57:17 +0000, Chris Hastie wrote:
>> 
>> and for radioclk2
>> 
>> ash# make
>> /usr/bin/gcc -s -lm -o radioclkd2 main.o memory.o logger.o  serial.o
>> clock.o shm.o settings.o  decode_msf.o decode_dcf77.o decode_wwvb.o
>> serial.o: In function `serWaitForSerialChange':
>> serial.o(.text+0x40b): undefined reference to `lofgerf'
>> *** Error code 1
>> 
>> Stop in /usr/local/src/radioclk2-0.04.
>> 
> 
> In line 312 of serial.c change typo lofgerf -> loggerf
> 
> Then it compiles on Freebsd (4.7)
> 
> I have had it running for half hour decoding dcf.
> 
> For some yet undetermined reason it is off by 360 secs:
>  ntpq -p
>      remote           refid      st t when poll reach   delay   offset  jitter
>==============================================================================
> *ns.xxxx.xx      .GPS.            1 u  527 1024  377   10.793   -0.448   0.282
> -tix.ns.xxxx.xx  .GPS.            1 u  455 1024  377   10.758   -0.583   0.717
> -tt16.xxxx.net   .GPS.            1 u   97 1024  377   10.504   -0.177   0.515
> +gps.xxx.xx      .GPS.            1 u  129 1024  377   13.892   -0.499   0.042
> -miri.xxxx.xx    ns.xxxx.xx       2 u  601 1024  377   10.729   -0.356   0.205
> +guam.xxx.xxxx.x .GPS.            1 u  565 1024  377   10.818   -0.450   0.159
> xSHM(0)          .dcf.            0 l   40   64  377    0.000  -359999   1.187

Further investigation showed that offset was 1 hour.
Setenv/mktime didnt do the intended but timegm alone was ok.

Here is a patch:
> diff radioclk2-0.04*
diff radioclk2-0.04/decode_dcf77.c radioclk2-0.04-patched/decode_dcf77.c
160,162c160
<       setenv("TZ", "", 1);
<
<       dectimet = mktime ( &dectime );
---
>       dectimet = timegm ( &dectime );
Only in radioclk2-0.04-patched: radioclkd2
diff radioclk2-0.04/serial.c radioclk2-0.04-patched/serial.c
312c312
<                               lofgerf ( LOGGER_NOTE, "ppsfetch failed: %d\n", errno );
---
>                               loggerf ( LOGGER_NOTE, "ppsfetch failed: %d\n", errno );

(A mail will soon be send to the author)
/hjj




More information about the questions mailing list