Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Accurate time without a network connection?

6 views
Skip to first unread message

David Kelly

unread,
Apr 22, 2003, 2:46:30 PM4/22/03
to FreeBSD-...@freebsd.org
Looking for options to keep system time moderately accurate at a site
without network access. So the normal application of ntpd over IP is
not viable. Dialup modem not allowed either.

Definition of "moderately accurate": doesn't have to be any better than
I can set my watch, travel to the site, and set the system time. It just
has to eliminate "travel to the site."

A GPS is one possible solution using the appropriate ntpd driver. Am not
sure I can place the GPS antenna in a suitable location.

A WWV receiver would be another viable option but I am not having any
great success in finding a prebuilt receiver with decoder suitable for
direct connection to serial port and ntpd.

--
David Kelly N4HHE, dke...@hiwaay.net
=====================================================================
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.
_______________________________________________
freebsd-...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"

Volker Kindermann

unread,
Apr 22, 2003, 3:16:45 PM4/22/03
to freebsd-...@freebsd.org
Hi David,


> Looking for options to keep system time moderately accurate at a site
> without network access. So the normal application of ntpd over IP is
> not viable. Dialup modem not allowed either.

there are external, atomic watch controlled clocks for the serial port.
Look at your electronic dealer.

-volker

Charles Swiger

unread,
Apr 22, 2003, 3:25:37 PM4/22/03
to FreeBSD-...@freebsd.org
On Tuesday, April 22, 2003, at 02:45 PM, David Kelly wrote:
> Looking for options to keep system time moderately accurate at a site
> without network access. So the normal application of ntpd over IP is
> not viable. Dialup modem not allowed either.
>
> Definition of "moderately accurate": doesn't have to be any better than
> I can set my watch, travel to the site, and set the system time. It
> just
> has to eliminate "travel to the site."

Ok. If you run NTPD with only the local hardware clock for a
reference, wait for a week, and then see how the intrinsic drift of the
hardware compares with "real time" (using your watch or some other time
source), you can adjust /etc/ntp.drift by hand. This isn't going to be
perfect, but it's going to be much more accurate than doing nothing.

--
-Chuck

David Kelly

unread,
Apr 22, 2003, 3:34:38 PM4/22/03
to Volker Kindermann, freebsd-...@freebsd.org
On Tue, Apr 22, 2003 at 09:16:11PM +0200, Volker Kindermann wrote:
>
> > Looking for options to keep system time moderately accurate at a site
> > without network access. So the normal application of ntpd over IP is
> > not viable. Dialup modem not allowed either.
>
> there are external, atomic watch controlled clocks for the serial port.
> Look at your electronic dealer.

I know there are, but at the moment I'm not finding any. The original
was "World's Most Accurate Clock" by Heathkit, $400, but long out of
business.

Oregon Scientific has a lot of WWV clocks but none I could find with an
external interface.

Surfing http://www.ntp.org/ has turned up a lot of information but
little hardware. Of most interest was use of sound card connected to
radio receiver for decoding the time signals. But that's a touch exotic
for this application. Else I'd use the $20 LCD "atomic clock" I have on
my wall, a $25 USB "web-cam", and some sort of OCR.

--
David Kelly N4HHE, dke...@hiwaay.net
=====================================================================
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.

David Kelly

unread,
Apr 22, 2003, 3:49:35 PM4/22/03
to Charles Swiger, FreeBSD-...@freebsd.org
On Tue, Apr 22, 2003 at 03:26:19PM -0400, Charles Swiger wrote:
>
> Ok. If you run NTPD with only the local hardware clock for a
> reference, wait for a week, and then see how the intrinsic drift of the
> hardware compares with "real time" (using your watch or some other time
> source), you can adjust /etc/ntp.drift by hand. This isn't going to be
> perfect, but it's going to be much more accurate than doing nothing.

Good. But already tried that. The situation is multiple systems have to
run with something near the same time, but no bidirectional contact. And
need to operate for years. Letting ntpd tune itself and then free run
works much better than the system clock alone but only good for weeks,
not months.

