[ntp:questions] DCF77 support in the Windows NTP port?

Dave Hart davehart at gmail.com
Mon Jan 24 16:20:27 UTC 2011


On Mon, Jan 24, 2011 at 08:46 UTC, David J Taylor
<david-taylor at blueyonder.co.uk.invalid> wrote:
> Is there simple DCF77 support in the Windows NTP port?  This would be for
> the simple receiver described here:
>
>  http://www.rrs-web.net/in3her/dcf77_32.html

I'm not sure about that particular hardware, but most of the DCF77
drivers in ntpd are part of driver 8 (confusingly referred to as
either GENERIC or parse, implemented in refclock_parse.c):

http://www.eecis.udel.edu/~mills/ntp/html/drivers/driver8.html

> A friend has one of these devices and is interested in syncing multiple PCs.
>  I only see manufacturer-specific drivers (types 38, 39 and 44) and I'm
> unsure whether the hardware above is similar to one of these types, and
> whether those types are in the Windows build (or how to find that out for
> myself).
>  Perhaps type 44 is the closest and is fairly generic for a
> serial-line presentation of the DCF77 data?

My reading of driver44.html is that the hardware decodes the DCF77
signal into a timecode string, which is not a generic "serial-line
presentation" but a higher-level representation of the decoded time.

The Windows port of ntpd is not currently built with support for
drivers 8 or 44, but it does have support for drivers 38 and 39.  To
determine for yourself is not trivial but can be done following the
trail of crumbs in the source code.  First look at refclock_conf.c to
map the driver number to a CLOCK_* preprocessor name:

http://ntp.bkbits.net:8080/ntp-dev/ntpd/refclock_conf.c

For driver 8, you can see near the end of the file:

	&refclock_parse,	/* 8 REFCLK_PARSE */

and earlier in the file:

#ifdef CLOCK_PARSE
extern	struct refclock	refclock_parse;

Then to see if the Windows port of ntpd includes that driver, look for
CLOCK_PARSE in ports/winnt/include/config.h:

http://ntp.bkbits.net:8080/ntp-dev/ports/winnt/include/config.h

It's not there, so there is at least a little work to be done to
enable it in the port.  It would be great to enable it, and would be
easiest if the developer doing so had a refclock that uses it to test
against.

A tip for anyone attempting to enable another driver in the Windows
port of ntpd:  It would be nice if all you needed to do was define the
appropriate CLOCK_* in config.h, but some drivers are doubly-disabled
in the port, thanks to their source files being marked as "excluded"
in the IDE project settings.  This redundant disabling should be
removed, but it involves not only making the changes in the IDE, but
then propagating the changes manually to the project files for three
other Visual C++ IDE versions.

Cheers,
Dave Hart



More information about the questions mailing list