ValueError: non-hexadecimal number found in fromhex() arg at position 15

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

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
python
領域
networking

研究方向

從 can/interfaces/slcan.py 第 218 行開始,追蹤 bus.recv(35) 如何將收到的 SLCAN 資料傳遞給 fromhex()。在 Ubuntu 上使用 TITAN USB-CAN-M 重現此故障,並檢查會產生位置 1 或 15 的影格。需要先釐清對格式錯誤影格的預期處理方式,以及應該略過封包還是將其呈現出來,才能定義何時算完成。

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

描述

bug
Describe the bug

I've updated Python Can to 4.4.2 (not sure which version I was using before).
All of a sudden I'm getting a "ValueError" exception in bus.recv() every few minutes.

For now, I've handled the exception and proceed to wait for the next message.
it works, but now I miss an occasional packet from the CAN bus.

the exact message is:
/can/interfaces/slcan.py", line 218, in _recv_internal
ValueError: non-hexadecimal number found in fromhex() arg at position 15

the "position" always seems to be either 1 or 15 (havent seen any other numbers.

To Reproduce

the code I use is simple:

CanMessage = bus.recv(35)

Expected behavior

previous versions did not throw this error (ever)

Additional context

OS and version: Ubuntu 24.04 LTS
Python version: 3.8.10
python-can version: 4.4.2
python-can interface/s (if applicable): SLCAN interface from TITAN (USB adapter)
https://www.titan.tw/product/usb-can-m/

Traceback and logs
def func():
    return "hello, world!"
主要語言
Python
星號
1.6k
分支
715
平均合併
2 天 4 小時
30 天內合併 PR
42

環境準備

從這裡開始

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

hardbyte/python-can 的其他 Issue

查看 hardbyte/python-can 的全部 Issue

相似的 Issue

更多 Python Issue

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

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