microsoft / W32Time

This repo provides resources for high accuracy time on Windows
MIT License
71 stars 23 forks source link

it won't work #5

Open AndreV84 opened 4 years ago

AndreV84 commented 4 years ago

after importing PTP section into register ; after opening the firewall ports; after restarting the w32tm & after executing resync it would return:

 w32tm /resync
Sending resync command to local computer
The computer did not resync because no time data was available.

while the regedit shows explicitly my ptp server setup it wouldn't be returned by the verbose output of the command below:

w32tm /resync
Sending resync command to local computer
The computer did not resync because no time data was available.
PS C:\Windows\system32> w32tm /query /status /verbose
Leap Indicator: 3(not synchronized)
Stratum: 0 (unspecified)
Precision: -23 (119.209ns per tick)
Root Delay: 0.0000000s
Root Dispersion: 0.0000000s
ReferenceId: 0x00000000 (unspecified)
Last Successful Sync Time: unspecified
Source: Local CMOS Clock
Poll Interval: 6 (64s)

Phase Offset: 0.0000000s
ClockRate: 0.0156250s
State Machine: 0 (Unset)
Time Source Flags: 0 (None)
Server Role: 0 (None)
Last Sync Error: 1 (The computer did not resync because no time data was available.)
Time since Last Good Sync Time: 187.9314763s
 w32tm /query /configuration
[Configuration]

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

FrequencyCorrectRate: 2 (Local)
PollAdjustFactor: 5 (Local)
LargePhaseOffset: 50000000 (Local)
SpikeWatchPeriod: 900 (Local)
LocalClockDispersion: 10 (Local)
HoldPeriod: 5 (Local)
PhaseCorrectRate: 1 (Local)
UpdateInterval: 100 (Local)

[TimeProviders]

PtpClient (Local)
DllName: c:\windows\system32\ptpprov.dll (Local)
Enabled: 1 (Local)
InputProvider: 1 (Local)

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

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

VMICTimeProvider (Local)
DllName: C:\Windows\System32\vmictimeprovider.dll (Local)
Enabled: 0 (Local)
InputProvider: 1 (Local)
mwtrigg commented 3 years ago

I also have this problem.

Kemler-J commented 3 years ago

I have this problem also,
I suspect that w32time didn't get windows ptp provider, see the output here: ReferenceId: 0x00000000 (unspecified) //---------------> this should be 0x4D505450 Last Successful Sync Time: unspecified Source: Local CMOS Clock

But how to change it ?

mwtrigg commented 3 years ago

I found reference to a similar (maybe th e same) problem under a different issue here; it appears that Microsoft's implementation only works when the PTP domain is 0.

Are either of you using a PTP server that is using a different domain?

Kemler-J commented 3 years ago

actually, PTP service is ready enabled, in event viewer image we can see domain is 0 here. I didn't try different domain. Req/Resp messages were showed on Wireshark tool. image

but still shows error when run w32tm /resync I total get confused about it

Kemler-J commented 3 years ago

Hi, Guys finally, I got the ptp4l works with w32tm. but it still has some problems, the phaseoffset should not be correct, it is so huge, and after sync, the time was changed to 1995, i don't know why, because in Wireshark, we checked the correction, it is no problem, but why W32TM shows show a huge gap, Does everyone know it? attach some picture here image image

image Who knows the reason? Thanks

AndreV84 commented 3 years ago

could you share all parameters that you are using starting ptp4l at linux server, please? In my environment it would see the server messages, but wouldnt synchronize. at least it wouldnt indicate that sync happens in the terminal but would also throw error messages. It was all like half working. tried event viewer and wireshark. client/server also with various parameters etc.

Kemler-J commented 3 years ago

hi all As I mentioned, W32tm only supports unicast, so please use this command ./ptp4l -E -i (interface) -m -H -f ./configs/UNICAST-MASTER.cfg you should modify the config as below: [global] hybrid_e2e 1 inhibit_multicast_service 0 unicast_listen 1

Hope it can help you.

AndreV84 commented 3 years ago

@Kemler-J Thank you for sharing! Will try to get with this config https://github.com/richardcochran/linuxptp/blob/master/configs/UNICAST-MASTER.cfg with the mentioned modifications

xiaoerlangya commented 3 years ago

@AndreV84
Did you receive Req/Resp messages on Wireshark tool? And did you receive 512,513 messages in event viewer please? I also tried to deploy the PTP client in Windows to complete the clock synchronization with LinuxPTP in Linux. Windows could only receive sync, follow up and Announce messages, but did not reply any messages(delay_req). What's the matter?

AndreV84 commented 3 years ago

exactly! receive Req/Resp messages on Wireshark tool also 512,513 however if you are not binded to ptp4l as I am you may use pre-configured ptpd that works but less desireable in certain situations

xiaoerlangya commented 3 years ago

@AndreV84 Thank you for your replying. It is a pity that Centos only support Linuxptp. I also added the unicast_master configuration file as above image And run like this image But the windows did not reply any messages.

mdavids commented 2 years ago

My guess is that the currentUtcOffsetValid-flag (PTP_UTC_REASONABLE in Wireshark) has to be non-zero, which is something that can be easily accomplished with PTPd, but is not a trivial thing to do with LinuxPTP.

Obviously, also the domain has to be '0' and the PTP_TIMESCALE-flag also has to be set.