Howto install the PEAK Linux driver on a fresh Ubuntu

This forum covers PCAN-Linux and Linux development issues concerning our products
M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Howto install the PEAK Linux driver on a fresh Ubuntu

Post by M.Maidhof » Tue 21. Feb 2012, 12:05

Hi,

here is an info on howto install our peak-linux-driver-7.4 on a fresh installed Ubuntu 11.10 (same for 12.04, 12.10, 13.04, please use latest 7.x driver):

****************************
CHARDEV interface:
****************************

- download the driver peak-linux-driver-7.4.tar.gz from our linux website and copy it into your home directory.

- Install libpopt-dev: sudo apt-get install libpopt-dev
- Install g++: sudo apt-get install g++
(only necessary to build the test tool transmittest)

- unpack the driver: tar -xzf peak-linux-driver-7.4.tar.gz
- cd peak-linux-driver-7.4
- make clean
- make NET=NO
- sudo make install
- sudo modprobe pcan
- check with cat /proc/pcan that the driver was successfully installed.

*------------ PEAK-Systems CAN interfaces (http://www.peak-system.com) -------------
*-------------------------- Release_20110912_n (7.4.0) ----------------------
*---------------- [mod] [isa] [pci] [dng] [par] [usb] [pcc] -----------------
*--------------------- 1 interfaces @ major 250 found -----------------------
*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32 usb -NA- 30520000 255 0x001c 00000000 00000000 00000000 00000000 0x0000

now you can use the chardev tools in the /test directory or use cat /dev/pcan32 to see the messages in the console.

- to change the baudrate to 250k and enable extended IDs use:
echo "i 0x011C e" > /dev/pcan32

best regards

Michael

M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Re: Howto install the PEAK Linux driver on a fresh Ubuntu 11

Post by M.Maidhof » Wed 22. Feb 2012, 11:33

Hi,

here now the same for the NetDev Interface:

*************************
NETDEV interface:
*************************

- download the driver peak-linux-driver-7.4.tar.gz from our linux website and copy it into your home directory.

- Install libpopt-dev: sudo apt-get install libpopt-dev
- Install g++: sudo apt-get install g++
(only necessary to build the chardev test tool transmittest)

- unpack the driver: tar -xzf peak-linux-driver-7.4.tar.gz
- cd peak-linux-driver-7.4
- make clean
- make
- sudo make install
- sudo modprobe pcan
- check with cat /proc/pcan that the driver was successfully installed.

*------------ PEAK-Systems CAN interfaces (http://www.peak-system.com) -------------
*-------------------------- Release_20110912_n (7.4.0) ----------------------
*------------- [mod] [isa] [pci] [dng] [par] [usb] [pcc] [net] --------------
*--------------------- 1 interfaces @ major 250 found -----------------------
*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32 usb can0 30520000 255 0x001c 00000000 00000000 00000000 00000000 0x0000

Now we are ready to install the SocketCAN Tools:

- goto home directory again:
cd
- Install git:
sudo apt-get install git
- Get the SocketCAN Tools:
git clone https://github.com/linux-can/can-utils
- build and install the tools:
cd can-utils
make
sudo make install

Set the network up:
sudo ifconfig can0 up

Test the communication with candump:
candump can0

-available tools are:
candump
cangen
cansend
canbusload
canecho
canlogserver
cansniffer
canfdtest
canplayer

to change the baudrate use the echo call, as written in the first post with chardev driver.

regards

Michael

vagnusde67
Posts: 4
Joined: Fri 3. Aug 2012, 14:34

Re: Howto install the PEAK Linux driver on a fresh Ubuntu 11

Post by vagnusde67 » Fri 3. Aug 2012, 17:05

Hi Micheal, I compiled and installed usb pcan 7.7 running under ubuntu 12.04
This is the ouput of cat /proc/pcan



*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*-------------------------- Release_20120726_n (7.7.0) ----------------------
*------------- [dbg] [mod] [isa] [pci] [dng] [par] [usb] [pcc] --------------
*--------------------- 1 interfaces @ major 249 found -----------------------
*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32 usb -NA- ffffffff 255 0x001c 0000001c 00000034 0000007b 0000001c 0x0008

What puzzles me is the base address.
is it correct?

M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Re: Howto install the PEAK Linux driver on a fresh Ubuntu 11

Post by M.Maidhof » Mon 6. Aug 2012, 13:53

Hi,

yes this is correct, USB does not use a baseaddress or IRQ. So those two parameters are used to display SerNo and DeviceNumber of the USB device.

regards

Michael

aljosa_fer
Posts: 1
Joined: Thu 27. Feb 2014, 22:42

Re: Howto install the PEAK Linux driver on a fresh Ubuntu

Post by aljosa_fer » Mon 3. Mar 2014, 21:17

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20130814_n (7.9.0) Mar 3 2014 21:07:51 --------------
*---------------- [mod] [isa] [pci] [dng] [par] [usb] [pcc] -----------------
*--------------------- 0 interfaces @ major 250 found -----------------------
*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status

is this ok why is 0 interfaces, maybe i dont have usb pcan connected ?
Thanks

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Howto install the PEAK Linux driver on a fresh Ubuntu

Post by PEAK-Support » Tue 4. Mar 2014, 09:13

when you do not have connected or plugged in a PEAK CAN card / adapter, the driver could not find one.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

mccabehm
Posts: 4
Joined: Tue 1. Jul 2014, 22:12

Re: Howto install the PEAK Linux driver on a fresh Ubuntu

Post by mccabehm » Tue 1. Jul 2014, 22:23

Any complications when running Ubuntu 10.04 (Lucid, Linux version 2.6.32-38-generic) within VirtualBox? I always see "0 interfaces @ major 249 found" in /proc/pcan. The CAN/USB interface is physically attached. I have the USB device forwarded to the virtual machine. Using peak-linux-driver-7.11 as network device.

Harold

mccabehm
Posts: 4
Joined: Tue 1. Jul 2014, 22:12

Re: Howto install the PEAK Linux driver on a fresh Ubuntu

Post by mccabehm » Tue 1. Jul 2014, 23:55

I get around this problem when I run Ubuntu outside of VM. No further action required. Thanks,

Harold

M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Re: Howto install the PEAK Linux driver on a fresh Ubuntu

Post by M.Maidhof » Wed 2. Jul 2014, 13:30

Hi,

looks like a VM problem, please check that the VM extensions are installed on your VM client. But this issue is not related to our linux driver or hardware, it is a support issue of VirtualBox.

regards

Michael

ikavoydo
Posts: 9
Joined: Fri 7. Nov 2014, 18:06

Re: Howto install the PEAK Linux driver on a fresh Ubuntu

Post by ikavoydo » Fri 7. Nov 2014, 18:19

Hi Michael,

I am using Peak CanUSB 2.0 for reading from a force sensor.
As I figured out, I have to connect to a socket can system.

When I was following your instruction, I see that I need to make the NETDEV interface, or?

When I do so, I get this:

Code: Select all

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20140723_n (7.12.0) Oct 28 2014 19:47:08 --------------
*---------------- [mod] [isa] [pci] [dng] [par] [usb] [pcc] -----------------
*--------------------- 1 interfaces @ major 249 found -----------------------
*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32    usb -NA- ffffffff 255 0x001c 00000000 00000000 00000000 00000000 0x0000
As you see, the type of -ndev- is -NA-.

So when I continue with git clone for SocketCAN tools and do

Code: Select all

sudo ifconfig can0 up
of course it gives error, since there is no such a device called "can0"

Why am I getting

Code: Select all

-NA-
for

Code: Select all

-ndev-
and how can I fix it?

Thank you, and best,
Burak

Post Reply