astuff / kvaser_interface

A Kvaser CAN interface ROS abstraction layer.
MIT License
84 stars 52 forks source link

Error opening reader: -3 - No available CAN channels were found. #75

Closed pgupta2050 closed 2 years ago

pgupta2050 commented 2 years ago

Hello, I am trying to set up this ROS package and the corresponding Kvaser CANLIB API on Ubuntu 20.04, ROS Noetic; Kernel: 5.13.0-27-generic. I am using Kvaser Leaf Light v2.

I have attempted to install the Kvaser drivers using both methods (astuff PPA and source install with dkms) but I see the same results. Even though I can bring up the CAN interface with the appropriate baud-rate and print the CAN traffic to terminal using the candump can0 utility, The CANlib can not find available channels.

$ ./listChannels
Canlib version 5.36
Found 0 channel(s).

The ROS package thus shows:

prakhag@asset-308:~$ roslaunch kvaser_interface kvaser_can_bridge.launch can_hardware_id:=045365 can_bit_rate:=250000
... logging to /users/prakhag/.ros/log/83ef72d0-8391-11ec-b356-6dc45f8cc30f/roslaunch-asset-308-16711.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://asset-308:37907/

SUMMARY
========

PARAMETERS
 * /kvaser_can_bridge/can_bit_rate: 250000
 * /kvaser_can_bridge/can_circuit_id: 0
 * /kvaser_can_bridge/can_hardware_id: 45365
 * /rosdistro: noetic
 * /rosversion: 1.15.14

NODES
  /
    kvaser_can_bridge (kvaser_interface/kvaser_can_bridge)

auto-starting new master
process[master]: started with pid [16719]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 83ef72d0-8391-11ec-b356-6dc45f8cc30f
process[rosout-1]: started with pid [16729]
started core service [/rosout]
process[kvaser_can_bridge-2]: started with pid [16732]
[ INFO] [1643742155.433134360]: Kvaser CAN Interface - Got hardware_id: 45365
[ INFO] [1643742155.433846738]: Kvaser CAN Interface - Got can_circuit_id: 0
[ INFO] [1643742155.434040922]: Kvaser CAN Interface - Got bit_rate: 250000
[ERROR] [1643742155.436374756]: Kvaser CAN Interface - Error opening reader: -3 - No available CAN channels were found.
[kvaser_can_bridge-2] process has died [pid 16732, exit code 255, cmd /users/prakhag/catkin_ws/devel/lib/kvaser_interface/kvaser_can_bridge __name:=kvaser_can_bridge __log:=/users/prakhag/.ros/log/83ef72d0-8391-11ec-b356-6dc45f8cc30f/kvaser_can_bridge-2.log].
log file: /users/prakhag/.ros/log/83ef72d0-8391-11ec-b356-6dc45f8cc30f/kvaser_can_bridge-2*.log

I tried rebooting the system after the install, but it doesn't help.

Note:

And I have been able to do all this successfully in the past with Ubuntu 18.04 + ROS Melodic, on the same hardware. Is there a way to understand what is going wrong here?

Thanks!

icolwell-as commented 2 years ago

Hi @pgupta2050, there is currently an issue with our kvaser-drivers-dkms package, it doesn't work with the latest Ubuntu kernel version 5.13.0-27. This was discovered about 2 weeks ago and a fix is in-progress.

Until this is fixed, you currently have two options:

  1. Downgrade your kernel version to 5.11.0-40, that version of the linux kernel is known to work with the kvaser packages. After downgrading, make sure the kvaser-drivers-dkms package installs successfully.
  2. Use socketCAN with the socketcan_bridge ROS package instead of this kvaser_interface package. It looks like you already have the socketCAN kvaser driver working if you are able to candump can0, so maybe this is your best option for now. More info can be found here: http://wiki.ros.org/socketcan_bridge
pgupta2050 commented 2 years ago

Thanks @icolwell-as. I am going with option 2 for now and it works. I have can frame topics being published over ROS now. Cheers.

icolwell-as commented 2 years ago

Glad to hear you got it working!