problem in ip link set up can0 Linux

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
sara_123
Posts: 4
Joined: Mon 1. Nov 2021, 23:17

problem in ip link set up can0 Linux

Post by sara_123 » Tue 2. Nov 2021, 08:49

Hello again
after a lot of back and forth, I could finally run the interface and now with command

Code: Select all

ifconfig can0 
I can see

Code: Select all

can0: flags=128<NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
but when I run the command

Code: Select all

ip link set can0 up
I receive the following error message

Code: Select all

RTNETLINK answers: Invalid argument
my system is fedora 33

The linus itself has the driver for peak-usb pcan and after installation, as it had problem, I again removed it.
the result of

Code: Select all

/proc/pcan
is nothing and it does not produce anything.
after I uninstall the drivers with the followiing command I see status

Code: Select all

lsmod | grep ^peak
I see status as

Code: Select all

peak_usb
can anyone help me and say why the result of ip link is that?

sara_123
Posts: 4
Joined: Mon 1. Nov 2021, 23:17

Re: problem in ip link set up can0 Linux

Post by sara_123 » Tue 2. Nov 2021, 09:24

I solved the problem myself by calling this command before the other one

Code: Select all

ip link set can0 up type can bitrate 500000 dbitrate 2000000 fd on fd-non-iso on
just a question here, for other CAN, what bitrate shall be set?

M.Maidhof
Support
Support
Posts: 1434
Joined: Wed 22. Sep 2010, 14:00

Re: problem in ip link set up can0 Linux

Post by M.Maidhof » Tue 2. Nov 2021, 10:43

Hi,

you should set the bitrate to the value of your CAN nodes with which you will communicate.

BTW: SocketCAN related questions should be asked in the Linux section of our forum, because the PCANBasic API does not work with the SocketCAN driver.

regards

Michael

[Moderator: Moved topic to Linux section.]

Post Reply