Shuffling network can names on restart - Ubuntu 14.04

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
monty_hall
Posts: 4
Joined: Mon 20. Mar 2017, 21:16

Shuffling network can names on restart - Ubuntu 14.04

Post by monty_hall » Fri 7. Apr 2017, 22:41

I have 5 peak pcan fd's and am having issues with network can names getting changed around when I restart. This is causing problems because from reboot to reboot, I never know if can42 will still point to the same pcan device. I don't want to make it sound like it shuffles around every time I reboot, but sometimes (like today) it does.

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20150729_n (7.15.2) Dec 6 2016 22:26:10 --------------
*---------------------------- [mod] [usb] [net] -----------------------------
*--------------------- 10 interfaces @ major 241 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
33 usbpfd can34 ffffffff 034 0x001c 00000039 00000000 00000065 00000000 0x0000
^^^ I would expect *n=33 translate into ndev=can33 *not* can34. It's almost as if it's using the irq

34 usbpfd can35 ffffffff 035 0x001c 00000000 00000000 00000000 00000000 0x0000
35 usbpfd can30 ffffffff 030 0x001c 00000000 00000000 00000000 00000000 0x0000
36 usbpfd can31 ffffffff 031 0x001c 00000000 00000000 00000000 00000000 0x0000
37 usbpfd can37 ffffffff 037 0x001c 00000000 00000000 00000000 00000000 0x0000
38 usbpfd can38 ffffffff 038 0x001c 00000000 00000000 00000000 00000000 0x0000
39 usbpfd can32 ffffffff 032 0x001c 00000000 00000000 00000000 00000000 0x0000
40 usbpfd can33 ffffffff 033 0x001c 00000000 00000000 00000000 00000000 0x0000
41 usbpfd can36 ffffffff 036 0x001c 00000000 00000000 00000000 00000000 0x0000
42 usbpfd can42 ffffffff 042 0x001c 00000000 00000000 00000000 00000000 0x0000

I was hoping that for each pcan, I could:
1. assign a non volatile id
2. have the can suffix use this id.

Ubuntu 14.04. Any advice appreciated.

Regards.

M

monty_hall
Posts: 4
Joined: Mon 20. Mar 2017, 21:16

Is there a relationship between device id and minor numer

Post by monty_hall » Sat 8. Apr 2017, 05:59

I guess I"m not sure what the "minor" number is. Is this the same as the device id (believe this is stored in non-volatile ram)?

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

Re: Shuffling network can names on restart - Ubuntu 14.04

Post by PEAK-Support » Mon 10. Apr 2017, 09:21

We have merged both post to one - make no sense to create a new thread.

you need to use our driver (NOT the mainline kernel driver) and compile it on your system. since version 8.x we support the assign Parameter. See manual section 4.8.1
Link to Download of latest driver & Docu
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

tkutscha
Posts: 3
Joined: Mon 10. Apr 2017, 20:06

Re: Shuffling network can names on restart - Ubuntu 14.04

Post by tkutscha » Mon 10. Apr 2017, 20:33

Thanks for answering this question. I had the same problem last week.
To fix this, I did the following:
1. Loaded the PEAK PCAN Linux driver
2. Added the following line to the /etc/modprobe.d/pcan.conf file: "options pcan assign=devid"
3. Plugged each PCAN adapter into the system by itself and ran "pcan-settings -f=/dev/pcanusb# -d <devid>"
where <devid> is a unique integer for each adapter

Now, after rebooting the system, instead of "can0" or "can32" I can use "can<devid>" to configure each adapter with its own settings. The <devid> is stored in non-volatile ram.

Cheers,
Tim

Post Reply