As for exactly what time the systems have, it doesn't much matter as
long as they all have the same time.

--
David Kelly N4HHE, dke...@hiwaay.net
=====================================================================
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.

Mxsmanic

unread,
Apr 22, 2003, 3:57:53 PM4/22/03
to David Kelly, <freebsd-questions@freebsd.org> <20030422184554.GA13432@grumpy.dyndns.org><20030422211611.10aa753a.freebsd@secspace.de>
> I know there are, but at the moment I'm not
> finding any. The original was "World's Most
> Accurate Clock" by Heathkit, $400, but long out of
> business.

See

http://www.boulder.nist.gov/timefreq/general/receiverlist.htm

A fairly complete list of manufacturers of time receivers, both
GPS-controlled and radio-controlled, for the U.S. only.

Beware: Even the cheapest devices of this kind seem to cost several hundred
dollars. A tiny serial-port radio-controlled clock from Meinberg costs
€573, which is about ten times more than it is actually worth. That amount
of money could pay for several years of Internet access, so unless you
absolutely cannot connect to the Net, finding a way to synchronize to
servers on the Net would be way cheaper.

Kent Stewart

unread,
Apr 22, 2003, 4:01:53 PM4/22/03
to David Kelly, Charles Swiger, FreeBSD-...@freebsd.org
On Tuesday 22 April 2003 12:44 pm, David Kelly wrote:
> On Tue, Apr 22, 2003 at 03:26:19PM -0400, Charles Swiger wrote:
> > Ok. If you run NTPD with only the local hardware clock for a
> > reference, wait for a week, and then see how the intrinsic drift of
> > the hardware compares with "real time" (using your watch or some
> > other time source), you can adjust /etc/ntp.drift by hand. This
> > isn't going to be perfect, but it's going to be much more accurate
> > than doing nothing.
>
> Good. But already tried that. The situation is multiple systems have
> to run with something near the same time, but no bidirectional
> contact. And need to operate for years. Letting ntpd tune itself and
> then free run works much better than the system clock alone but only
> good for weeks, not months.
>
> As for exactly what time the systems have, it doesn't much matter as
> long as they all have the same time.

It sounds like you really need an external clock that is very stable.
There was a discussion on -hackers a long time ago about doing
something like that. I think they were using a gps based clock for a
reference.

If you don't have access to a common time, nothing short of access to
WWVB (the Navy Time Radio Station) would keep your time current.

Kent

--
Kent Stewart
Richland, WA

http://users.owt.com/kstewart/index.html

John Murphy

unread,
Apr 22, 2003, 5:20:44 PM4/22/03
to David Kelly, ques...@freebsd.org
David Kelly <dke...@hiwaay.net> wrote:

>Surfing http://www.ntp.org/ has turned up a lot of information but
>little hardware. Of most interest was use of sound card connected to
>radio receiver for decoding the time signals. But that's a touch exotic
>for this application. Else I'd use the $20 LCD "atomic clock" I have on
>my wall, a $25 USB "web-cam", and some sort of OCR.

I nearly fell off my chair laughing after reading that 'solution'!

There's a self build method at the following URL with notes for USA =
users:
http://www.buzzard.org.uk/jonathan/radioclock.html
I'm determined to make one (or two) myself soon.

I think Charles Swiger gave the answer which will suit you best.

John.

Mxsmanic

unread,
Apr 22, 2003, 5:31:56 PM4/22/03
to FreeBSD Questions
In the past I simply watched the time on the server that was to serve as my
time reference, noted the drift over a few days, then wrote a very simple
daemon that periodically skewed the time to compensate for the drift. I was
surprised at how easy it was to get the server to stay within 1 second of
the correct time for periods of several days with this simple and crude
adjustment. The PC clock was way off (more than six seconds a day), but it
was fairly consistently so, so with a bit of tweaking I managed to keep it
close to the correct time.

I was still happy to get the network connection back up, though.

I did look at a few radio-controlled clocks (the GPS ones were not an
option, as I have no place to put the antenna), but since I could buy
another server for the price of the cheapest among them, they were not
really a realistic option.

