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


问题即可解决

相关文章
|
3月前
|
Ubuntu Linux
progs/verifier_netfilter_retcode.c:42:1: error: unknown attribute 'btf_decl_tag' ignored
progs/verifier_netfilter_retcode.c:42:1: error: unknown attribute 'btf_decl_tag' ignored
|
7月前
|
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,
258 1
|
7月前
Argument of type 'XX' is not assignable to parameter of type 'XX'
Argument of type 'XX' is not assignable to parameter of type 'XX'
134 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
|
Scala
TYPE
TYPE
146 0
|
前端开发 数据库
Failed to load response dataNo data found for resource with given identifier
Failed to load response dataNo data found for resource with given identifier
1620 0
解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
FFmpeg Invalid data found when processing input
FFmpeg Invalid data found when processing input
520 0