We have moved at community.getvera.com

Author Topic: LAN NTP  (Read 17096 times)

Offline achalhoub

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
LAN NTP
« on: February 04, 2011, 04:35:46 am »
Does anyone know from where can I download a LOCAL LAN NTP and how to link vera 2 to it? I want to use Vera2 in a non internet environment :)  I tried reading the related posts but i didnt had any considerable answer

http://forum.micasaverde.com/index.php?topic=5393.0


[/url]http://forum.micasaverde.com/index.php?topic=4895.msg27078#msg27078[/url]

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: LAN NTP
« Reply #1 on: February 04, 2011, 08:25:17 am »
For Windows:
http://www.timetools.co.uk/ntp-servers/ntp-server.htm

cj,

could you elaborate on where to tweak a Vera V2 to point her to a local NTP server? Thanks!

Offline Grain

  • Sr. Newbie
  • *
  • Posts: 41
  • Karma: +0/-0
Re: LAN NTP
« Reply #2 on: February 04, 2011, 02:18:49 pm »
I've been reading up on ntp (Vera V1) and rdate (Vera V2) and it seems that rdate can't communicate with ntp and vice versa
for ntp the command should be "ntpdate 192.168.1.1" where the ip address is your ntp server, I tested this with my DD-WRT router as ntp server and my Ubuntu machine and it updates

don't know how Vera V1 does it but this did the trick on my PC

since I'm looking for a Vera V2 I'll have to look into this a little further

Offline Grain

  • Sr. Newbie
  • *
  • Posts: 41
  • Karma: +0/-0
Re: LAN NTP
« Reply #3 on: February 04, 2011, 02:42:58 pm »
allright, it seems when I create/edit a file from xinetd named time and change "disable = yes" to "disable = no" so the file looks like

Code: [Select]
# Begin /etc/xinetd.d/time

service time
{
   disable        = no
   type           = INTERNAL
   id             = time-stream
   socket_type    = stream
   protocol       = tcp
   user           = root
   wait           = no
}

hen I restarted xinetd on my router and did
Code: [Select]
rdate 192.168.1.1on my Ubuntu machine and I got a correct response..

Offline Grain

  • Sr. Newbie
  • *
  • Posts: 41
  • Karma: +0/-0
Re: LAN NTP
« Reply #4 on: February 04, 2011, 02:50:53 pm »
hmmm.. after killing all ntpd processes on my router and asking rdate from my Ubuntu machine it still works...

gonna stop for now, it's time for some brain-rest :)

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: LAN NTP
« Reply #5 on: February 04, 2011, 03:49:45 pm »
Grain,

You're right, NTP (http://tools.ietf.org/html/rfc5905) and the Time Protocol (http://tools.ietf.org/html/rfc868) used by rdate aren't related.

Offline dswelch

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: LAN NTP
« Reply #6 on: February 05, 2011, 08:01:19 pm »
usually you use the ntpdate executable to update or correct the time/date. ntpdate 192.168.0.12

does vera have the ntpdate executable or maybe its named something else. you can usually setup a list of time servers to use, which would be helpful if your network is down. You could point to a linux or windows machine on the local network that is runnning the server software.

I don't have a vera yet, but have extensive linux experience setting up time servers and using ntpdate on clients.

this would easily solve all the problems i keep seeing here about lost time on the vera.

good luck

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: LAN NTP
« Reply #7 on: February 05, 2011, 08:41:38 pm »
It's an OpwnWrt thing.  Vera's 1.1.1xxx is layered on top of OpenWrt 10.3 (codename "Backfire").  For reasons best known to the OpenWrt people, they chose to not install an NTP client by default but to use the smaller-footprint rdate client, which as has already been mentioned is not at all related to NTP.  IMHO this is a backwards step, so I install ntpd on my OpenWrt machines, Vera included.

Installing ntpd is as easy as running as root on the Vera:
Code: [Select]
# opkg update
# opkg install ntpd
# /etc/init.d/ntpd enable
# /etc/init.d/ntpd start

It takes up 232 kB, 3% of the Vera2's JFFS (/overlay) space.  By default ntpd queries hosts in the .openwrt.pool.ntp.org domain, but you can edit /etc/ntp.conf to point at a local machine if you prefer.