----- Original Message -----
From: "John Murphy" <j...@blueyonder.co.uk>
To: "David Kelly" <dke...@hiwaay.net>
Cc: <ques...@freebsd.org>
Sent: Tuesday, April 22, 2003 23:19
Subject: Re: Accurate time without a network connection?


> David Kelly <dke...@hiwaay.net> wrote:
>
> >Surfing http://www.ntp.org/ has turned up a lot of information but
> >little hardware. Of most interest was use of sound card connected to
> >radio receiver for decoding the time signals. But that's a touch exotic
> >for this application. Else I'd use the $20 LCD "atomic clock" I have on
> >my wall, a $25 USB "web-cam", and some sort of OCR.
>
> I nearly fell off my chair laughing after reading that 'solution'!
>

> There's a self build method at the following URL with notes for USA users:

David Kelly

unread,
Apr 22, 2003, 10:46:24 PM4/22/03
to j...@blueyonder.co.uk, ques...@freebsd.org
On Tuesday 22 April 2003 04:19 pm, John Murphy wrote:
> David Kelly <dke...@hiwaay.net> wrote:
> >Surfing http://www.ntp.org/ has turned up a lot of information but
> >little hardware. Of most interest was use of sound card connected to
> >radio receiver for decoding the time signals. But that's a touch
> > exotic for this application. Else I'd use the $20 LCD "atomic
> > clock" I have on my wall, a $25 USB "web-cam", and some sort of
> > OCR.
>
> I nearly fell off my chair laughing after reading that 'solution'!

Its something I'm afraid I'm going to have to do it one day just for the
silliness. "Take that Linux! See how superior FreeBSD is with such cool
stuff!" The irony is how much less such a solution would cost than
purpose built-for-computer radio clocks. Other variations would read
the time off analog clock faces, and sundials.

> There's a self build method at the following URL with notes for USA

> users: http://www.buzzard.org.uk/jonathan/radioclock.html
> I'm determined to make one (or two) myself soon.

That's a really interesting URL. Had already turned up bits and pieces
of what was mentioned there. Had fumbled around in the
German-language-only http://www.hkw-elektronik.de/ site where many of
the parts come from but lacked a North American distributor or any
mention of prices.

> I think Charles Swiger gave the answer which will suit you best.

Its a solution we've already tried. A calibrated ntp.drift file helps a
bunch but isn't good for weeks, months or years. This is Unix where
simplicity and low maintenance designs are expected. It is not Windows
where careers are made by keeping everyone dependent on the high
priests.


--
David Kelly N4HHE, dke...@hiwaay.net
=====================================================================
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.

Joel Rees

unread,
Apr 23, 2003, 4:54:38 AM4/23/03
to David Kelly, FreeBSD-...@freebsd.org
> On Tue, Apr 22, 2003 at 03:26:19PM -0400, Charles Swiger wrote:
> >
> > Ok. If you run NTPD with only the local hardware clock for a
> > reference, wait for a week, and then see how the intrinsic drift of the
> > hardware compares with "real time" (using your watch or some other time
> > source), you can adjust /etc/ntp.drift by hand. This isn't going to be
> > perfect, but it's going to be much more accurate than doing nothing.
>
> Good. But already tried that. The situation is multiple systems have to
> run with something near the same time, but no bidirectional contact. And
> need to operate for years. Letting ntpd tune itself and then free run
> works much better than the system clock alone but only good for weeks,
> not months.
>
> As for exactly what time the systems have, it doesn't much matter as
> long as they all have the same time.

If you're serious about it not mattering exactly what time they have,
what's the problem with letting one machine be the time server, letting
it tune itself and then free run, and syncing all the rest to the
slightly-off-time-server?

--
Joel Rees <jo...@alpsgiken.gr.jp>

David Kelly

