hardbyte / hardbyte/python-can
Using kvaser revealed issues with connect.
- 主要語言
- Python
- 星號
- 1.6k
- 分支
- 697
- PR 合併指標
- 30 天內沒有已合併 PR
描述
bus = can.interface.Bus(interface='kvaser', channel=0, bitrate=500000)
when run this report error
File "\Lib\site-packages\can\interfaces\kvaser\canlib.py", line 563, in __init__
canIoCtlInit(
~~~~~~~~~~~~^
^^^^^^^^^^^^^^^^^^
...<2 lines>...
1,
^^
)
^
File "\Lib\site-packages\can\interfaces\kvaser\canlib.py", line 102, in __check_status_operation
raise CANLIBOperationError(function, result, arguments)
can.interfaces.kvaser.canlib.CANLIBOperationError: Function canIoCtl failed - Error in parameter [Error Code -1]
examining the original files of canlib, there is no longer a definition for canIOCTL_SET_LOCAL_TXACK.
so I commented out the following code, and it works fine now.
# enable canMSG_LOCAL_TXACK flag in received messages
# canIoCtlInit(
# self._read_handle,
# canstat.canIOCTL_SET_LOCAL_TXACK,
# ctypes.byref(ctypes.c_byte(local_echo)),
# 1,
# )
貢獻指南
研究方向
Start in can/interfaces/kvaser/canlib.py around line 563 and compare the canIOCTL_SET_LOCAL_TXACK definition and canIoCtlInit call with the installed Kvaser CANlib files. Reproduce the reported Bus configuration, then verify that connecting with the Kvaser interface succeeds and local transmit acknowledgment behavior is handled correctly.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- embedded-iot
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100