From: Harlan Stenn
Date: Sat, 22 Sep 2001 06:31:31 +0000 (-0400)
Subject: Add support for the JJY receiver.
X-Git-Tag: NTP_4_1_72~49^2
X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed7f8ca1e0fec22003fe1329dab13f007f8122ce;p=thirdparty%2Fntp.git
Add support for the JJY receiver.
From: Takao Abe
bk: 3bac3043ALO8l_IpNEcjdxj3qO-upA
---
diff --git a/acconfig.h b/acconfig.h
index 6e01af3644..a53ba82e40 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -82,6 +82,9 @@
/* Sun IRIG audio decoder */
#undef CLOCK_IRIG
+/* JJY receiver */
+#undef CLOCK_JJY
+
/* Rockwell Jupiter GPS clock */
#undef CLOCK_JUPITER
diff --git a/configure.in b/configure.in
index 1317f1a877..9c876c3c89 100644
--- a/configure.in
+++ b/configure.in
@@ -1557,7 +1557,6 @@ AC_ARG_ENABLE(HOPFSERIAL, [ --enable-HOPFSERIAL + hopf serial clock device
fi
AC_MSG_RESULT($ntp_ok)
-
AC_MSG_CHECKING(for hopf PCI clock 6039)
AC_ARG_ENABLE(HOPFPCI, [ --enable-HOPFPCI + hopf 6039 PCI board],
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
@@ -1795,6 +1794,15 @@ case "$ntp_ok$ntp_canaudio" in
yesno) AC_MSG_WARN(*** But the expected answer is... no ***) ;;
esac
+AC_MSG_CHECKING(for JJY receiver)
+AC_ARG_ENABLE(JJY, [ --enable-JJY + JJY receiver],
+ [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
+if test "$ntp_ok" = "yes"; then
+ ntp_refclock=yes
+ AC_DEFINE(CLOCK_JJY)
+fi
+AC_MSG_RESULT($ntp_ok)
+
AC_MSG_CHECKING(Leitch CSD 5300 Master Clock System Driver)
AC_ARG_ENABLE(LEITCH, [ --enable-LEITCH + Leitch CSD 5300 Master Clock System Driver],
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
diff --git a/html/driver40.htm b/html/driver40.htm
new file mode 100644
index 0000000000..2fcc181722
--- /dev/null
+++ b/html/driver40.htm
@@ -0,0 +1,232 @@
+
+
+
+
+
+
+
+
+
+JJY Receivers
+
+
+
+
+
+
+
+JJY Receiver
+
+
+
+Synopsis
+
+
+| Address | : | 127.127.40.X |
+| Reference ID | : | JJY |
+| Driver ID | : | JJY |
+| Serial Device | : | /dev/jjyX |
+| Serial Port | : | 9600 BPS, 8-bits, No parity, 1-stop-bit |
+
+
+Description
+
+
+This driver supports following JJY receivers sold in Japan.
+
+
+
+
+- Tristate Ltd. JJY01
+Information
+http://www.tristate.ne.jp/rf-clock.htm ( Written in Japanese only )
+
+Time code format
+
+| Command | Reply |
+| date<CR><LF> | YYYY/MM/DD WWW<CR><LF> |
+| stim<CR><LF> | HH:MM:SS<CR><LF> |
+
+
+
+
+- C-DEX Co.,Ltd. JST2000
+Information
+http://www.c-dex.co.jp/ ( Written in Japanese only )
+
+Time code format
+
+| Command | Reply |
+| <ENQ>1J<ETX> | <STX>JYYMMDD HHMMSSS<ETX> |
+
+
+
+
+
+
+
+The JJY is the radio station which transmites the JST ( Japan Standard Time ) in long wave radio.
+The station JJY is operated by the Communication Research Laboratory.
+An operating announcement and some information are avaiable from as follows;
+http://www.crl.go.jp/ ( English and Japanese )
+http://jjy.crl.go.jp/ ( Written in Japanese only )
+
+
+Serial Port Configuration
+
+
+The driver attempts to open the device /dev/jjyX
+where X is the NTP refclock unit number as defined by the LSB of the refclock address.
+Valid refclock unit numbers are 0 - 3.
+
+
+The user is expected to provide a symbolic link to an available serial port device.
+This is typically performed by a command such as:
+
+ln -s /dev/ttyS0 /dev/jjy0
+
+Windows NT does not support symbolic links to device files.
+COMX: is used by the driver, based on the refclock unit number,
+where unit 1 corresponds to COM1: and unit 3 corresponds to COM3:
+
+
+NTP Configuration
+
+
+The server command is used to configure the JJY receiver, where the address argument in that command is the "127.127.40.X".
+The mode option must be added for the supported JJY receiver.
+
+
+# JJY receiver
+server 127.127.40.X mode N
+#
+# Where
+# X = 0 to 3
+# N = 1 for Tristate TS-JJY01
+# 2 for C-DEX JST2000
+
+# Drift file
+driftfile /var/ntp/ntp.drift
+
+# Monitor data ( Optional )
+statsdir /var/ntp/
+filegen peerstats file peerstats type day enable
+filegen loopstats file loopstats type day enable
+filegen clockstats file clockstats type day enable
+
+
+
+Samples of the configuration file "ntp.conf" for the JJY receiver.
+
+
+
+
+- Tristate Ltd. JJY01
+
+
+
+
+
+# JJY receiver ( Tristate JJY01 )
+server 127.127.40.0 mode 1
+
+# Drift file
+driftfile /var/ntp/ntp.drift
+
+ |
+
+
+
+
+- C-DEX Co.,Ltd. JST2000
+
+
+
+
+
+# JJY receiver ( C-DEX JST2000 )
+server 127.127.40.0 mode 2
+
+# Drift file
+driftfile /var/ntp/ntp.drift
+
+ |
+
+
+
+
+
+
+
+Fudge Factors
+
+
+- time1 time
+- Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
+
+- time2 time
+- Not used by this driver.
+
+- stratum number
+- Specifies the driver stratum, in decimal from 0 to 15, with default 0.
+
+- refid string
+- Specifies the driver reference identifier, an ASCII string, with default JJY.
+
+- flag1 0 | 1
+- Not used by this driver.
+
+- flag2 0 | 1
+- Not used by this driver.
+
+- flag3 0 | 1
+- Not used by this driver.
+
+- flag4 0 | 1
+- Not used by this driver.
+
+
+
+Monitor Data
+
+
+A timecode is written to the clockstats file, if the ntpd is configured to enable writing of statistics records
+
+
+
+
+
+Copyright (C) 2001, Takao Abe. All rights reserved.
+Questions or Comments : abetakao@bea.hi-ho.ne.jp
+
+
+
+This driver is developed in my private time, and is opened as voluntary contributions for the NTP.
+The manufacturer of the JJY receiver has not participated in a development of this driver.
+The manufacturer does not warrant anything about this driver, and is not liable for anything about this driver.
+
+
+
+
+
diff --git a/html/qth.htm b/html/qth.htm
index 200d3fb1f6..47a29f33eb 100644
--- a/html/qth.htm
+++ b/html/qth.htm
@@ -1,6 +1,20 @@
-
+
+
+
+
Stations, Frequencies and Geographic Coordinates
-
+
+
+
+
+
Stations, Frequencies and Geographic Coordinates
@@ -57,6 +71,18 @@ published by the ITU and other sources.
47:10N 2:12E |
+
+| JJY ( Fukushima, JAPAN ) |
+40 KHz |
+37:22 N 140:51 E |
+
+
+
+| JJY ( Saga, JAPAN ) |
+60 KHz |
+33:28 N 130:11 E |
+
+
WWV)
Type 38 hopf GPS/DCF77 6021/komp for
Serial Line (HOPF_S)
Type 39 hopf GPS/DCF77 6039 for PCI-Bus
-(HOPF_P)
+(HOPF_P)
+Type 40 The Tristate Ltd. JJY receiver
+(JJY)
+
* All TrueTime receivers are now supported by one driver, type
5. Types 15 and 25 will be retained only for a limited time and may
diff --git a/include/ntp.h b/include/ntp.h
index f7ade0dd38..eaf9228e10 100644
--- a/include/ntp.h
+++ b/include/ntp.h
@@ -457,7 +457,8 @@ struct peer {
#define REFCLK_FG 37 /* Forum Graphic GPS */
#define REFCLK_HOPF_SERIAL 38 /* hopf DCF77/GPS serial line receiver */
#define REFCLK_HOPF_PCI 39 /* hopf DCF77/GPS PCI receiver */
-#define REFCLK_MAX 39 /* Grow as needed... */
+#define REFCLK_JJY 40 /* JJY receiver */
+#define REFCLK_MAX 40 /* Grow as needed... */
/*
* We tell reference clocks from real peers by giving the reference
diff --git a/libntp/clocktypes.c b/libntp/clocktypes.c
index cdfe3564b2..69250aa5a1 100644
--- a/libntp/clocktypes.c
+++ b/libntp/clocktypes.c
@@ -90,6 +90,8 @@ struct clktype clktypes[] = {
"HOPF_S"},
{ REFCLK_HOPF_PCI, "hopf Elektronic PCI receiver (39)",
"HOPF_P"},
+ { REFCLK_JJY, "JJY receiver (40)",
+ "JJY" },
{ -1, "", "" }
};
diff --git a/ntpd/Makefile.am b/ntpd/Makefile.am
index 718d9969fe..176189f265 100644
--- a/ntpd/Makefile.am
+++ b/ntpd/Makefile.am
@@ -30,7 +30,7 @@ ntpd_SOURCES = cmd_args.c jupiter.h map_vme.c ntp_config.c ntp_control.c \
refclock_chronolog.c refclock_chu.c refclock_conf.c refclock_datum.c \
refclock_dumbclock.c refclock_fg.c refclock_gpsvme.c refclock_heath.c \
refclock_hopfser.c refclock_hopfpci.c \
- refclock_hpgps.c refclock_irig.c refclock_jupiter.c refclock_leitch.c \
+ refclock_hpgps.c refclock_irig.c refclock_jjy.c refclock_jupiter.c refclock_leitch.c \
refclock_local.c refclock_msfees.c refclock_mx4200.c refclock_nmea.c \
refclock_oncore.c refclock_palisade.c refclock_palisade.h \
refclock_parse.c refclock_pcf.c refclock_pst.c refclock_ptbacts.c \
diff --git a/ntpd/ntp_control.c b/ntpd/ntp_control.c
index 570e2f90f7..a423d9a89f 100644
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -395,6 +395,7 @@ static u_char clocktypes[] = {
CTL_SST_TS_LF, /* REFCLK_FG (37) */
CTL_SST_TS_UHF, /* REFCLK_HOPF_SERIAL (38) */
CTL_SST_TS_UHF, /* REFCLK_HOPF_PCI (39) */
+ CTL_SST_TS_LF, /* REFCLK_JJY (40) */
};
diff --git a/ntpd/refclock_conf.c b/ntpd/refclock_conf.c
index 0e6c927ee0..2c8b1beb3f 100644
--- a/ntpd/refclock_conf.c
+++ b/ntpd/refclock_conf.c
@@ -240,6 +240,12 @@ extern struct refclock refclock_hopfpci;
#define refclock_hopfpci refclock_none
#endif
+#ifdef CLOCK_JJY
+extern struct refclock refclock_jjy;
+#else
+#define refclock_jjy refclock_none
+#endif
+
/*
* Order is clock_start(), clock_shutdown(), clock_poll(),
* clock_control(), clock_init(), clock_buginfo, clock_flags;
@@ -286,7 +292,8 @@ struct refclock *refclock_conf[] = {
&refclock_wwv, /* 36 REFCLOCK_WWV_AUDIO */
&refclock_fg, /* 37 REFCLOCK_FG */
&refclock_hopfser, /* 38 REFCLK_HOPF_SERIAL */
- &refclock_hopfpci /* 39 REFCLK_HOPF_PCI */
+ &refclock_hopfpci, /* 39 REFCLK_HOPF_PCI */
+ &refclock_jjy /* 40 REFCLK_JJY */
};
u_char num_refclock_conf = sizeof(refclock_conf)/sizeof(struct refclock *);