receiving-code-review
OBobra/superpowers298k2,631 new stars in the last 7 days
当需要调试 CAN 总线通信时使用,支持通过 USB-CAN 适配器监听、发送 CAN 帧和扫描节点。
python-can(pip install python-can)python scripts/can_tool.py --detect
# 监听总线
python scripts/can_tool.py --interface pcan --channel PCAN_USBBUS1 --listen --duration 10
# 发送帧
python scripts/can_tool.py --interface pcan --channel PCAN_USBBUS1 --send --id 0x123 --data 01,02,03
# 扫描节点
python scripts/can_tool.py --interface pcan --channel PCAN_USBBUS1 --scan --scan-range 0x001-0x0FF
connection-failure:适配器未连接或驱动未安装。bus-error:CAN 总线错误(如未接终端电阻)。timeout:发送后无响应。示例输出格式:
结果: ✅ 监听完成,收到 15 帧
连接: 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 DD
build-keil / build-platformio 烧录固件后,用此 skill 验证 CAN 通信。serial-monitor 互补:serial-monitor 查看串口调试输出,can-debug 进行 CAN 协议级调试。OBobra/superpowers298k2,631 new stars in the last 7 days
OBobra/superpowers298k2,631 new stars in the last 7 days
OBobra/superpowers298k2,631 new stars in the last 7 days
MAmattpocock/skills288k10,178 new stars in the last 7 days
MAmattpocock/skills288k10,178 new stars in the last 7 days
MAmattpocock/skills288k10,178 new stars in the last 7 days