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

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
david_AW
Posts: 2
Joined: Mon 21. Aug 2017, 19:33

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

Post by david_AW » Mon 21. Aug 2017, 20:06

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

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

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

Post by S.Grosjean » Tue 22. Aug 2017, 09:29

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
— Stéphane

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

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

Post by S.Grosjean » Tue 22. Aug 2017, 16:33

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
— Stéphane

david_AW
Posts: 2
Joined: Mon 21. Aug 2017, 19:33

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

Post by david_AW » Thu 24. Aug 2017, 18:44

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

Post Reply