Windowsista aikapalvelin valvontakameroille

Liittynyt
23.10.2016
Viestejä
295
Reolinkin kamerat ovat suljetussa verkossa, jossa on myös Windows 10 -läppäri. Kameroiden kellot käyvät omaa tahtiaan ja ne pitäisi saada kaikki samaan aikaan. En saa conffattua Windowsin NTP:tä siten, että kamerat hyväksyisivät tarjotun kellon ajan.

Olen tehnyt seuraavat kohda 1 - 3.

1)
Windowsin palveluista päälle Windows Time (W32Time).

2)
Registerista sijainnista Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer
Avaimen Enabled arvoksi 1.

reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer /v Enabled /t REG_DWORD /d 1 /f


3)
w32tm /config /reliable:yes /syncfromflags:manual /LocalClockDispersion:0
w32tm /config /update



syncfromflags:<source>—Sets what sources the NTP client should synchronize from. <source> should be a comma-separated list of these keywords (not case sensitive):

MANUAL— Include peers from the manual peer list.

DOMHIER— Synchronize from a domain controller in the domain hierarchy.

NO—Do not synchronize from any server.

ALL—Synchronize from both manual and domain peers.

LocalClockDispersion:<seconds>—Configures the accuracy of the internal clock that W32time will assume when it cannot acquire time from its configured sources.

reliable:(YES|NO)—Set whether this computer is a reliable time source.


----------------------------------------------------------------------------

C:\Windows\system32>w32tm /query /configuration
[Configuration]

EventLogFlags: 2 (Local)
AnnounceFlags: 5 (Local)
TimeJumpAuditOffset: 28800 (Local)
MinPollInterval: 10 (Local)
MaxPollInterval: 15 (Local)
MaxNegPhaseCorrection: 54000 (Local)
MaxPosPhaseCorrection: 54000 (Local)
MaxAllowedPhaseOffset: 1 (Local)

FrequencyCorrectRate: 4 (Local)
PollAdjustFactor: 5 (Local)
LargePhaseOffset: 50000000 (Local)
SpikeWatchPeriod: 900 (Local)
LocalClockDispersion: 0 (Local)
HoldPeriod: 5 (Local)
PhaseCorrectRate: 1 (Local)
UpdateInterval: 360000 (Local)


[TimeProviders]

NtpClient (Local)
DllName: C:\Windows\system32\w32time.dll (Local)
Enabled: 1 (Local)
InputProvider: 1 (Local)
AllowNonstandardModeCombinations: 1 (Local)
ResolvePeerBackoffMinutes: 15 (Local)
ResolvePeerBackoffMaxTimes: 7 (Local)
CompatibilityFlags: 2147483648 (Local)
EventLogFlags: 1 (Local)
LargeSampleSkew: 3 (Local)
SpecialPollInterval: 32768 (Local)
Type: NTP (Local)
NtpServer: time.windows.com,0x9 (Local)

VMICTimeProvider (Local)
DllName: C:\Windows\System32\vmictimeprovider.dll (Local)
Enabled: 1 (Local)
InputProvider: 1 (Local)

NtpServer (Local)
DllName: C:\Windows\system32\w32time.dll (Local)
Enabled: 1 (Local)
InputProvider: 0 (Local)
AllowNonstandardModeCombinations: 1 (Local)


Linuxi näyttää NTP-palvelimelle seuraavaa eikä kamerat synkkaa aikaa.

Koodi:
ntpdate -q -d 192.168.10.111
18 Sep 17:23:41 ntpdate[159577]: ntpdate 4.2.8p12@1.3728-o (1)
Looking for host 192.168.10.111 and service ntp
host found : 192.168.10.111
transmit(192.168.10.111)
receive(192.168.10.111)
192.168.10.111: Server dropped: strata too high

server 192.168.10.111, port 123
stratum 16, precision -23, leap 11, trust 000
refid [], root delay 0.000000, root dispersion 1.000000
transmitted 1, in filter 1
reference time:    e6d19ad5.1685ac7c  Sun, Sep 18 2022 16:25:41.087
originate timestamp: e6d1a86d.5685c754  Sun, Sep 18 2022 17:23:41.337
transmit timestamp:  e6d1a86d.35dc980f  Sun, Sep 18 2022 17:23:41.210
delay 0.02747, dispersion 0.00000
offset 0.126648

18 Sep 17:23:41 ntpdate[159577]: no server suitable for synchronization found

Galleonin testityökalu näyttää seuraavaa.

NTP-01.png
 
