Detecting Disconnected Nodes with Node Guarding and Heartbeat Mechanisms #544
Unanswered
digitaldomi
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Yes, here it is: https://canopen.readthedocs.io/en/latest/nmt.html#canopen.nmt.NmtMaster.add_hearbeat_callback That can be used to build the monitoring features you describe. I don't think any more advanced functionality is implemented in the library though, that's left up to your application. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
I am trying to understand whether the library has built-in mechanisms to detect when a node becomes disconnected or unresponsive, and whether it can notify the master in such cases.
Case 1: Node Guarding
For each node, a Guard Time (0x100C) can be set. The NMT master sends a Node Guarding request to the node at this interval:
node.nmt.start_node_guarding(1000) # Guard Time 0x100C [ms]
Question:
Is there any timeout handling mechanism implemented in the library? Specifically, does the library provide a callback or notification when a node does not respond to node guarding requests after a certain period, such as based on the Life Time Factor (0x100D)?
Case 2: Heartbeat
When a node's heartbeat is enabled via object 0x1017 at a certain interval, it sends periodic heartbeat messages to indicate that it's still active.
network[node_id].sdo['Producer heartbeat time'].raw = 1000 # Producer Heartbeat Time 0x1017 [ms]
Question:
Does the library include a built-in mechanism to monitor heartbeat messages and inform the master if a node stops sending heartbeat messages within the expected interval (Consumer Heartbeat Time (Object x1016)? Is there a callback or notification system for heartbeat timeouts?
Environment
Library Version: 2.3.0
Python Version: 3.10.13
Beta Was this translation helpful? Give feedback.
All reactions