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

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

Post by M.Maidhof » Fri 21. Nov 2014, 15:44

Hi,

only CAN must be terminated on both ends of the bus (=cables), so please don´t terminate the USB cable :shock: :D

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 21. Nov 2014, 18:31

Hi,

It is added in both side, I see 60 ohm when I measure between CAN-H and CAN-L. I did not touch the USB :-)
The baudrate starts default with 0x001c, and every time when I do cat /proc/pcan, I see the error is increasing.
When I set baudrate to 0x0014, I see only one error, exactly like this:

Code: Select all

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20141017_n (7.13.0) Nov 10 2014 18:31:52 --------------
*------------- [mod] [isa] [pci] [dng] [par] [usb] [pcc] [net] --------------
*--------------------- 1 interfaces @ major 249 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32    usb   can0 ffffffff 255 0x0014 00000001 00000000 00000007 00000001 0x0000
Shall I try all the baudrate possibilities to see if it is a baudrate problem? Do you have a table of them?

Otherwise, I still don't know what can be the problem.

Cheers,
Burak

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 » Mon 24. Nov 2014, 10:05

Hi,

what is the baudrate of your sensor?

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 » Mon 24. Nov 2014, 11:22

Hi,

It is 1Mbps. Here is the datasheet:

http://www.icub.org/images/brochures/iC ... er_web.pdf

| am using peak adapter IPEH-002021.

Best,
Burak

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

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

Post by ikavoydo » Mon 24. Nov 2014, 12:19

Hi,

Before running candump0, should I send something like a transmission request?
If then, how to do it would depend on the sensor?

Best,
Burak

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 » Mon 24. Nov 2014, 13:55

HI,

yes, this is depending on your connected device, and has nothing to do with our PCAN hardware or our Linux driver.

regards

Michael

amineabm
Posts: 1
Joined: Wed 26. Nov 2014, 16:49

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

Post by amineabm » Wed 26. Nov 2014, 17:02

Hello,

I am installing peak-linux-driver-7.13 on on a fresh ubuntu.

Code: Select all

uname -a
Linux amine 3.13.0-40-generic #69~precise1-Ubuntu SMP Fri Nov 14 10:29:31 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
I folllowed the tutorial given in the first post : CHARDEV interface
I make with following flags

Code: Select all

make DNG=NO_DONGLE_SUPPORT ISA=NO_ISA_SUPPORT PCI=NO_PCI_SUPPORT PCC=NO_PCC_SUPPORT  NET=NO_NETDEV_SUPPORT
I get from cat /proc/pcan :

Code: Select all

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20141017_n (7.13.0) Nov 26 2014 16:23:05 --------------
*---------------------------- [mod] [par] [usb] -----------------------------
*--------------------- 1 interfaces @ major 248 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
33    usb   -NA- ffffffff 255 0x001c 00000000 00000000 00000000 00000000 0x0000

Why *n is 33 ? and how can I change it to 0 ?

Thanks for the reply
Regards

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

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

Post by S.Grosjean » Thu 27. Nov 2014, 10:35

Hi,

You're right when you're waiting for the first PEAK-System USB device be numbered from 32. That's what the pcan driver requests from the Linux Kernel USB core, when the Kernel option CONFIG_USB_DYNAMIC_MINORS is not set.
When this option is set, the USB core does handle the enum of the USB devices by itself, and in this case, it generally gives 0 as 1st minor value.
For compatibility reasons, the pcan driver then adds 32 to this value, in order to always offer to userspace the same numbering scheme, that is: PEAK USB CAN devices minor numbers start from 32.

So, it looks like your own system gave minor=1 to our USB device (instead of 0). To be sure of that, could you please give us the output of:

Code: Select all

$ dmesg | grep pcan
after the pcan driver module has been loaded.

Moreover, the pcan package also offers the ability to the user to give his own names to the pcan devices, by the mean of the Udev mechanism. The pcan package proposes its own way of giving names to the created devices, but this is only an example. You're able to set your own names, by changing things in 45-pcan.rules and/or pcan_usb_minor_check.bash.

Could you give us the output of the following command too, please:

Code: Select all

$ ls -l /dev/pcan*
Regards,

Stéphane
— Stéphane

djowlrid
Posts: 1
Joined: Thu 7. Apr 2016, 04:57

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

Post by djowlrid » Thu 7. Apr 2016, 05:18

hello.
I have a trouble installing peak can driver on my labtop.

I wanted to use socketCan. So, I installed following 2-ways

1. user manual

1. Untar the compressed tarball file from your $HOME (for example) directory:
$ tar –xzf peak-linux-driver-X.Y.Z.tar.gz
$ cd peak-linux-driver-X.Y.Z
2. Clean the world:
$ make clean
$ make –C driver NET=NETDEV_SUPPORT

1. Be sure to be in the driver package root directory:
$ cd peak-linux-driver-X.Y.Z
2. Install everything (root privileges are required):
a) On Debian-based systems, users can use the sudo command:
$ sudo make install
b) Otherwise, installation is done with:
$ su -c "make install"

$ sudo modprobe pcan

2. on this post

*************************
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

------------------------------------------------------------------------------

However, on my laptop, - ndev was always return -NA. I think it should be can0.
My kerner version is 3.19.0-25-generic, and installed peak-linux-driver-8.0.20-beta.

this is my question

Q1. is there any wrong way on my install process??
Q2. should i connect real devices with peak can to see ndev = can0?
If I don't connect any device with peak can, ndev always return -NA?
==> I have 2 encoders and they give can0, can1 ID in windows using PCAN-view. Also, I can get frame data. However, I cannot get data in Linux.

Q3. is there any way to check CAN device is connected or not?

Please help me !!

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

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

Post by S.Grosjean » Thu 7. Apr 2016, 11:01

Hello,
My kerner version is 3.19.0-25-generic, and installed peak-linux-driver-8.0.20-beta.
I think the issue is here: since v8 of the driver, we have decided to change how the default "pcan" driver should be built:

Before v8:

Code: Select all

$ make
was building the "pcan" driver WITH including the support of the socket-CAN.

Since v8:

Code: Select all

$ make
does build the "pcan" driver WITHOUT including the support of the socket-CAN.

The main reason of this big change is that the Kernel now natively includes (our) drivers providing socket-CAN access to our PC-CAN interfaces. We have decided that people who download the "pcan" driver are mainly interested by the "chardev" interface it proposes than the "netdev" one.

*BUT* it's always possible to use the "netdev" interface through the "pcan" driver, you "only" have to tell it on the command line:

Code: Select all

$ cd peak-linux-driver-x.y.x/driver
$ make NET=NETDEV_SUPPORT
$ sudo make install
Note that the "netdev" support has been enlarged in pcan v8. Now you can, for example, set the bitrates with using "ip link" tool (just as it is done with the mainline socket-CAN interface).

Regards,

Stéphane
— Stéphane

Post Reply