Recently I bought a Motorola Oncore UT+ GPS timing receiver on Ebay. I run Debian Linux and it seems that the refclock_oncore driver is not included in ntpd because the LinuxPPSAPI from Rodolfo Giometti is not an official part of the linux kernel (yet? ; -)
I interfaced the module with three inverters (74HC14) to my RS232 port. The TX-line was leveled with two resistors and an universal diode (DUS). In my opinion complex interfaces like the TAC2 are not necessary.
(click on image to enlarge and see the details) or click here to download the schematic of my interface interpretation.
To get my UT+ to do work for ntpd, I needed to compile ntpd from source. Normally this is not an issue, but I did not manage to include the oncore refclock in the code and continuously obtained the error:
refclock_newpeer: clock type 30 invalid
in my ntpd logfiles.
With the help of the author of the Oncore driver, Reg Clemens, the following cookbook recipe crystallized, assuming that you have a working LinuxPPS system and a patched kernel(source):
- in /usr/include ln -s /usr/src/<linux-source>/Documentation/pps/timepps.h . <- ‘.’ !
- in /usr/include/sys ln -s /usr/src/<linux-source>/Documentation/pps/timepps.h . <- ‘.’ !
- verify that you also have the links to asm, asm-generic and linux, according to Rodolfo’s wiki
- in /dev ln -s pps0 oncore.pps.0 (or whatever ppsX you will use)
- in /dev ln -s ttyS0 oncore.serial.0 (or whatever interface you’ll use, ln -s ttyS2 oncore.serial.1 is also allowed e.g.)
- download the ntpd source from www.ntp.org and untar it. I use the development version of ntp.
- configure with at least the options: ./configure –enable-ONCORE –enable-SHM
- verify from the output that there are ‘yesses’ after timepps.h and Motorola Oncore
- make
- add the following entry in ntp.conf: server 127.127.30.0 (when you used oncore.pps.0 and oncore.serial.0)
- edit /etc/ntp.oncore.0:
#
# Oncore UT+ configuration file
#
# —– mandatory lines —————-
MODE 1
LON 5 11.4548 #insert your own longitude here
LAT 52 14.2342 #insert your own lattitude here
HT 11.0 M #insert your own GPS height here
# —– optional lines ——————
DELAY 20 NS #delay is approx 5 ns/m cable (I have 4m cable between my antenna and UT+
CLEAR #negative edge is synced to UTC epochs (due to HC14 inverter, see above)
SHMEM /var/log/ntpstats/oncore.0
MASK 0
TRAIM YES - kill all ntpd processes, go to the ntpd directory and start ntpd with root privs as ./ntpd
- verify in your ntpd logfile that ntpd picks up the Oncore driver:
54571 82587.208 127.127.30.0 ONCORE DRIVER — CONFIGURING
54571 82587.208 127.127.30.0 state = ONCORE_NO_IDEA
54571 82587.225 127.127.30.0 Input mode = 1
54571 82587.225 127.127.30.0 Initializing timeing to Clear..
54571 82587.226 127.127.30.0 SHMEM (size = 3584) is CONFIGURED and available as /var/log/ntpstats/oncore.0
54571 82587.226 127.127.30.0 state = ONCORE_CHECK_I
*snip* and somewhat later…..
54571 82588.542 127.127.30.0 This looks like an Oncore UT with version 3.1 firmware.
54571 82588.542 127.127.30.0 Channels = 8, TRAIM = ON
54571 82588.542 127.127.30.0 state = ONCORE_CHECK_CHAN
54571 82593.151 127.127.30.0 Input says chan = -1
54571 82593.151 127.127.30.0 Model # says chan = 8
54571 82593.151 127.127.30.0 Testing says chan = 8
54571 82593.151 127.127.30.0 Using chan = 8
54571 82593.151 127.127.30.0 state = ONCORE_HAVE_CHAN
54571 82594.641 127.127.30.0 state = ONCORE_TEST_SENT
54571 82603.241 127.127.30.0 GPS antenna: OK
54571 82603.241 127.127.30.0 state = ONCORE_INIT
54571 82604.701 127.127.30.0 Setting Posn from input data
54571 82604.701 127.127.30.0 state = ONCORE_ALMANAC
*snip* and somewhat later……
54571 82606.941 127.127.30.0 Cable delay is set to 20 ns
54571 82609.291 127.127.30.0 Have now loaded an ALMANAC
54571 82609.291 127.127.30.0 state = ONCORE_RUN
54571 82609.291 127.127.30.0 SSstate = ONCORE_SS_DONE
54571 82610.401 127.127.30.0 ONCORE: Detected TRAIM, TRAIM = ON
54571 82610.401 127.127.30.0 Input says TRAIM = -1
54571 82610.401 127.127.30.0 Model # says TRAIM = 1
54571 82610.401 127.127.30.0 Testing says TRAIM = 1
54571 82610.401 127.127.30.0 Using TRAIM = 1
54571 82610.421 127.127.30.0 PPS Offset is set to 0 ns
54571 82610.431 127.127.30.0 Satellite mask angle is 0 degrees - Enjoy and impress your friends with your timing receiver, just like I impressed you ; -)
