On Tue, Jan 12, 2021 at 12:51:50PM -0800, Richard Cochran wrote:
> On Tue, Jan 12, 2021 at 08:06:01PM +0200, Vladimir Oltean wrote:
> >
> > I'm looking for a way to block a shell script until phc2sys and ptp4l
> > have reached within a certain offset from the grandmaster (say +/- 50 ns).
> > Let's say I can write a program based on pmc which monitors the
> > master_offset from TIME_STATUS_NP, but what about phc2sys?
>
> We don't have any kind of management interface or IPC to phc2sys, but
> you might try this from your shell script.
>
>     $ phc_ctl -q eth6 cmp
>
>     phc_ctl[326755.414]: offset from CLOCK_REALTIME is 111513ns
>
> The script can evaluate that last word.

Actually the reported offset should also include the UTC offset, which
should be retrieved from currentUtcOffset from TIME_PROPERTIES_DATA_SET,
which requires pmc, which......

If I was willing to create, for inclusion into linuxptp, an all-in-one
program that waits until a certain clock is synchronized, how would that
ideally look, in your opinion? Lack of management PTP messages for
phc2sys means that I currently need to check sync by ssh'ing into the
destination machine and run a script on that. At that stage, it doesn't
really even matter if that script just scrapes some logs or measures the
offset itself, since all the good parts of having pmc have already been
lost by needing to ssh into a remote station.


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

Reply via email to