unread,
Apr 23, 2003, 12:15:02 PM4/23/03
to Joel Rees, FreeBSD-...@freebsd.org
On Wed, Apr 23, 2003 at 05:58:47PM +0900, Joel Rees wrote:
> > On Tue, Apr 22, 2003 at 03:26:19PM -0400, Charles Swiger wrote:
> >
> > As for exactly what time the systems have, it doesn't much matter as
> > long as they all have the same time.
>
> If you're serious about it not mattering exactly what time they have,
> what's the problem with letting one machine be the time server, letting
> it tune itself and then free run, and syncing all the rest to the
> slightly-off-time-server?

Because the other systems do not have a link to the first.

I could sync them all to a common source they could *hear* but the
customer won't allow them to *talk* to anything.

--
David Kelly N4HHE, dke...@hiwaay.net
=====================================================================
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.

Bill Moran

unread,
Apr 23, 2003, 1:17:18 PM4/23/03
to David Kelly, FreeBSD-...@freebsd.org, Joel Rees
David Kelly wrote:
> On Wed, Apr 23, 2003 at 05:58:47PM +0900, Joel Rees wrote:
>
>>>On Tue, Apr 22, 2003 at 03:26:19PM -0400, Charles Swiger wrote:
>>>
>>>As for exactly what time the systems have, it doesn't much matter as
>>>long as they all have the same time.
>>
>>If you're serious about it not mattering exactly what time they have,
>>what's the problem with letting one machine be the time server, letting
>>it tune itself and then free run, and syncing all the rest to the
>>slightly-off-time-server?
>
> Because the other systems do not have a link to the first.
>
> I could sync them all to a common source they could *hear* but the
> customer won't allow them to *talk* to anything.

I've recently become interested in the theory behind NTP and timekeeping
in general (because of situations in my work that have gotten me interested)
and have followed this thread with some curiousity.

Mind if I ask some rather off-the-wall questions to possible formulate some
out-of-the box ideas?

What, exactly, is the environment you are doing this in? If I remember
previous posts correctly: You need time keeping, it doesn't have to be
very accurate, or even "correct" (to the degree that the time could be
outright wrong as long as it's consistent within the company - did I
undestand that right?) The machine in question is not permitted to access
ANYTHING via a network, even other machines withing the company?

First off, can you explain the rational behind this? It sounds crazy to
me. Almost sounds like you're asking for the user to have 100% control
over their computer (root access) while being 100% sure that they'd never
mess anything up ;)

With the requirements you've described ... my first guess would be to tell
you to install some sort of high-accuracy clock in the facility that
broadcasts a radio signal, and set up a receiver on every computer in the
office to sync off it.

However, you never state it precisely, but your insistence on isolation
suggest a security concern (is that the reason?) and that radio signal
could easily be hijacked and (best case) used to foul the time keeping
of the whole office or (worste case: the NTP driver you use has flaws)
compromise the systems using the signal.

With that in mind, I would suggest wiring the machines up and using NTP
over the network to sync off one machine that is kept updated either
manually, or via a high-accuracy clock connected to a com port or
something. It's a lot easier to keep a wired network secure than any
kind of radio/wireless network.

Again ... I'm hoping you can provide more details about the reason you're
trying to do things the way you are. It really seems like you're asking
for the impossible and you'd be better off listing out your conflicting
goals and determining which one you can discard.

Hope this is helpful and not confrontational in any way: it's intended
to be helpful.

--
Bill Moran
Potential Technologies
http://www.potentialtech.com

Arthur W. Neilson III

unread,
Apr 23, 2003, 3:31:30 PM4/23/03
to David Kelly, freebsd-...@freebsd.org
--On Tuesday, April 22, 2003 1:45 PM -0500 David Kelly said:
| Looking for options to keep system time moderately accurate at a site
| without network access. So the normal application of ntpd over IP is
| not viable. Dialup modem not allowed either.
|
| Definition of "moderately accurate": doesn't have to be any better than
| I can set my watch, travel to the site, and set the system time. It just
| has to eliminate "travel to the site."
|
| A GPS is one possible solution using the appropriate ntpd driver. Am not
| sure I can place the GPS antenna in a suitable location.
|
| A WWV receiver would be another viable option but I am not having any
| great success in finding a prebuilt receiver with decoder suitable for
| direct connection to serial port and ntpd.

