Populate CAN Hardware and Circuit IDs
Linuxcan PPA
A PPA (Personal Package Archive) is now available for Ubuntu 16.04+ to install Kvaser Linuxcan as a DKMS (Dynamic Kernel Module System) module. This saves you from having to rebuild/fix linuxcan after every new kernel upgrade. To install the PPA, do the following:
sudo apt-add-repository ppa:astuff/kvaser-linux sudo apt-get update sudo apt-get install kvaser-canlib-dev kvaser-drivers-dkms
After a reboot, linuxcan should work as before and automatically re-build on a new kernel install. New versions will become available on this PPA as they are released by Kvaser.
Used when configuring a driver launch file to work with a specific Kvaser interface.
- Verify that Kvaser Linuxcan SDK has been installed in /usr/src/
- Reboot to load the necessary modules.
cd /usr/doc/canlib/examples
./listChannels
The output should look similar to:
CANlib version 5.30 Found 4 channel(s). ch 0: Kvaser USBcan Light 4xHS 73-30130-00831-1, s/n 10761, v3.9.467 (mhydra v8.30.995) ch 1: Kvaser USBcan Light 4xHS 73-30130-00831-1, s/n 10761, v3.9.467 (mhydra v8.30.995)
The number following the "s/n" in each of these lines is the CAN Hardware ID (serial number).
- The CAN Circuit ID is the 0-based index of the channel that you're using on a specific piece of hardware. For example, the first channel listed here would be CAN Circuit ID 0 and the 2nd would be CAN Circuit ID 1. This ordering starts over for each piece of hardware. If there were two more channels here on another Kvaser USBcan Pro, they would also be CAN Circuit ID 0 and 1 respectively.
- Edit the launch file for the hardware you are attempting to interface with using the values you got above for the CAN Hardware ID and CAN Circuit ID.
Related articles