[time-nuts] Lowest Power NTP Server

Bob kb8tq kb8tq at n1k.org
Tue Dec 3 18:10:08 UTC 2019


Hi

> On Dec 3, 2019, at 7:55 AM, Hal Murray <hmurray at megapathdsl.net> wrote:
> 
> 
> If a Raspberry Pi fits your energy budget, that's probably the simplest way to 
> go.  There are lots of them running with GPS hats.
> 
>> More or less, 0.5W on a 5AH 12V battery runs for 120 hours. Something at 5W
>> only runs for 12 hours ….. 
> 
> My Kill-A-Watt alternates between 02 and 03 watts for a Pi 2B with USB WiFi 
> and GPS.  I don't know how inefficient the wall wart is.

A full up desktop on an RPi 4 runs at about 0.57A at 5V with all the usual stuff 
attached. Various sources suggest that the Pi Zero W is down around 0.1A at
5V with the WiFi turned on and headless Linux doing its thing. The question 
is / was - can you go lower than the 1/2W by using something other than the 
Pi Zero W. 

> 
> I have one of the little USB volt/amp meters, but I'll have to dig to find it.
> 
> 
>> My target is “a couple of mili seconds” so a microsecond or five is sort of a
>> non-issue.
> 
> What sort of client software are you considering?  Real ntp client or some 
> hack?

Each of the devices on the network will be running whatever it’s OS happens 
to have available. There will be a mix of OSX, Windows, IOS, Linux and (probably)
Android devices. NTP *seems* to be the most likely common denominator. 

> 
> Do you need accurate real time or can you post process things?

Real time

> 
> How good is your WiFi connection?  (more in another msg - long tail with a 
> bump)  Real ntpd has a filter of 8 packets that ignores most of the outliers.  
> Dumb ntp just smashes the clock to its calculated value which follows the tail 
> wherever it leads.

WiFi should be ok. Delay through the low power router is on the “things to test”
list. The total budget is server + WiFi + client. I’d like to keep each part below 10 ms
90% of the time. Ideally I’d like the sum to hit that target. 

> 
> 
>> My main concern is that the clients are likely to be a bit “time challenged”
>> and some of them could need fairly high update rates.  
> 
> What do you mean by "time challenged"?  Hardware or software?

The “stuff” may be out in the rain and snow. It may go from indoors to outdoors. 
It likely has weird power management modes it goes into. The devices (hopefully)
have a real time clock. I have no control over which RTC in some of the devices.

> 
> Normally ntpd adjusts the clock rate to match the actual crystal.  It's called 
> drift.  Deep inside the OS there is a magic constant that converts ticks from 
> clock to ns.  You need a side door to adjust that constant.  Real NTP client 
> software does a good job of using that knob.  It tracks temperature.

Writing custom software for a half dozen OS’s and even more clients is not inside
the scope of work for this project. I simply want to run something reasonably 
standard that will “do time” across a number of platforms. 

> 
> ---------
> 
> I don't know of any NTP software that has been well tuned for working in ultra low power.  (But I haven't been looking and I don't track the literture.)  For low power, you probably want to turn off the CPU crystal and PLLs.  That turns into timekeeping using two clocks, the RTC while sleeping and the normal CPU crystal when running.  You need a way to recover the time from the RTC quickly and accurately and you also need to keep track of two clock drifts.

For a server (that gets inquiries at any time) the “wake up” process is going to be a
problem with a deep sleep approach. The GPS on the server also would need to wake 
up and get going. That combo is going to give you a mighty long turn around time on
a request. I also suspect that the requests will come in often enough (compared to a 
minute or two long GPS lockup) that it would never go into deep sleep anyway.

Indeed a lot of that is a guess ….

Bob

> 
> -- 
> These are my opinions.  I hate spam.
> 
> 
> 
> 
> _______________________________________________
> time-nuts mailing list -- time-nuts at lists.febo.com
> To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
> and follow the instructions there.





More information about the Time-nuts_lists.febo.com mailing list