From 2db2ef82f2c0ba08d7e72fbab355de0846272b3a Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 14 Jan 2025 15:26:29 -0500 Subject: canbus_stats: Periodically report canbus interface statistics Add support for a new get_canbus_status command to canserial.c . Add new canbus_stats.py module that will periodically query canbus mcus for connection status information. Signed-off-by: Kevin O'Connor --- docs/Status_Reference.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'docs') diff --git a/docs/Status_Reference.md b/docs/Status_Reference.md index 66d840d1..ee809902 100644 --- a/docs/Status_Reference.md +++ b/docs/Status_Reference.md @@ -39,6 +39,27 @@ the following strings: "adjust", "fine". - `current_screw`: The index for the current screw being adjusted. - `accepted_screws`: The number of accepted screws. +## canbus_stats + +The following information is available in the `canbus_stats +some_mcu_name` object (this object is automatically available if an +mcu is configured to use canbus): +- `rx_error`: The number of receive errors detected by the + micro-controller canbus hardware. +- `tx_error`: The number of transmit errors detected by the + micro-controller canbus hardware. +- `tx_retries`: The number of transmit attempts that were retried due + to bus contention or errors. +- `bus_state`: The status of the interface (typically "active" for a + bus in normal operation, "warn" for a bus with recent errors, + "passive" for a bus that will no longer transmit canbus error + frames, or "off" for a bus that will no longer transmit or receive + messages). + +Note that only the rp2XXX micro-controllers report a non-zero +`tx_retries` field and the rp2XXX micro-controllers always report +`tx_error` as zero and `bus_state` as "active". + ## configfile The following information is available in the `configfile` object -- cgit v1.2.3-70-g09d2