Hey David. I built a gps clock for ~200 bucks, it's really good.
It's based on the Motorola UT+ board which is 5" x 3" all SMT and
prebuilt, this is interfaced to a smaller daughtercard from TAPR
(Tuscon Amateur Packet Radio club) I am a ham myself and also
a freebsd guy since v2.1.2 ... the daughtercard converts the TTL
PPS (pulse per sec) signal from the gps to rs232 with a MAX232
chip, you'll need some soldering skills to build the daughtercard,
connect things together and mount it in the enclosure of your
choice. Here check it out at my website:

<http://www.wh7n.net/refclock/clock1.php>

The info is all on the site. Freebsd has support for kernel PLL
via an external PPS signal, just add option PPS_SYNC to your
kernel config also ntpd has builtin support for the Motorola
Oncore UT+ the second page of my refclock stuff explains it.

<http://www.wh7n.net/refclock/clock2.php>

The antenna is very small since the GPS frequency is in the
1 Ghz band (1575.42Mhz to be precise) it's the size of a mouse
and can be placed anywhere you can see some sky. The ntp distro
oncore driver inits the GPS in mode 0 (time only) if you run mode
3 that's 3D you need to see 4 birds at all times to get a 3D postion
in space (latitude, longitude, height above ground) if you don't
care about your position (the gps clock just sits there in the
same spot all the time) then run it in mode 0 so you only need
to sync to a single bird for the time.

I live in a condo and the antenna sits at the edge of my balcony
I put a small metal plate under it for a ground plane and my building
faces south. I use BNC type connectors and 25 feet of RG-174 coax
between the GPS and the antenna, if you make the cable run too long
you'll get too much signal loss especially with RG-174 which isn't
exactly low loss cable. Accuracy to the clock is in the 50 ns range,
+ or - ~30 ns.


--
Arthur W. Neilson III, WH7N - FISTS #7448
Bank of Hawaii Network Services
http://www.pilikia.net
a...@pilikia.net, anei...@boh.com, wh...@arrl.net

Bob Johnson

unread,
Apr 23, 2003, 5:37:53 PM4/23/03
to dke...@hiwaay.net, FreeBSD-...@freebsd.org
> Date: Wed, 23 Apr 2003 11:13:58 -0500
> From: David Kelly <dke...@hiwaay.net>

> Subject: Re: Accurate time without a network connection?
> To: Joel Rees <jo...@alpsgiken.gr.jp>
> Cc: FreeBSD-...@freebsd.org
> Message-ID: <20030423161...@grumpy.dyndns.org>
> Content-Type: text/plain; charset=us-ascii

>
> On Wed, Apr 23, 2003 at 05:58:47PM +0900, Joel Rees wrote:
>
>>>> > On Tue, Apr 22, 2003 at 03:26:19PM -0400, Charles Swiger wrote:
>>>> >
>>>> > As for exactly what time the systems have, it doesn't much matter as
>>>> > long as they all have the same time.
>>
>>>
>>> If you're serious about it not mattering exactly what time they have,
>>> what's the problem with letting one machine be the time server, letting
>>> it tune itself and then free run, and syncing all the rest to the
>>> slightly-off-time-server?
>
>
> Because the other systems do not have a link to the first.
>
> I could sync them all to a common source they could *hear* but the
> customer won't allow them to *talk* to anything.
>
> - David Kelly N4HHE, dke...@hiwaay.net
>

The NTP daemon can sync to a variety of external time signals. These
days it is very common to use GPS receivers as the reference for an NTP
server. If you can afford to spend about $100 per computer for low end
GPS receivers (that output NMEA-0183 data) AND it is possible to put
each GPS receiver where it can see the sky, that should work for you.
If all of the computers are in the same building, it may even be
possible to have them share a common GPS receiver with appropriate cabling.

There are other options, but I don't remember what they are. For
instance, it might be possible to sync the computers to the time
reference included with most network television signals.

