From ddf0994ba21b94497800576d623ea4b2ca27cc5a Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 14 Apr 2023 14:55:35 -0400 Subject: parsecandump: New utility to parse Klipper messages in a candump capture Signed-off-by: Kevin O'Connor --- docs/CANBUS_Troubleshooting.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'docs') diff --git a/docs/CANBUS_Troubleshooting.md b/docs/CANBUS_Troubleshooting.md index 2991d72c..bd9ef045 100644 --- a/docs/CANBUS_Troubleshooting.md +++ b/docs/CANBUS_Troubleshooting.md @@ -78,6 +78,32 @@ Understanding the content of these messages will likely require low-level knowledge of Klipper's [CANBUS protocol](CANBUS_protocol.md) and Klipper's [MCU commands](MCU_Commands.md). +### Parsing Klipper messages in a candump log + +One may use the `parsecandump.py` tool to parse the low-level Klipper +micro-controller messages contained in a candump log. Using this tool +is an advanced topic that requires knowledge of Klipper +[MCU commands](MCU_Commands.md). For example: +``` +./scripts/parsecandump.py mycanlog 108 ./out/klipper.dict +``` + +This tool produces output similar to the [parsedump +tool](Debugging.md#translating-gcode-files-to-micro-controller-commands). See +the documentation for that tool for information on generating the +Klipper micro-controller data dictionary. + +In the above example, `108` is the [CAN bus +id](CANBUS_protocol.md#micro-controller-id-assignment). It is a +hexadecimal number. The id `108` is assigned by Klipper to the first +micro-controller. If the CAN bus has multiple micro-controllers on it, +then the second micro-controller would be `10a`, the third would be +`10c`, and so on. + +The candump log must be produced using the `-tz -Ddex` command-line +arguments (for example: `candump -tz -Ddex can0,#FFFFFFFF`) in order +to use the `parsecandump.py` tool. + ## Using a logic analyzer on the canbus wiring The [Sigrok Pulseview](https://sigrok.org/wiki/PulseView) software -- cgit v1.2.3-70-g09d2