JonAtkins.com logo

Site links:
Home
Distributed Computing
Software
  qgreylist
  radioclkd2
  perlgcache
PGP
Personal

radioclkd2 - an interface between simple radio clock receivers and ntpd

This program will decode the time from simple MSF, DCF77 and WWVB receivers and pass the time to ntpd via the SHM driver (28). These clocks just pass the raw second pulses to the DCD, CTS, DSR or RNG serial line.

Download: radioclkd2-0.06.tar.gz.
Older version are available here.

If you have any comments/suggestions/patches please contact me: radioclk@jonatkins.com.

Hardware

You need a MSF (UK), DCF77 (Germany/Europe) or WWVB (North America) which drives a serial line.

Want to build your own receiver? See Jonathan Buzzard's page.

The receiver module and antenna shown on the above page are no longer available from Maplin. However, Galleon sell a WWVB receiver and antenna which, as both MSF and WWVB operate at 60KHz, should be a suitable alternative.

TimeTools claim their clock outputs raw MSF, but I have not tested this.
www.timetools.co.uk.

There are several raw DCF77 clocks available - these should work but is currently untested.

Usage

You need ntpd. Download source from http://www.ntp.org/.

You need to enable SHM support in ntpd. This isn't enabled by default.

  ./configure --enable-SHM

now install ntpd

  make
  make install

Now compile and install radioclkd2:

  tar zxvf radioclkd2-0.06.tar.gz
  cd radioclkd2-0.06
  ./configure
  make
  make install

To use this as a drop-in replacement for Jonathan Buzzard's radioclkd use

 for 1 clock:  radioclkd2 ttyXX 
 for 2 clocks: radioclkd2 ttyXX ttyXX:cts

For full details, run radioclkd2 without any command line options.

Bugs and Limitations

radioclkd2 can operate in one of three modes:

  • poll
    • should work on any Posix system
    • supports all 4 serial lines, DCD, CTS, DSR and RNG
    • least accurate - perhaps +-2ms at best
  • iwait
    • Linux only - uses the TIOCMIWAIT ioctl
    • only supports DCD, CTS and DSR - RNG only triggers an interrupt one way
    • good accuracy - under +-1ms is possible, perhaps as good as +-0.2ms
  • timepps
    • FreeBSD (and Linux with ppskit? - not tested)
    • only supports DCD - only 1 clock per serial port
    • good accuracy - at least as good as iwait

There is code to handle WWVB (US) but this has not been tested yet. (Initial tests show that WWVB does not currently work)

History

0.01
  • Serial interface code done
  • Decode of MSF complete
0.02
  • Decode of DCF77 complete
  • SHM code written
  • timepps code written to support FreeBSD
  • Added code to average the time offset from the last 60 seconds
0.03
  • Decode of WWVB written but not tested
  • Command line processing written
  • Fixed DCF77 day-of-week check (it goes from 1 to 7, not 0 to 6)
  • Changed the average code to filter out bad samples
0.04
  • README written
  • Removed hard-coded clock offsets - now a run-time option
  • FIRST PUBLIC RELEASE
0.05
  • Added missing #include to decode_*.c
  • Changed time offset limit on median filter to 100ms
  • Added leap-second reporting for DCF77 and WWVB - not available in MSF
0.06
  • Changed to use autoconf
Valid XHTML 1.0!Valid CSS!