(ntpclient is also a package available through opkg.  It uses the same NTP protocol as ntpd, but it's more of a run-once-to-set program, whereas ntpd is a run-in-the-background daemon.  ntpclient can be coerced into behaving like a daemon, but I'm more familiar with ntpd so that's what I'm describing.)

Offline Grain

  • Sr. Newbie
  • *
  • Posts: 41
  • Karma: +0/-0
Re: LAN NTP
« Reply #8 on: February 06, 2011, 02:08:19 am »
thanks for the extensive info futzie!

didn't think of adding ntpd afterwards
I did indeed read in several places that ntpd is superior to rdate

hope to get my Vera 2 somewhere this week so I can test :)

Quote
It takes up 232 kB, 3% of the Vera2's JFFS (/overlay) space.
wow! does that mean there is around 7MB available for jffs?
that would be great!

Offline achalhoub

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Re: LAN NTP
« Reply #9 on: February 07, 2011, 02:14:18 am »
Guys ,

I want to thank all of you for your helpful replies.  If i wanted to summarize all the info , I would have to do the following:

1. Download NTP App http://www.timetools.co.uk/ntp-servers/ntp-server.htm , supposing my machine IP is 192.168.1.1

2. Call ntpdate 192.168.1.1


* I have Vera 2

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: LAN NTP
« Reply #10 on: February 07, 2011, 07:21:16 pm »
2. Call ntpdate 192.168.1.1

The trouble with ntpdate is that it just runs once.  Though that will set your clock, it doesn't account for drift if your Vera's internal clock is inaccurate.  Even if you arranged for ntpdate to run every so often (say, via cron), you'd get discontinuity in the clock when you run ntpdate, jumping forward and possibly missing a second when you intended to run a scene, or jumping backwards and repeating a second causing a scene to run twice.  ntpdate is actually deprecated for this reason, so I don't recommend installing it.

I can see at least three NTP clients for OpenWrt which run all the time as a daemon.  They all handle clock slewing, adjusting the clock's rate imperceptibly, to avoid discontinuities, and they keep your clock in sync with time servers.


OpenWrt seems to have the most support for the first of these (ntpclient), and even has a package for managing it through the web interface (luci-app-ntpc).  You could probably install that through Vera's "Advanced" configuration page on the Net & WiFi tab, and configure it without having to ssh to your machine at all.

Offline JOD

  • Hero Member
  • *****
  • Posts: 1973
  • Karma: +4/-0
Re: LAN NTP
« Reply #11 on: April 12, 2011, 04:48:30 pm »
The Internet has been down all day where my Vera resides and I'm at work wondering what time Vera is displaying and if scenes are firing...

I then realized that my camera server that sits next to Vera on the same network can be configured as an NTP server.

Does Vera have a list of NTP IP's she checks and is there a way I can add my servers IP to that list?

JOD.
I'm sorry, my responses are limited. You must ask the right questions.

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: LAN NTP
« Reply #12 on: April 12, 2011, 05:09:02 pm »
Vera V1:
/etc/config/ntpclient

Vera V2 doesn't use NTP.

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3722
  • Karma: +34/-2
  • Vera 1,3 & V light
Re: LAN NTP
« Reply #13 on: April 12, 2011, 07:28:53 pm »
The Internet has been down all day where my Vera resides and I'm at work wondering what time Vera is displaying and if scenes are firing...

I then realized that my camera server that sits next to Vera on the same network can be configured as an NTP server.

Does Vera have a list of NTP IP's she checks and is there a way I can add my servers IP to that list?

JOD.
Are you sure the camera is a server and not a client? Most cams just have the configuration as a client to be able to automatically set date and time if power gets lost?!
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline JOD

  • Hero Member
  • *****
  • Posts: 1973
  • Karma: +4/-0
Re: LAN NTP
« Reply #14 on: April 12, 2011, 08:20:43 pm »
It's a Nuvico 16 channel server for camera's. It has two options. Although I'm using a Vera 2 so the 2nd option does me no good.
Client: set to be a client to a time server.
Server: set to be a time server for other clients.

What other options are there for time syncing a Vera 2?

JOD.
I'm sorry, my responses are limited. You must ask the right questions.