Cannot find device can0

USB to CAN Interface
Post Reply
freddy.ben-zeev
Posts: 10
Joined: Fri 14. Jun 2024, 20:03

Cannot find device can0

Post by freddy.ben-zeev » Mon 15. Jul 2024, 20:13

I'm using PCAN-USB device with the Linux version of pcan-view and it works fine, but if I try instead to use candump (from can-utils) is claims there is no can0 device. I've checked with ifconfig and with "ip link ls" and there is really no can0 device.

I'm using:
Ubuntu 20.04
peak-linux-driver-8.18.0
can-utils

I remember in the past using both candump and pcan-view. I had to bring down the can0 device with "sudo ip link set down can0" in order to be able to use pcan-view in listen-only mode. But now when I do "sudo ip link set up can0" it tells me there is no can0 device.

I have copied 80-can.network to directory /etc/systemd/network/ and run "sudo systemctl enable systemd-networkd" and "sudo systemctl start systemd-networkd" - didn't help.

I don't know if it will help - I don't see peak_usb in lsmod.

Any ideas?

Freddy

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Cannot find device can0

Post by M.Heidemann » Tue 16. Jul 2024, 11:20

Dear Freddy,
I remember in the past using both candump and pcan-view
Not at the same time, that's not possible.

PCANView for Linux uses the CharDev variant of the driver which will not expose network devices (can0, can1, etc) but will create "pcan" devices under /dev.

If you want to use SocketCAN, either uninstall the driver and reboot (The kernel driver will make use of socketCan)
I have copied 80-can.network to directory /etc/systemd/network/ and run "sudo systemctl enable systemd-networkd" and "sudo systemctl start systemd-networkd" - didn't help.
Please refer to the documentation before trying workarounds, they might not be needed:

https://www.peak-system.com/fileadmin/m ... an_eng.pdf
I don't know if it will help - I don't see peak_usb in lsmod
Because it will get blacklisted once you install the driver form the driver package, so no conflicts arise.

Uninstall the driver (Switch to driver folder -> sudo make uninstall -> reboot)

And you should be able to see peak_usb being loaded again.

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

freddy.ben-zeev
Posts: 10
Joined: Fri 14. Jun 2024, 20:03

Re: Cannot find device can0

Post by freddy.ben-zeev » Tue 16. Jul 2024, 18:55

Hi Marvin,

Thanks for the explanation. It didn't use to be like that... I used to have both network device can0 and pcan installed. It did cause one problem - if can0 was up then pcanview will notice that it is in use and not allow me to modify setup (such as turning listen-only option on). Maybe this was when I was using peak-linux-drive 8.15.2.

At least I understand it now and know how to switch if/when I need...

Thanks,

Freddy

Post Reply