Documentation Index
Fetch the complete documentation index at: https://motorbridge.seeedstudio.com/llms.txt
Use this file to discover all available pages before exploring further.
Source:
docs/en/can_debugging.mdCAN Debugging Guide (Linux slcan + Windows pcan)
This guide is the canonical troubleshooting playbook for channel setup and link-level diagnostics.
1. Scope and Backend Mapping
- Linux backend: SocketCAN (
can0,can1,slcan0, …) - Windows backend: PEAK PCAN via
PCANBasic.dll(can0/can1mapping toPCAN_USBBUS1/2)
- Linux: configure bitrate at interface bring-up time; do not put
@bitratein--channel. - Windows PCAN:
@bitratesuffix is allowed in--channel(for examplecan0@1000000).
2. Linux slcan Bring-up and Verification
2.1 Bring up slcan0
- Interface exists as
slcan0 - State is
UP(orUNKNOWN)
2.2 Quick traffic sanity checks
Terminal A:candump, check adapter wiring, termination, and bitrate consistency with motor firmware.
2.3 Run motor_cli on slcan0
3. Linux Native SocketCAN (can0) Quick Checks
RX errors,TX errors,bus-off,re-started
bus-off grows, fix physical layer first (termination, ground reference, bitrate mismatch).
4. Windows PCAN Bring-up and Verification
4.1 Preconditions
- Install PEAK driver
- Install PCAN-Basic runtime (
PCANBasic.dll) and ensure it is loadable - Confirm adapter channel availability in PEAK tools
4.2 Channel conventions used by this project
can0->PCAN_USBBUS1can1->PCAN_USBBUS2- Optional bitrate suffix:
can0@1000000
4.3 Validation commands
load PCANBasic.dll failed, fix PATH/runtime installation first.
5. Error-to-Action Map
Linux SocketCAN path
if_nametoindex failed ...:- Interface name is wrong or interface not created/up
- Action:
ip link show, recreateslcan0or bring upcan0
socketcan write failed/socketcan read failedwith hintinterface is down:- Action:
ip -details link show <ifname>, then bring link up
- Action:
... unavailable/interface not found:- Action: check USB adapter presence and interface naming
Windows PCAN path
load PCANBasic.dll failed:- Action: install PCAN-Basic runtime and restart shell/IDE so DLL is discoverable
PCAN initialize failed: status=...:- Action: verify channel mapping (
can0/can1), bitrate suffix, adapter availability
- Action: verify channel mapping (
- Repeated reconnect failures:
- Action: check cable/termination/power and channel occupancy in PEAK tools
6. Minimal Cross-Platform Acceptance Checklist
- Linux
can0: scan command returns expected device IDs - Linux
slcan0: same scan command works afterslcandsetup - Windows
can0@1000000: scan succeeds with PEAK adapter - One control command (
mitorpos-vel) succeeds in each environment
pcan + slcan is considered aligned.