Installing on Linux

We recommend that you install the drivers first, then the Kvaser CANlibSDK, and last install the hardware.

The latest versions of documentation, software and drivers can be downloaded for free at www.kvaser.com/download.

Installing the Driver

System requirements:

  • Linux 2.6.29 or later
  • Header files and compiler for kernel compilation.

In Ubuntu e.g. installing header files is accomplished by issuing the command:

sudo apt-get install build-essential

On some systems you may need to install the Linux headers using something like:

sudo apt-get install linux-headers-`uname -r`
Note
Having versions of the Linux headers installed other than that of the currently running kernel may cause conflicts and faulty drivers.

To download and unpack the latest drivers you may use:

wget --content-disposition "https://www.kvaser.com/downloads-kvaser/?utm_source=software&utm_ean=7330130980754&utm_status=latest"
tar xvzf linuxcan.tar.gz
cd linuxcan
Note
Choose a path that doesn't contain any spaces for CANlib to build properly.

To build (compile) all drivers use:

make
Note
It is advised to remove the old driver by calling sudo make uninstall before replacing the installed drivers.

To install all drivers use:

sudo make install

To install and load, virtual and PCI drivers:

sudo make load
Note
Running sudo make load will also cause the virtual and PCI drivers to be loaded at boot time. This might be bad if experimenting with the device drivers.
It is never required to manually install or load any modules, create or edit files. This is taken care of the Makefile, in the root of the linuxcan directory.

More information can be found in the included README file.

Installing Virtual Devices

The driver named "virtualcan" controls the Virtual Devices. The number of channels each Virtual Device has, and the total number of Virtual Devices, is controlled by editing define statements in linuxcan\virtualcan\virtualcan.h.

#define NR_CHANNELS 2
#define NR_VIRTUAL_DEV 1

Removing the driver

To unload and uninstall all drivers:

sudo make uninstall

Alternatively, if there are multiple versions of the drivers installed, all of them can be removed using:

sudo make purge

Installing Kvaser CANlib SDK

System requirements:

  • The package libxml2-dev is needed in order to build kvamemolibxml.
  • The packages libssl-dev and zlib1g-dev are needed to build kvlclib.

To download and unpack the latest version of Linux SDK library use:

wget --content-disposition "https://www.kvaser.com/downloads-kvaser/?utm_source=software&utm_ean=7330130981966&utm_status=latest"
tar xvzf kvlibsdk.tar.gz
cd kvlibsdk

To build everything, run

make

To run self-tests, run

make check

To install everything, run

sudo make install

Removing Kvaser CANlib SDK

To uninstall everything, run

sudo make uninstall