astuff / kvaser_interface

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

Kvaser CAN Interface - CAN send error: -7 - A write operation failed on the CAN interface. #58

Closed Dheenu-kasinathan closed 3 years ago

Dheenu-kasinathan commented 3 years ago

Problem I believe when ever the Linux kernel gets updated, I am getting this write operation error.

I have to manually edit the leaf.sh file to give the permission to write on a channel.
changing the line 109 in leaf.sh to :

mknod -m 0666 /dev/$DEV$minor c $major $minor

Is there a way to avoid this error?

Thanks

icolwell-as commented 3 years ago

Hi @Dheenu-kasinathan, how did you install the kvaser kernel drivers? Directly from the kvaser website by compiling from source? or did you install the kvaser-drivers-dkms package from our astuff ppa?

Dheenu-kasinathan commented 3 years ago

Hi @icolwell-as . Yes I directly installing the driver from source (linuxcan).

https://www.kvaser.com/canlib-webhelp/section_install_linux.html

icolwell-as commented 3 years ago

Thanks for the info, it looks like the instructions on that page guide you through a typical install, which does not include the DKMS install. The DKMS install will automatically re-compile the drivers for you each time your kernel updates/changes. I suspect this will fix your issue. You have two options to perform a DKMS install:

Option 1: Use our launchpad PPA:

sudo apt-add-repository ppa:astuff/kvaser-linux
sudo apt install kvaser-canlib-dev kvaser-linlib-dev kvaser-drivers-dkms

Option 2: Build from source using DKMS (new feature kvaser added as of May 2021) Download their latest 5.36 release and follow the included README, see the section on "DKMS".

Hope this helps!

icolwell-as commented 3 years ago

Going to close this with the assumption it is resolved. @Dheenu-kasinathan please re-open if you are still having issues.