Viimeksi muokattu:
Liittynyt
23.10.2016
Viestejä
295
Jos läppärin kytkee hetkeksi nettiin ja ajaa komennon w32tm /resync. Esim. Root Dispersion on todella suuri. Kamerat eivät edelleenkään synkkaa aikaa. Eivät anna muuta virhettä kuin Failed.

Koodi:
ntpdate -q -d 192.168.10.111
18 Sep 17:33:53 ntpdate[159656]: ntpdate 4.2.8p12@1.3728-o (1)
Looking for host 192.168.10.111 and service ntp
host found : 192.168.10.111
transmit(192.168.10.111)
receive(192.168.10.111)

server 192.168.10.111, port 123
stratum 4, precision -23, leap 00, trust 000
refid [20.101.57.9], root delay 0.043503, root dispersion 7.908615
transmitted 1, in filter 1
reference time:    e6d1aa01.22565eb1  Sun, Sep 18 2022 17:30:25.134
originate timestamp: e6d1aad1.ea87a728  Sun, Sep 18 2022 17:33:53.916
transmit timestamp:  e6d1aad1.c7c3388b  Sun, Sep 18 2022 17:33:53.780
delay 0.02745, dispersion 0.00000
offset 0.134882

18 Sep 17:33:53 ntpdate[159656]: adjust time server 192.168.10.111 offset 0.134882 sec
NTP-02.png
 
Liittynyt
12.06.2017
Viestejä
313
Oliko tuo linux eri koneessa kuin läppäri? Jos ei, niin oletko luonut windowsiin palomuurisäännöt, joilla sallit aikapalvelimen UDP 123-portit sisään/ulos?
 
Liittynyt
23.10.2016
Viestejä
295
Oliko tuo linux eri koneessa kuin läppäri? Jos ei, niin oletko luonut windowsiin palomuurisäännöt, joilla sallit aikapalvelimen UDP 123-portit sisään/ulos?
Joo Linux on eri koneessa kuin läppäri ja portti 123 toimii. Korkea Root Dispersion näyttäisi olevan ongelma.

Jos määritän w32tm /config /syncfromflags:no /LocalClockDispersion:0 , jolloin ulkoisia NTP-palvelimia ei käytetän ja aina käytetään koneen omaa kelloa ja oman kerron dispersion on määritelty nollaksi, kamerat synkkaavat ajan onnistuneesti.

Jos haluaa silloin tällöin synkata läppärin ajan oikeaan käyttämällä konetta nopsaan netissä, palauttaa Windowsin automaattinen ajan asettaminen määrityksen /syncfromflags:no takaisin arvoon /syncfromflags:manual, eikä kamerat enää hyväksy aikaa, koska dispersion on liian suuri. Ymmärsin niin, että manual-asetuksella NTP käyttäisi automaattisesti koneen paikallista kelloa, jos ulkoisesta NTP-palvelimesta ei saada aikaa. Manual-asetus olisi siis optimaalinen, jos vain saisi dispersionin matalaksi
 
Liittynyt
23.10.2016
Viestejä
295
Windowsin säätämistä helpompi ratkaisu on ladata Meinbergin sivulta NTP-palvelin Windowsille. Tärkeää on asennuksessa laittaa rasti kohtaan Add local clock as a last resort referense. Tällöin ilman nettiä NTP-palvelin käyttää paikallista kelloa.


Edit:
Asetus tinker panic 0 on tärkeä. Muuten NTP sammuttaa itsensä, jos kello on liian paljon väärässä ajassa.

Koodi:
# your local system clock, should be used as a backup
# (this is only useful if you need to distribute time no matter how good or bad it is)
server 127.127.1.0
# but it operates at a high stratum level to let the clients know and force them to
# use any other timesource they may have.
fudge 127.127.1.0 stratum 12 

# Use a NTP server from the ntp pool project (see http://www.pool.ntp.org)
# Please note that you need at least four different servers to be at least protected against
# one falseticker. If you only rely on internet time, it is highly recommended to add
# additional servers here. 
# The 'iburst' keyword speeds up initial synchronization, please check the documentation for more details!

server fi.pool.ntp.org iburst minpoll 6 maxpoll 7
server time1.dnaip.fi iburst
server time2.dnaip.fi
server time3.dnaip.fi
server time4.dnaip.fi
server time5.dnaip.fi
server time.mikes.fi iburst

# "The tinker panic value of 0 tells NTP that no matter what the time offset is, not to panic and exit.
# This is recommended for virtual machines because virtual machines have no physical clock and can
# be paused at anytime and started back up hours later. "
# https://www.redhat.com/en/blog/avoiding-clock-drift-vms
tinker panic 0
 
