NotImplementedError: Invalid CAN Bus Type - None

简介: NotImplementedError: Invalid CAN Bus Type - None

连接can


can0 = can.interface.Bus(channel = ‘can0’, bustyp = ‘socketcan_ctypes’)


在python中连接can是会出现下列错误:


/

Traceback (most recent call last):
File “recv.py”, line 10, in
can1 = can.interface.Bus(channel = ‘can1’, bustyp = ‘socketcan_ctypes’)
File “/usr/local/lib/python3.7/dist-packages/can/interface.py”, line 108, in new
kwargs = load_config(config=kwargs, context=context)
File “/usr/local/lib/python3.7/dist-packages/can/util.py”, line 197, in load_config
raise NotImplementedError(‘Invalid CAN Bus Type - {}’.format(config[‘interface’]))
NotImplementedError: Invalid CAN Bus Type - None


解决方法:


在~/下添加 .canrc文件,


sudo vi ~/.canrc


里面填写如下信息


/

[default]
interface = socketcan
channel = can0


问题即可解决

相关文章
|
2月前
|
Go
panic:runtime error:invalid memory address or nil pointer dereference
panic:runtime error:invalid memory address or nil pointer dereference
|
Linux 开发工具 git
【已解决】could not read Username for ‘https://x.x.x‘: No such device or address
could not read Username for ‘https://x.x.x‘: No such device or address
1584 0
|
5月前
|
存储 缓存 自然语言处理
“error“: { “root_cause“: [{ “type“: “circuit_breaking_exception“, “reason“: “[parent] D【已解决】
“error“: { “root_cause“: [{ “type“: “circuit_breaking_exception“, “reason“: “[parent] D【已解决】
48 1
|
6月前
|
JavaScript 前端开发
完美解决 报错 Vue Invalid prop: type check failed for prop “min“. Expected Number with value 1,
完美解决 报错 Vue Invalid prop: type check failed for prop “min“. Expected Number with value 1,
255 1
|
前端开发 JavaScript
前端vue:解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
前端vue:解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
1354 0
前端vue:解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
|
6月前
Argument of type 'XX' is not assignable to parameter of type 'XX'
Argument of type 'XX' is not assignable to parameter of type 'XX'
133 0
|
人工智能 自然语言处理 语音技术
Invalid prop: type check failed for prop “index“. Expected String with value “5“问题解决
Invalid prop: type check failed for prop “index“. Expected String with value “5“问题解决
123 0