Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Using kvaser revealed issues with connect.

未關閉
#2,015 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
python
領域
embedded-iot

研究方向

從 can/interfaces/kvaser/canlib.py 第 563 行附近開始,將 canIOCTL_SET_LOCAL_TXACK 定義和 canIoCtlInit 呼叫與已安裝的 Kvaser CANlib 檔案進行比較。重現回報的 Bus 設定,然後驗證使用 Kvaser 介面連線是否成功,以及本機傳輸確認行為是否得到正確處理。

由索引模型根據 Issue 內容生成。

描述

bug

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,
    # )
主要語言
Python
星號
1.6k
分支
701
PR 合併指標
30 天內沒有已合併 PR

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

hardbyte/python-can 的其他 Issue

查看 hardbyte/python-can 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。