Viimeksi muokattu:
Liittynyt
23.10.2016
Viestejä
295
DNA:n timeX.dnaip.fi-aikapalvelimet ovat melko hyviä, kun itselläni on DNA:n liittymä. Ubuntussa NTP:n config on paikassa /etc/ntp.conf .

Koodi:
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
LOCAL(0)        .LOCL.          12 l  75h   64    0    0.000    0.000   0.000
-ntp2.dnainterne 193.66.253.90    2 u  530 1024  377   19.075    9.212   3.130
+time1.dnaip.fi  .GPS.            1 u  783 1024  377   19.438    0.007   1.138
*time2.dnaip.fi  .MRS.            1 u  348 1024  377   18.583    0.126   0.591
+time3.dnaip.fi  .MRS.            1 u  856 1024  377   19.533    0.186   0.687
+time4.dnaip.fi  .GPS.            1 u  850 1024  377   11.433   -0.001   0.855
+time5.dnaip.fi  .GPS.            1 u 1005 1024  377   16.964    0.245   0.606
+time.mikes.fi   194.100.49.133   2 u 1065 1024  377   18.885    0.028   2.743
Delay, offset ja jitter ovat millisekunteina.
 
Viimeksi muokattu:
Liittynyt
23.10.2016
Viestejä
295
Sain Reolinkiltä uuden firmiksen, joka sallii ajan synkronoimisen, vaikka root dispersion on esim. 10 sekuntia.
 
Liittynyt
23.10.2016
Viestejä
295
Tilasin Aliexpressistä OOTDTY VK-172 GPS-vastaanottimen (https://www.aliexpress.com/item/32821185421.htm), jossa on U-Blox 7 -piiri. Linux löytää tuon myös PPS-laitteena, mutta toimii vain tavallisena USB-GPS-laitteena. Ajan virhe heittelee välillä 64 - 84 ms. Nyt keskiarvo ollut noin 70 ms. Kovin tarkkaa aikaa tällä ei saa. Piirin sisäinen ajan tarkkuus on 30 ns (RMS). USB:llä tarkkuus on yleensä PPS:llä luokkaa 1 ms, koska USB:n polling rate on useimmiten 1 kHz. En tiedä onko USB-GPS-tikkuja, jotka tukisivat 8 kHz:n ratea. Käytettäessä RS232-porttia pitäisi PPS:llä päästä tarkkuuteen 1 us.


Koodi:
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
LOCAL(0)        .LOCL.          12 l 153m   64    0    0.000    0.000   0.000
SHM(0)          .GPS.           16 l   11   16  377    0.000  -74.828   5.042
SHM(1)          .PPS.           12 l    -   16    0    0.000    0.000   0.000
+ntp46.kashra-se 192.168.100.15   2 u   20 1024  377   49.000   -1.337   1.345
+time1.dnaip.fi  .GPS.            1 u  177 1024  377   18.712   -1.228   1.117
+time2.dnaip.fi  .MRS.            1 u  200 1024  377   19.459   -1.337   1.748
+time3.dnaip.fi  .MRS.            1 u  561 1024  377   19.123   -1.229   1.749
*time4.dnaip.fi  .GPS.            1 u  505 1024  377   10.613   -1.514   1.819
+time5.dnaip.fi  .GPS.            1 u   89 1024  377   17.993   -0.846   0.983
+time.mikes.fi   194.100.49.133   2 u  467 1024  377   19.527   -0.948   1.831
Edit:
Tässä tilastoja USB-GPS-tikun aikavirheestä. Vertailukohtaja on tietokoneen oma kello, jonka pitäisi olla melko hyvin synkronisoitunut DNA:n aikapalvelimista.
Koodi:
  cat /var/log/ntpstats/peerstats* | grep 127.127.28.0  | cut -d ' ' -f 5 | gnuplot -e 'stats "-" nooutput; print "samples: ", STATS_records, ", mean: ", STATS_mean, ", sample standard deviation: ", STATS_ssd, ", min: ", STATS_min, ", max: ", STATS_max '
samples: 14847, mean: -0.0773873125904895, sample standard deviation: 0.00528227327545494, min: -0.09747115, max: -0.058732898
 
Viimeksi muokattu:
Toggle Sidebar

Statistiikka

Viestiketjut
240 296
Viestejä
4 197 145
Jäsenet
70 887
Uusin jäsen
Veev1

Hinta.fi

Ylös Bottom