Hi,

As suggested I, sync the system with ntp, and try to syn the ptp clock to the 
ntp with the bellow command:
phc2sys -c eth0 -s CLOCK_REALTIME -w -m

the output is as follow:
 phc2sys[482428.142]: failed to adjust the clock: Invalid argument
phc2sys[482429.142]: /dev/ptp0 sys offset -39426033247 s0 freq -62499998 delay  
 8092
phc2sys[482430.142]: /dev/ptp0 sys offset -39244825430 s1 freq +62499999 delay  
 8024
phc2sys[482431.143]: /dev/ptp0 sys offset  42224476 s2 freq +62499999 delay   
7140
phc2sys[482432.143]: /dev/ptp0 sys offset  84448383 s2 freq +62499999 delay   
7140
phc2sys[482433.143]: /dev/ptp0 sys offset 126675417 s2 freq +62499999 delay   
7140
phc2sys[482434.143]: /dev/ptp0 sys offset 168899147 s2 freq +62499999 delay   
7140
phc2sys[482435.143]: /dev/ptp0 sys offset 211122760 s2 freq +62499999 delay   
7140
phc2sys[482436.143]: /dev/ptp0 sys offset 253349385 s2 freq +62499999 delay   
7140
phc2sys[482437.143]: /dev/ptp0 sys offset 295572370 s2 freq +62499999 delay   
7140
phc2sys[482438.144]: /dev/ptp0 sys offset 337798615 s2 freq +62499999 delay   
7140
phc2sys[482439.144]: /dev/ptp0 sys offset 380023413 s2 freq +62499999 delay   
7140
phc2sys[482440.144]: /dev/ptp0 sys offset 422248716 s2 freq +62499999 delay   
7140
phc2sys[482441.144]: /dev/ptp0 sys offset 464475365 s2 freq +62499999 delay   
7140
phc2sys[482442.144]: /dev/ptp0 sys offset 506698779 s2 freq +62499999 delay   
7140
phc2sys[482443.144]: /dev/ptp0 sys offset 548924548 s2 freq +62499999 delay   
7140
phc2sys[482444.145]: /dev/ptp0 sys offset 591150163 s2 freq +62499999 delay   
7140
phc2sys[482445.145]: /dev/ptp0 sys offset 633375709 s2 freq +62499999 delay   
7140
phc2sys[482446.145]: /dev/ptp0 sys offset 675601173 s2 freq +62499999 delay   
7140
phc2sys[482447.145]: /dev/ptp0 sys offset 717836810 s2 freq +62499999 delay   
7110
phc2sys[482448.145]: /dev/ptp0 sys offset 760061469 s2 freq +62499999 delay   
7140
phc2sys[482449.146]: /dev/ptp0 sys offset 802287095 s2 freq +62499999 delay   
7140
phc2sys[482450.146]: /dev/ptp0 sys offset 844513279 s2 freq +62499999 delay   
7140
phc2sys[482451.146]: /dev/ptp0 sys offset 886737361 s2 freq +62499999 delay   
7140
phc2sys[482452.146]: /dev/ptp0 sys offset 928962618 s2 freq +62499999 delay   
7140
phc2sys[482453.146]: /dev/ptp0 sys offset 971189704 s2 freq +62499999 delay   
7095
phc2sys[482454.146]: /dev/ptp0 sys offset 1013413259 s2 freq +62499999 delay   
7140
phc2sys[482455.146]: /dev/ptp0 sys offset 1055638608 s2 freq +62499999 delay   
7140
phc2sys[482456.147]: /dev/ptp0 sys offset 1097864692 s2 freq +62499999 delay   
7140
phc2sys[482457.147]: /dev/ptp0 sys offset 1140089528 s2 freq +62499999 delay   
7140
phc2sys[482458.147]: /dev/ptp0 sys offset 1182315375 s2 freq +62499999 delay   
7140
phc2sys[482459.147]: /dev/ptp0 sys offset 1224541476 s2 freq +62499999 delay   
7140
phc2sys[482460.147]: /dev/ptp0 sys offset 1266764698 s2 freq +62499999 delay   
7140
phc2sys[482461.147]: /dev/ptp0 sys offset 1308990256 s2 freq +62499999 delay   
7140

