On Tue, Jun 27, 2023 at 09:54:20AM +0800, 这个🍊 不太冷 via Linuxptp-users wrote:
> Hi,    I am running linuxptp on embedded board as slave. I need get 
> notification when some faults occur.
> such as:
> 1. network with master down;
> 2. sync/follow_up message reception timeout;3. the clock enters the 
> SERVO_LOCKED_STABLE state;
> 
> 4. clock offset exceeds threshold;
> 
> what should I do, if I want to receive real-time notifications instead of 
> analyzing logs.

There is a mechanism for receiving notifications from ptp4l, which can
be used in shell like this:

(
        echo 'SET SUBSCRIBE_EVENTS_NP duration 100 NOTIFY_PORT_STATE on 
NOTIFY_TIME_SYNC on'
        sleep 50
) | pmc -u -b 0

It is also supported by the libptpmgmt library, if you don't want to
be running this in popen() or similar.

There are currently only two notifications implemented, one for
changes of the port state and another for clock updates providing the
TIME_STATUS_NP message. I think that would work for your 1 and 4. For
the others some new notifications would need to be implemented.

-- 
Miroslav Lichvar



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

Reply via email to