PEAK CAN USB with socketCAN

In recent Linux Kernels PEAK CAN USB adapter works natively without the need of installing PEAK drivers. As the manufacturer says: Since kernel version 3.6, the netdev interface with all of the PEAK-System PC CAN interfaces is natively included in the mainline kernel. So, there is no need to install the PCAN driver for Linux when planning to use the SocketCAN interface in applications.

This is the task that you should follow in order to make the adapter work properly.

To load driver:

sudo modprobe peak_usb

You can check it by executing lsmod
Additionally, by executing dmesg, you should see something like:
peak_usb 2-2.1:1.0 can0: attached to PCAN-USB channel 0 (device 255)

To bring-up CAN NIC

sudo ip link set can0 up type can bitrate 1000000

(The number is the bit rate, in this case 1Mbps)

If you want to start can interface automatically check SocketCAN Readme, section 6.5

Hint:

sudo ip link set up can0
ifconfig can0

Resources:
Peak Systems CAN-USB Interface
socketcan_interface

Leave a Reply

Your email address will not be published. Required fields are marked *