and the relationship between the ptp clock and system clock is:
tm(phc): 1581564733s. 716823966ns tm: 1581564737s. 378196163ns
tm(phc): 1581564739s. 622791870ns tm: 1581564742s. 378247922ns
tm(phc): 1581564784s. 470432955ns tm: 1581564747s. 378318953ns
tm(phc): 1581564789s. 681616666ns tm: 1581564752s. 378404115ns
tm(phc): 1581564794s. 893125321ns tm: 1581564757s. 378801531ns
tm(phc): 1581564800s. 104304217ns tm: 1581564762s. 378882307ns
tm(phc): 1581564805s. 315701048ns tm: 1581564767s. 379171828ns
tm(phc): 1581564810s. 526893173ns tm: 1581564772s. 379265735ns
tm(phc): 1581564815s. 738059409ns tm: 1581564777s. 379334222ns
tm(phc): 1581564820s. 949231540ns tm: 1581564782s. 379408294ns
tm(phc): 1581564826s. 160802100ns tm: 1581564787s. 379864754ns
tm(phc): 1581564831s. 371992126ns tm: 1581564792s. 379956776ns
tm(phc): 1581564836s. 583162577ns tm: 1581564797s. 380029394ns
tm(phc): 1581564841s. 794356802ns tm: 1581564802s. 380123935ns
tm(phc): 1581564847s. 5735438ns tm: 1581564807s. 380397121ns
tm(phc): 1581564852s. 216926229ns tm: 1581564812s. 380489103ns
tm(phc): 1581564857s. 428123304ns tm: 1581564817s. 380587495ns
tm(phc): 1581564862s. 639312865ns tm: 1581564822s. 380679348ns
tm(phc): 1581564867s. 850491446ns tm: 1581564827s. 380758710ns
tm(phc): 1581564873s. 61680766ns tm: 1581564832s. 380849789ns
tm(phc): 1581564878s. 272850092ns tm: 1581564837s. 380921760ns
tm(phc): 1581564883s. 484293348ns tm: 1581564842s. 381256006ns
tm(phc): 1581564888s. 695483928ns tm: 1581564847s. 381348215ns

As shown above the system time is now sync via ntp as expected however the phc 
is still jumping around is the command I use correct to sync the PTP clock to 
the system clock? Is there other way to do it ?

Thanks,
Wen Bin Leong

-----Original Message-----
From: Wen Bin Leong <wenbin.le...@rapsodo.com> 
Sent: Thursday, 13 February 2020 9:18 am
To: Miroslav Lichvar <mlich...@redhat.com>
Cc: linuxptp-users@lists.sourceforge.net
Subject: Re: [Linuxptp-users] ptp time delta between master and slave

Hi,

I think the master's system clock and ptp clock is not synchronised to anything 
or to each other, could that be the problem ?

Thanks,
Wen Bin Leong

-----Original Message-----
From: Miroslav Lichvar <mlich...@redhat.com> 
Sent: Wednesday, 12 February 2020 5:14 pm
To: Wen Bin Leong <wenbin.le...@rapsodo.com>
Cc: linuxptp-users@lists.sourceforge.net
Subject: Re: [Linuxptp-users] ptp time delta between master and slave

On Wed, Feb 12, 2020 at 09:03:15AM +0000, Wen Bin Leong wrote:
> as you can see the nano sec of the slave side add up nicely, however the nano 
> sec of the master side jumps randomly, is this behaviour expected? And is the 
> offset expected ?

I think that normally wouldn't be expected. How is the PHC on master 
synchronized? By phc2sys to the system clock? How is the system clock 
synchronized? PTP, NTP, reference clock?

--
Miroslav Lichvar



_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users


_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to