Skip to main content

Channel Compatibility (PCAN + slcan + Damiao Serial Bridge)

  • Linux SocketCAN uses interface names directly: can0, can1, slcan0.
  • For USB-serial CAN adapters, bring up slcan0 first: sudo slcand -o -c -s8 /dev/ttyUSB0 slcan0 && sudo ip link set slcan0 up.
  • Damiao-only serial bridge transport is also available in CLI (--transport dm-serial --serial-port /dev/ttyACM0 --serial-baud 921600).
  • Full Damiao serial-bridge interface list and command patterns are documented in motor_cli/README.md (section 3.6 in motor_cli/README.zh-CN.md).
  • On Linux SocketCAN, do not append bitrate in --channel (for example can0@1000000 is invalid).
  • On Windows (PCAN backend), can0/can1 map to PCAN_USBBUS1/2; optional @bitrate suffix is supported.
This folder provides practical checks for:
  • endurance (long-run control/read loop)
  • error/timeout behavior (automated unit tests + manual HIL checks)
  • disconnect/recovery (manual HIL steps)
  • cross-platform scan consistency (Linux vs Windows)

1) Endurance

Run one command repeatedly and generate a JSON report: Windows (PCAN) example:
Linux (SocketCAN) example (can0 or slcan0):
Template-driven slcan0 regression (recommended):
Available templates:
  • tools/reliability/templates/linux_slcan_endurance_4340p.json
  • tools/reliability/templates/linux_slcan_endurance_rs00_vel.json
Pass criteria:
  • fail == 0
  • success_rate == 1.0
Template thresholds are evaluated automatically:
  • thresholds.max_fail
  • thresholds.min_success_rate

2) Error/Timeout Injection

Automated coverage is in cargo test --workspace --all-targets:
  • bus read error path (CoreController)
  • Damiao register timeout
  • RobStride parameter timeout

3) Disconnect / Recovery (HIL)

Manual steps:
  1. Start a short control loop (pos-vel or vel).
  2. Unplug PCAN-USB (or down Linux CAN interface).
  3. Verify command pauses, then auto-reconnect/retry is attempted.
  4. Re-plug / recover bus.
  5. Verify loop resumes without restarting the process, or re-run scan/control to confirm recovery.

4) Cross-Platform Consistency (Scan)

Save scan stdout logs on Linux and Windows, then compare:
Comparison checks:
  • per-vendor hits with optional tolerance (--allow-hit-delta)
  • vendor subset filtering (--vendors)
  • configurable id matching mode (--id-mode):
    • exact
    • left-subset
    • right-subset
    • intersect-nonempty