[unix-pc.general] Getting the time over the phone from NBS

thad@cup.portal.com (Thad P Floryan) (01/19/90)

In article <BOB.90Jan17123008@volitans.MorningStar.Com> by
bob@MorningStar.Com (Bob Sutterfield) to alt.sources,rec.ham-radio, he writes:

"	In article <899@tridom.uucp> wht@tridom.uucp (Warren Tucker) writes:
	   v03i079 contains a GREAT program utc.c which allows your system to
	   mimic NBS and provide esentially the same service via a local call.
	   Only the most ultimate time freaks who've replaced their PC's
	   crystal with an atomic clock can tell the difference (I'm pretty
	   bad, but not that bad) :-).

	I'd hope that only folks either running a local radio clock, or a low-
	stratum NTP peer, would offer their system's time as a community
	standard.  However, this would be a really nice service for Internet-
	connected folks to offer to their UUCP-only neighbors.
"

Is there some ESP going on here?  :-)

I've put together a prototype system that does just what Karl describes.  My
time reference is a HeathKit GC-1000 "Most Accurate Clock" which locks onto
NIST's (formerly NBS') WWV at 5, 10 or 15 MHz to provide +/- 10 mSec Universal
Time Coordinated on its RS-232c port.  I've been testing the setup since:

$ loglook utc
Login ID         First                    Last            Name
--------  ----------------------  ----------------------  --------------------
utc       Sat 14-Oct-89 17:59:07  Thu 18-Jan-90 23:12:28  UTC time service
              ^^^^^^^^^
Note that date; 3 days later my antenna snapped during the earthquake, and I
haven't repaired it ... I'm in Silicon Valley, and the antenna is a huge
inverted "V" whose apex WAS at the top of a 40' tower.   :-(

At the moment, one of my systems calls the US Naval Observatory service in
Washington DC every 2 days to maintain time-sync locally, but once I repair
the antenna AND get some more phone lines installed, this service will be
publicly online and I'll post its availability along with all the software.

I use the service to coordinate time for all my LAN-based systems.  The server
provides a time reference identical to the USNO per:

	*
	jjjjj ddd hhmmss UTC

where:	jjjjj	Julian date modulo 2400000
	ddd	days since beginning of year
	hhmmss	time of day in Universal Time Coordinated

based on a program by Michael Scott Baldwin of AT&T Bell Labs.

If you'd like to install and provide such a service on your system, you need
an accurate time reference (the Heath clock is my recommendation: kit price
from their Winter 1990 Catalog No. 219 is $249.95 for the clock and $49.95 for
the RS-232 interface (see page 28)), and:

$ ls -l /usr/local/bin/utcs*
-rwxr-xr-x  1 thad    users      3156 Oct 14 17:22 /usr/local/bin/utcservice

$ file /usr/local/bin/utcs*
/usr/local/bin/utcservice:	mc68k executable (shared demand paged with \
shared library) -F (0413 demand paged) 

and entries for /etc/passwd:

	utc::50:50:UTC time service:/usr/local/bin:/usr/local/bin/utcservice

and /etc/group:

	utcpub::50:utc

All a client system(s) need do is install the "capture" program and execute
it per:

	# must run this as super-user
	#
	echo "\nutc" | cu thadlabs | /usr/local/bin/utcset -s
	exit 0

from a crontab entry like the following:

	#Mn  Hr Da Mo Da (0=SUN, 1=MON, 2=TUE, 3=WED, 4=THU, 5=FRI, 6=SAT)
	#of  of of of of
	#Hr  Da Mo Yr Wk  Command
	#
	03    3  *  *  *  /bin/su root -c "/usr/local/bin/utcset.sh >/dev/null"

assuming one has a /usr/lib/uucp/Systems (or L.sys) entry for the server.

The above is how I've configured the service to date.  Because some "cu" don't
seem to respond to SIGPIPE properly, I'm planning on generalizing the client
program to itself connect and retrieve the server info, and will post the
whole package when it's complete.  If someone would like to help (my time is
VERY limited) and/or you'd like some more info, feel welcome to contact me:

Thad Floryan [ thad@cup.portal.com (OR) ..!sun!portal!cup.portal.com!thad ]