can-debug
Original:🇨🇳 Chinese
Translated
1 scriptsChecked / no sensitive code detected
Used for debugging CAN bus communication, supports listening to, sending CAN frames, and scanning nodes via USB-CAN adapters.
11installs
Sourceleokemp223/embed-ai-tool
Added on
NPX Install
npx skill4agent add leokemp223/embed-ai-tool can-debugTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →CAN Bus Debugging
Application Scenarios
- Embedded devices that implement CAN communication need to verify whether sending and receiving are functioning properly.
- Need to monitor all frames on the CAN bus or filter specific IDs.
- Need to send test frames to the CAN bus and wait for responses.
- Need to scan active nodes on the bus.
Required Inputs
- CAN interface type (pcan, kvaser, slcan, socketcan, virtual, etc.).
- Channel name (depends on the interface type, e.g., PCAN_USBBUS1, COM3, can0).
- Baud rate (default 500000).
Dependencies
- (pip install python-can)
python-can - Drivers for the corresponding adapter (e.g., PCAN requires PCAN-Basic API)
Execution Steps
- First read references/usage.md to confirm operation parameters.
- Detect the environment:
bash
python scripts/can_tool.py --detect - Perform operations according to requirements:
bash
# Listen to the bus python scripts/can_tool.py --interface pcan --channel PCAN_USBBUS1 --listen --duration 10 # Send frames python scripts/can_tool.py --interface pcan --channel PCAN_USBBUS1 --send --id 0x123 --data 01,02,03 # Scan nodes python scripts/can_tool.py --interface pcan --channel PCAN_USBBUS1 --scan --scan-range 0x001-0x0FF
Failure Diversion
- : Adapter not connected or driver not installed.
connection-failure - : CAN bus error (e.g., no terminal resistor connected).
bus-error - : No response after sending.
timeout
Output Convention
Example output format:
Result: ✅ Listening completed, received 15 frames
Connection: pcan PCAN_USBBUS1 500000
[14:30:01] 0x123 [8] 01 02 03 04 05 06 07 08
[14:30:01] 0x456 [4] AA BB CC DDHandover Relationships
- After burning firmware with /
build-keil, use this skill to verify CAN communication.build-platformio - Complementary to : serial-monitor views serial port debugging output, can-debug performs CAN protocol-level debugging.
serial-monitor