[ntp:questions] Re: Help needed getting refclock to work

Thomas Laus lausts at acm.org
Fri Oct 17 11:50:01 UTC 2003

On Thu, 16 Oct 2003 09:22:10 -0800, Roger Wiechman <Roger at HMC.Edu> wrote:

>Hi all,
> We are having trouble getting a reference clock to work.
> Students are in need of it for a research project.
> Any help would be appreciated, and if more data is needed
> I certainly can supply.
> Thanks in advance,
>         Roger, Harvey Mudd College, Claremont, CA  (roger (at) hmc.edu)

The Oncore refclock driver expects that the receiver is in an initialized state.
It may no be after using it with WinOncore.  You might initialize the receiver
before plugging it into your NTP computer.  The clockstats file will record the
dialog with the receiver as it gets its initialial position from the
configuration files.  This might give some insight into your problem.

I run an Oncore on a FreeBSD system and here are my FreeBSD configuration files:

The GENERIC kernel will have to have this line added in order for the kernel 
to use the Oncore PPS interface.  This information comes from the LINT kernel.

# Enable support for the kernel PLL to use an external PPS signal,
# under supervision of [x]ntpd(8)
# More info in ntpd documentation:


options 	PPS_SYNC


a couple of softlinks will need to be made in the /dev directory:

ln -s /dev/cuaa1 /dev/oncore.pps.0
ln -s /dev/cuaa1 /dev/oncore.serial.0

These devices are used by the Oncore driver to access the serial port.  The 
names for the devices are in the oncore.c source code.  I am using the second 
comm port on this server for the GPS receiver.  That is the reason for cuaa1 
instead of cuaa0 for the other comm port.


My ntp.conf file:

pps /dev/oncore.pps.0 clear hardpps
server	ntp-2.cso.uiuc.edu
server prefer
driftfile /var/log/ntpd

# NTP Statistics
statsdir /var/ntp/
statistics clockstats loopstats peerstats
filegen clockstats file clockstats type day enable
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable

The pps line MUST be placed before the server statement that will use the pps 
interface or it won't work (this may no longer be true).  It is useful to enable
the ntpd statistics while commissioning the clock.  There is a wealth of
information that the oncore driver sends to these files.  It helps in the
debugging effort.

Make sure that the GPS clock server statement uses the 'prefer' keyword.  The 
clock might not start if one of the peers has valid timesync data before the 
driver has initialized the receiver.  Once ntpd marks the receiver 'bad' only 
restarting the daemon will tell it to look for it again.  I never was able to 
discover the proper syntax for 'addpeer' in the ntpdc program to have ntpd try 
again and start the Oncore without killing and restarting the task.


The contents of my /etc/ntp.oncore0 file:

LONG -84 12.050
LAT 40 46.5744
HT 744,16 FT

I made a site survey and these values were the 24 hour least squares fit of 
the data that was collected.  If the GPS antenna position is not known, the 
common thread of others that have used this clock is to include at least the 
MODE 4 statement in the file.  Make sure of the directory permissions for this 
file and the statsdir (e.g. /var/ntp/).  Make sure that ntpd can write and read


I had to use a RS-232 cable that had all of the pins connected.  Others have 
said that only DCD, TXD, RXD and GND are required.  I am using the TAC-2 
interface board from TAPR and had to have the first 8 pins connected.  Pin 9 
is the Ring Indicator (RI) and is not used much for other than modem 


The correct configure switches:

configure --disable-all-clocks --enable-ONCORE

make clean
make install

This was what I used to build Oncore support into ntpd on FreeBSD.  I changed 
the directory in /etc/rc.conf to point to the /usr/local/bin directory that is 
the default for 'make install'.  NTP is part of the FreeBSD base system and 
cvsup overwrites the normal binary location on every update.  The 'stock' ntpd 
that FreeBSD uses comes without Reference Clock support.


If you are using a firewall, make sure that port 123 is open for 
timesync with other servers outside of your domain.

I'll try to answer questions about my setup and compare my configuration 
settings with any other users.


More information about the questions mailing list