Naming multiple PEAK USB CAN adpaters
Naming multiple PEAK USB CAN adpaters
Hello, all! I've searched for days for a solution to this, before giving up and making an account here to ask for a solution.
I'm running Ubuntu 20.04, and have two PEAK USB CAN interfaces connected. They have different CAN IDs, set using the PCAN utility. By default they will enumerate as "can0" and "can1" using the built-in peak driver included with the linux kernel. dmesg reveals that the CAN channel IDs are persistent and revealed by the "bcdDevice" attribute.
I have programs that need to access each specific and separate bus, but I can't guarantee that they will always enumerate to the same device. So, I would like to use a udev rule or some other mechanism to give each USB CAN interface a known name each time the computer comes up. So far my efforts of using a udev rule that uses the attribute "bcdDevice" (seemingly the only unique identifier available) along with the NAME= assignment have been fruitless. It just doesn't seem to use the bcdDevice rule at all and assigns can0 and can1 regardless.
The example udev rule provided in the PEAK docs that uses a PROGRAM= with matching bash program doesn't work, since the driver doesn't seem to actually create a "/sys/class/net/can0/peak_usb/can_channel_id" file that it can cat a channel ID from.
Can anyone help? I'm pulling my hair out here - there's got to be a way to do this, right??
I'm running Ubuntu 20.04, and have two PEAK USB CAN interfaces connected. They have different CAN IDs, set using the PCAN utility. By default they will enumerate as "can0" and "can1" using the built-in peak driver included with the linux kernel. dmesg reveals that the CAN channel IDs are persistent and revealed by the "bcdDevice" attribute.
I have programs that need to access each specific and separate bus, but I can't guarantee that they will always enumerate to the same device. So, I would like to use a udev rule or some other mechanism to give each USB CAN interface a known name each time the computer comes up. So far my efforts of using a udev rule that uses the attribute "bcdDevice" (seemingly the only unique identifier available) along with the NAME= assignment have been fruitless. It just doesn't seem to use the bcdDevice rule at all and assigns can0 and can1 regardless.
The example udev rule provided in the PEAK docs that uses a PROGRAM= with matching bash program doesn't work, since the driver doesn't seem to actually create a "/sys/class/net/can0/peak_usb/can_channel_id" file that it can cat a channel ID from.
Can anyone help? I'm pulling my hair out here - there's got to be a way to do this, right??
-
- Sales & Support
- Posts: 1069
- Joined: Fri 20. Sep 2019, 13:31
Re: Naming multiple PEAK USB CAN adpaters
Hello,
Use the driver package, you can set the device id using the peak-settings application:
BR
Marvin
Use the driver package, you can set the device id using the peak-settings application:
BR
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team
Re: Naming multiple PEAK USB CAN adpaters
Thanks for your reply. Does that utility do anything different that the Windows-based utility I already used for changing the PEAK USB's CAN address?
"pcan-settings" does not seem to be installed or available on my system. In fact, I don't think the 'pcan' module even exists on my system right now; it seems to be 'peak-usb'.
Would it make sense to remove the built-in driver and install the latest PEAK driver manually? Currently my linux kernel is 5.15.0-119-generic.
"pcan-settings" does not seem to be installed or available on my system. In fact, I don't think the 'pcan' module even exists on my system right now; it seems to be 'peak-usb'.
Would it make sense to remove the built-in driver and install the latest PEAK driver manually? Currently my linux kernel is 5.15.0-119-generic.
-
- Sales & Support
- Posts: 1069
- Joined: Fri 20. Sep 2019, 13:31
Re: Naming multiple PEAK USB CAN adpaters
Hello,
That's why i specified "driver package", pcan-settings is part of our proprietary driver packge:
Package:
https://www.peak-system.com/quick/PCAN-Linux-Driver
Docs:
https://www.peak-system.com/fileadmin/m ... an_eng.pdf
Best Regards
Marvin
That's why i specified "driver package", pcan-settings is part of our proprietary driver packge:
Package:
https://www.peak-system.com/quick/PCAN-Linux-Driver
Docs:
https://www.peak-system.com/fileadmin/m ... an_eng.pdf
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team
Re: Naming multiple PEAK USB CAN adpaters
Understood. I'll try installing that driver package to see if it'll give me the functions I need. Thanks!