CanInitializationError: No active interface found #282
Unanswered
norsechurros
asked this question in
Q&A - Tinymovr
Replies: 2 comments
-
Is the CANine adapter flashed with CANine firmware? by default it comes with the |
Beta Was this translation helpful? Give feedback.
0 replies
-
If you do use CANine firmware, you might need to add udev rules in Ubuntu as well. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been using the TinyMovr R5.1 with the latest firmware to run a BLDC Motor (RMCS 2071). I have installed all the required files for the gui and cli, and am being able to control the motor using cli commands. However when i try to integrate the API with a python file and execute it, i always get the following error:
[Running] /usr/bin/env python3.10 "/home/vansh/tm_ws/src/newcan.py"
Traceback (most recent call last):
File "/home/vansh/.local/lib/python3.10/site-packages/tinymovr/config/config.py", line 55, in get_bus_config
return configs[0]
IndexError: list index out of range
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/vansh/tm_ws/src/newcan.py", line 9, in
params = get_bus_config(['canine'])
File "/home/vansh/.local/lib/python3.10/site-packages/tinymovr/config/config.py", line 57, in get_bus_config
raise can.CanInitializationError("No active interface found") from exc
can.exceptions.CanInitializationError: No active interface found
The code is entirely copied from the online documentation and looks like this:
#!/usr/bin/env python3.10
import can
from tinymovr.tee import init_tee
from canine import CANineBus
from tinymovr.config import get_bus_config, create_device
params = get_bus_config(['canine'])
params["bitrate"] = 1000000
bus = can.Bus(interface="canine", bitrate=1000000)
init_tee(can.Bus(**params))
tm = create_device(node_id=1)
tm.controller.calibrate()
tm.controller.velocity_mode()
tm.controller.vel_setpoint = 1000
There seems to be an issue in trying to detect the can interface when the python file is run, but the cli is being able to detect and send commands without any issues. I have looked into the Python-can documentation as well as tinymovr's documentation but nothing seems to solve the error, what fixes must be made?
Other specifications:
CAN- adapter: CANine v1.3
OS: Ubuntu 20.04
Beta Was this translation helpful? Give feedback.
All reactions