Page 1 of 1

PCAN-USB stops receiving CAN messages on Linux (RaspberryPi)

Posted: Mon 21. Aug 2017, 20:06
by david_AW
Hello, i have a Problem with our PCAN-USB X6 in netdev mode on the Raspberry Pi.

Problem:
I receive CAN Data using candump and i also have a fast blinking green LED on the PCAN-USB device. After a period of time (appr. 7 to 10min) candump does not receive data anymore and the fast blinking LED turned into a slow blinking green LED.
When i try something like "ifconfig can1 down" or reloading the Module, the command hangs and after a while the system freezes.

System Information:
Raspberry Pi 3 / Raspbian / Kernel 4.9.41-v7+
PCAN Driver 8.4.0
netdev Mode settings:

Code: Select all

sudo ip link set can1 type can bitrate 50000
output of /proc/pcan

Code: Select all

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20170613_n (8.4.0) Aug 21 2017 14:17:54 --------------
*---------------------------- [mod] [usb] [net] -----------------------------
*--------------------- 6 interfaces @ major 241 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32  usbfd   can1       77 000 0x001c 00000000 00000000 00000000 00000000 0x0000
33  usbfd   can2       77 000 0x001c 00000000 00000000 00000000 00000000 0x0000
34  usbfd   can3       77 000 0x001c 00000000 00000000 00000000 00000000 0x0000
35  usbfd   can4       77 000 0x001c 00000000 00000000 00000000 00000000 0x0000
36  usbfd   can5       77 000 0x001c 00000000 00000000 00000000 00000000 0x0000
37  usbfd   can6       77 000 0x001c 00000000 00000000 00000000 00000000 0x0000
Can someone help me how to overcome this issue or what i could try?
best regards,
David

Re: PCAN-USB stops receiving CAN messages on Linux (Raspberr

Posted: Tue 22. Aug 2017, 09:29
by S.Grosjean
Hello,

Your Kernel v4.9 should include the support of the PCAN-USB X6 without the help of the pcan driver:

http://elixir.free-electrons.com/linux/ ... fd.c#L1161

Can you first please uninstall pcan, then reboot your RPi and test again with the mainline Kernel driver?

Code: Select all

$ cd peak-linux-driver-8.4.0
$ sudo make uninstall
$ sudo reboot
Regards,

Stéphane

Re: PCAN-USB stops receiving CAN messages on Linux (Raspberr

Posted: Tue 22. Aug 2017, 16:33
by S.Grosjean
Hi,
output of /proc/pcan

*------------- PEAK-System CAN interfaces (http://www.peak-system.com) -------------
*------------- Release_20170613_n (8.4.0) Aug 21 2017 14:17:54 --------------
*---------------------------- [mod] [usb] [net] -----------------------------
*--------------------- 6 interfaces @ major 241 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32 usbfd can1 77 000 0x001c 00000000 00000000 00000000 00000000 0x0000
...
Please can you tell me why the can interfaces enum starts from can1 but not from can0?

FYI: we aren't able to reproduce your issue here... Could you tell me more about the CAN traffic of the CAN bus connected to your "can1" please? (busload,...)

About mainline driver: raspbian Kernel 4.9 default config does not select the PEAK USB devices. Are you able to rebuild your own Kernel?

Regards,

Stéphane

Re: PCAN-USB stops receiving CAN messages on Linux (Raspberr

Posted: Thu 24. Aug 2017, 18:44
by david_AW
Hello Stéphane.

The Interfaces start with CAN1, because I also have the "PiCAN2" interface connected and this one uses "CAN0".

I wanted to use the "original" pcan driver because the Kernel driver is not compiled by default.
But now I have build the kernel module and the CAN interface works. I was a little bit irritated because there was no "pcan" kernel module but only a "peak_usb", but it works.

The Busload during testing was like 60 Packages per sec. so ... not much :)
During testing i connected the also to the PiCAN2 card as a reference.

I also tested your pcan driver on my Ubuntu 16.04 machine (Kernel 4.10.0) and everything was fine.

Tomorrow i will try out a newly setup Pi without the PiCAN2 card to eliminate the factor for any of my settings having an effect on the netdev pcan driver.
I'll also try the chardev and report beck to you.

Thank you for your quick response. ... sorry for my slow response :)
David Fiebig