See www.ntp.org for more clues.

- Bob

David Kelly

unread,
Apr 23, 2003, 8:58:54 PM4/23/03
to Arthur W. Neilson III, freebsd-...@freebsd.org
On Wednesday 23 April 2003 02:30 pm, Arthur W. Neilson III wrote:
>
> Hey David. I built a gps clock for ~200 bucks, it's really good.
> It's based on the Motorola UT+ board which is 5" x 3" all SMT and
> prebuilt, this is interfaced to a smaller daughtercard from TAPR
> (Tuscon Amateur Packet Radio club) I am a ham myself and also
> a freebsd guy since v2.1.2 ... the daughtercard converts the TTL
> PPS (pulse per sec) signal from the gps to rs232 with a MAX232
> chip, you'll need some soldering skills to build the daughtercard,
> connect things together and mount it in the enclosure of your
> choice. Here check it out at my website:
>
> <http://www.wh7n.net/refclock/clock1.php>

That is really cool!

I haven't found the ntpd documentation to as useful as it might. Lots of
documentation in html format in /usr/share/doc/ntp/ but somehow I
haven't found a table of contents. Eventually found
file:/usr/share/doc/ntp/howto.htm but your example goes a long way
toward my understanding.

Many years ago I had a heck of a time with the xntpd documentation until
I finally figured out only "server hostname" was needed in ntpd.conf.
Then not too many years ago in a conversation with a friend who has a
commit bit, learned he too had been stymied by ntpd and was running
ntpdate from cron every hour or so on his servers. Not any more.

As for the situation which prompted this thread, the worker bees on both
ends have finally done an end-run around management and are talking
direct. Apparently we will be allowed an ethernet tap to speak ntp
protocol.

As for other fun things I have my GPS sitting in a window trying to get
a lock. It actually holds a lock about half the time. So I'm starting
to play with the NMEA clock driver in ntpd.

I may never get around to creating a webcam driver for ntpd. But it
would be fun.

--
David Kelly N4HHE, dke...@hiwaay.net
=====================================================================
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.

Arthur W. Neilson III

unread,
Apr 23, 2003, 9:54:45 PM4/23/03
to David Kelly, freebsd-...@freebsd.org

--On Wednesday, April 23, 2003 7:58 PM -0500 David Kelly said:
| On Wednesday 23 April 2003 02:30 pm, Arthur W. Neilson III wrote:
|>
|> <http://www.wh7n.net/refclock/clock1.php>
|
| That is really cool!

Thanks! I had fun building it. The GPS card cost me $110 from
synergy.com I got a discount cause I'm a ham and the TAPR board
was $45 bucks. Pretty cheap for such an accurate clock.

Be aware not all GPSes have the PPS output. If you really want
super accurate clock you need the PPS output. The Motorola has
it but the ordinary Garmin handheld does not.


| As for other fun things I have my GPS sitting in a window trying to get
| a lock. It actually holds a lock about half the time. So I'm starting
| to play with the NMEA clock driver in ntpd.

I bet your GPS is in 3D position mode. If you can command the GPS
to run in 0 position mode you'll get that lock 24x7. The UT+ uses
a proprietary binary (non-NMEA) protocol that most software supports.
The Motorola's are used by the military embeded in all sorts of gear
and is a high performance and sensitive piece of equipment.

I do have a Garmin handheld which I use for hiking and such.
I use a GPS mapping software from fugawi.com along with raster
images of the USGS topo quads for Hawaii. Works real well for
setting waypoins on a map and planning hiking trips etc.

a.ever...@gmail.com

unread,
Jun 24, 2014, 4:11:38 AM6/24/14
to
Use a GPS referenced time server to synchronize a single PC. A number of manufacturers provide GPS timing devices that utilize GPS signals to provide very accurate time. They seem to cater for most operating systems including Windows and Linux. Some appear even to operate with an indoor antenna! See:
http://www.timetoolsglobal.com/information/gps-time-synchronization/
Eve
0 new messages