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

Hi,

looks like you have built the driver for chardev instead of netdev. Please povide the output of uname -r, to see which kernel version you are using.

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 10. Nov 2014, 16:14

Hi Michael,

The kernel version I am using is 3.11.0-15-generic.

I had built first chardev by thinking I am doing alright, then I realized that I had to do do netdev.
I have deleted the folder "peak-linux-driver-7.13" and redo everything from beginning. Do you think I have to make other changes to be able to build chardev?

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 10. Nov 2014, 16:33

Hi,

when you want to use socketCAN, please build the driver for netdev! No need to delete the driver, simply remove the driver with rmmod pcan, than build, install and modprobe it again, and check with cat /proc/pcan that a can0 device will be available.

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 10. Nov 2014, 18:49

Hi Michael,

rmmod worked well, now I can see can0.
I wanted to test the communication by running candump can0, but I don't see any messages.
I changed also baudrate to 0x014, using echo "i 0x014 e" > /dev/pcan32, but I still don't see anything. Any idea?

Thank you for quick and accurate responses.

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 » Tue 11. Nov 2014, 13:32

Hi,

sure there are CAN messages @1Mbit/s available on your CAN bus? How about termination of your cables? Please post the output of cant /proc/pcan to see the status of the device.

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 » Tue 11. Nov 2014, 15:20

Hi,

When I run

Code: Select all

sudo ifconfig can0 up
I receive

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 0x001c 00000002 00000000 00000004 00000002 0x000c
and when I do

Code: Select all

echo "i 0x0014 e" > /dev/pcan32
I receive

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 0000012d 00000000 00000141 0000012c 0x0000
The Peak USBCAN is blinking red in 1Hz.

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 » Thu 13. Nov 2014, 09:43

Hi,

please check your CAN cables, /proc/pcan shows a lot of errors. Maybe you forget the CAN termination on both ends, or running on a wrong baudrate.

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 » Thu 20. Nov 2014, 19:26

Hi,

I have double checked my connections.
Last two connections are CAN-H and CAN-L connected correctly.

Here can be the problems:
-I am feeding 5V (PIN-1) and GND (PIN-3) externally, using Arduino-uno. So the GND of CAN is connected to the GND of Arduino-uno, as well as the 5V. Do you think I miss something here?
-Should I put 120 Ohm between CAN-H and CAN-L ?? I didn't do it so far, I will do and post the result.

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 » Fri 21. Nov 2014, 11:12

Hi,

yes, please insert termination resisitors on both ends of your cable. This is necessary to let the CAN bus work!

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, 14:23

Hi,

You are right. I put 120 ohm between CAN-H and CAN-L right after the sensor. Other end is USB cable, should I put another 120 ohm before connecting to USB port of PC?

Thanks!!
Burak

Post Reply