Author Topic: NTP via usbnet0, RTC question  (Read 3184 times)

glimmer (OP)

  • *
  • Posts: 119
NTP via usbnet0, RTC question
« on: January 03, 2014, 10:26:45 pm »
How hard would it be to configure ntpd on the Zero to query 10.1.1.1? I run ntpd on all my machines, and it occurred to me that I could set the Zero's time via ntpdate over the 10.1.1.1 "host". Sure enough, it works fine. However, ntpd is running on the Zero by default (for no obvious good reason), so I had to kill that off, first.

I can see why it might not be a good idea to blindly trust whatever the Zero's connected to via USB, but I'd like the option. (Especially because wireless is still completely broken.) And it would be really nice to see a trivial way to configure ntpd; there isn't even a skeleton /usr/local/etc/ntpd.conf, so I'm not sure how to go about doing it.

Relatedly, the Zero's RTC has such incredibly bad drift that I can safely say that I've never seen drift this bad on any device, from an alarm clock to an old 80386 PC. Is there anything that can be done to address this in software / firmware?
Code: [Select]
opendingux:/boot/local/home # ntpdate 10.1.1.1
 3 Jan 23:15:14 ntpdate[424]: step time server 10.1.1.1 offset 20854.892709 sec
If not, are there any options for modifying the hardware? I would be willing to add a ChronoDot if I had some assurance that it wouldn't take much effort.

glimmer (OP)

  • *
  • Posts: 119
Re: NTP via usbnet0, RTC question
« Reply #1 on: January 10, 2014, 05:16:22 pm »
Is there anyone on the forum who's actually on the GCW team?

MightyJAK

  • **
  • Posts: 538
    • My tumblr
Re: NTP via usbnet0, RTC question
« Reply #2 on: January 10, 2014, 06:10:41 pm »
Is there anyone on the forum who's actually on the GCW team?

Look here: http://www.kickstarter.com/projects/gcw/gcw-zero-open-source-gaming-handheld
Scroll down to "Meet the Team". You'll see each team member's name with their dingoonity user name after in parenthesis (except ayla is now pcercuei, and I don't know if Steven J. Hill is here).

It also says "This is just a selection of the people who currently develop for the Zero; we don't have space to list all contributors here. Also regularly new developers join, so this is by no means the final list." So I guess if you develop for the Zero, you're considered part of the team.  8)


Relatedly, the Zero's RTC has such incredibly bad drift that I can safely say that I've never seen drift this bad on any device, from an alarm clock to an old 80386 PC.

Hmm... I think my Letcool's RTC drifts a little bit worse.
My machines:
GBC,GBA,GBA SP,NDS,NGPC,Panasonic FZ-10 3DO,NES,Sega Nomad,Sega CDX w/Power Base Converter,PS1,PS2,PS3,Saturn,Dreamcast,PC (Win 98, XP, 7),Dingoo A320,Dingoo A330,Gemei A330,LetCool N350JP,PAP-GAMETA,GCW-Zero SE,Kyocera Rise,2DS,GP2X-F100,GPD G7,JXD 100,JXD A1000,JXD A3300,JXD F3000,JXD V5000,JXD S7300B,Hyperkin SupaBoy

Currently playing: Theatrhythm Final Fantasy Curtain Call (2DS)

Nebuleon

  • Guest
Re: NTP via usbnet0, RTC question
« Reply #3 on: January 11, 2014, 01:52:38 am »
Is it possible that you set the clock initially using the PyClock application in your local timezone?

ntpdate runs in UTC always, and the timezone used by the Zero is Central European Time, so when you set your time, it was recorded as being the time in a timezone 5 or 6 hours to the east.

For reference, I just checked the time on my Zero, which I set in August, and it was "20:43" when my local time was "19:53", but my Zero is really 10 minutes 36 seconds late, not 49 minutes 24 seconds early, because I set it when Daylight Saving Time was in effect, and now it's not. And when I ran ntpdate, I got an outrageous offset like you.

My timezone is GMT-5, or -4 in the Northern Hemisphere summer.

glimmer (OP)

  • *
  • Posts: 119
Re: NTP via usbnet0, RTC question
« Reply #4 on: January 11, 2014, 04:03:46 am »
Is it possible that you set the clock initially using the PyClock application in your local timezone?
It really shouldn't matter. UNIX system clocks have used UTC as a matter of course for a very long time. Out of the three major desktop platforms, Windows is the only one that still clings to setting the system clock to local time instead of UTC. (It's theoretically possible to change Windows' behavior with a Registry setting, but I find that, in practice, at least through Windows 7, trying to use UTC time on Windows is buggy at the best of times.) If the Zero (or PyClock) are not dealing exclusively in UTC time and only converting to local time for display purposes, that's a whole separate bug or pair of bugs that need to be corrected.

In any case, I've corrected the Zero's time with ntpdate(8) several times now, and I haven't used PyClock since initial setup. The RTC is drifting very badly.

pcercuei

  • ***
  • Posts: 1428
    • My devblog
Re: NTP via usbnet0, RTC question
« Reply #5 on: January 11, 2014, 01:50:07 pm »
I added a proper default config for the NTP daemon (and user-modifiable), and set the NTP daemon to start/stop when the WiFi is activated/disactivated. I consider you're the only guy who want to get NTP date from usb0 so I didn't enable that (though you could run another ntpd monitoring usb0 via a local init.d startup script).

And btw you're right, the RTC drifts pretty badly ;D A couple of seconds per minute.

glimmer (OP)

  • *
  • Posts: 119
Re: NTP via usbnet0, RTC question
« Reply #6 on: January 11, 2014, 06:10:46 pm »
And btw you're right, the RTC drifts pretty badly ;D A couple of seconds per minute.
Is there a possibility of a f/w fix, or is it just a very cheap oscillator? Are there any time sources apart from the RTC, like HPET on PC platforms?

Ziz

  • *
  • Posts: 284
    • http://ziz.gp2x.de
Re: NTP via usbnet0, RTC question
« Reply #7 on: January 11, 2014, 11:42:59 pm »
I added a proper default config for the NTP daemon (and user-modifiable), and set the NTP daemon to start/stop when the WiFi is activated/disactivated.
That's great! As I update my application via WiFi quite often I get a correct time on the fly. :D
I am a leaf on the wind - watch how I soar. Wash

pcercuei

  • ***
  • Posts: 1428
    • My devblog
Re: NTP via usbnet0, RTC question
« Reply #8 on: January 12, 2014, 01:56:12 am »
And btw you're right, the RTC drifts pretty badly ;D A couple of seconds per minute.
Is there a possibility of a f/w fix, or is it just a very cheap oscillator? Are there any time sources apart from the RTC, like HPET on PC platforms?
For some reason it stopped to drift now. Weird... And yes, there is a way to adjust the RTC, though the driver is too crappy currently to handle that.

 

Post a new topic
Post a new topic