From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 9 20:49:14 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EB3016A41F for ; Tue, 9 Aug 2005 20:49:14 +0000 (GMT) (envelope-from frank@exit.com) Received: from tinker.exit.com (tinker.exit.com [206.223.0.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF90F43D58 for ; Tue, 9 Aug 2005 20:49:13 +0000 (GMT) (envelope-from frank@exit.com) Received: from realtime.exit.com (realtime [206.223.0.5]) by tinker.exit.com (8.13.3/8.13.3) with ESMTP id j79Kn8sX030846; Tue, 9 Aug 2005 13:49:08 -0700 (PDT) (envelope-from frank@exit.com) Received: from realtime.exit.com (localhost [127.0.0.1]) by realtime.exit.com (8.13.3/8.13.3) with ESMTP id j79Kn7wr011116; Tue, 9 Aug 2005 13:49:07 -0700 (PDT) (envelope-from frank@exit.com) Received: (from frank@localhost) by realtime.exit.com (8.13.3/8.12.9/Submit) id j79Kn7tF011115; Tue, 9 Aug 2005 13:49:07 -0700 (PDT) (envelope-from frank@exit.com) X-Authentication-Warning: realtime.exit.com: frank set sender to frank@exit.com using -f From: Frank Mayhar To: David Gilbert In-Reply-To: <17145.469.365833.447736@canoe.dclg.ca> References: <17144.64281.705769.294109@canoe.dclg.ca> <1123613910.9836.15.camel@realtime.exit.com> <17145.469.365833.447736@canoe.dclg.ca> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Exit Consulting Date: Tue, 09 Aug 2005 13:49:06 -0700 Message-Id: <1123620546.9836.31.camel@realtime.exit.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 FreeBSD GNOME Team Port X-Virus-Scanned: ClamAV 0.86.1/1011/Tue Aug 9 02:20:28 2005 on tinker.exit.com X-Virus-Status: Clean Cc: freebsd-hackers@freebsd.org Subject: Re: Bluetooth GPS for timekeeping? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: frank@exit.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2005 20:49:14 -0000 On Tue, 2005-08-09 at 15:19 -0400, David Gilbert wrote: > >>>>> "Frank" == Frank Mayhar writes: > > Frank> On Tue, 2005-08-09 at 14:51 -0400, David Gilbert wrote: > >> But ... since there are long patches of time where I'm not mobile, > >> I was wondering if anyone had looked at using a Bluetooth GPS for > >> timekeeping. Has anyone also ever had an ntp server sometimes use > >> a GPS and othertimes use other servers ... depending on the > >> availability of the GPS? > > Frank> The former would depend strongly on the characteristics of the > Frank> Bluetooth protocols, at least when it comes to accuracy. > Frank> Keeping time to the half-second or so would be pretty easy, I > Frank> would guess. > > Frank> The latter is the way it already works. Just configure other > Frank> peers in your ntp.conf along with your GPS, viz: > > How might you determine the accuracy of the GPS ... or the > "characteristics of the Bluetooth protocols" ? First learn about the way Bluetooth works. Pay attention to the various delays that are built into the protocol and that might be forced by transmission and reception conditions. > The GPS docs "say" that the GPS chipset keep time to within 100ns. > However (and I assume this is to save power) they also say that the > position indication is only sent once per second. The way this accuracy is typically transmitting outside the GPS unit itself is via a (usually logic-level) pulse-per-second signal. As it happens, a lot of the older GPS units that do this have a 5V PPS, which is enough to get it over the 3V RS232 threshold so it can be seen as CD. (For those with a PPS of 3.3V or lower, you have to use another method; PHK has a good mechanism on his website, using a Soekris box.) While the RS232 hardware is pretty sloppy, it is good enough to get within a few microseconds of the real time; right now tock thinks he's within about nine us of UTC and tick agrees to within +/- 2us. Tick uses a Motorola Oncore (instead of the GPSClock) but also gets the PPS via the RS232 CD signal and he thinks he's within about a microsecond of UTC. Since it's wired, the PPS signal is just degraded by propagation and by the accuracy of the receiving system. I'm no RF expert but I'll bet that getting high accuracy via Bluetooth would be problematic. On the other hand, accuracy to within milliseconds should be doable and to within hundreds of ms easy, since that's what the position indication string gives you. > In my case, the Bluetooth GPS would be talking to a Bluetooth dongle > hanging directly out a port of the server in question. Well, you wouldn't want to run a stratum 0 NTP server on this, but it's probably plenty good enough for a human being. -- Frank Mayhar frank@exit.com http://www.exit.com/ Exit Consulting http://www.gpsclock.com/ http://www.exit.com/blog/frank/