I use the internal CAN from the revpi 5s and I did set the vorrect configuration via the commands:
sudo ip link set can0 up type can bitrate 250000
and:
sudo ip link set dev can0 type can termination 120
communication is working and everything is fine but after restarting the revpi everything is reset, how should I set these parameters permanently?
CAN permanent on
Re: CAN permanent on
Hi,
you can configure the CAN interface for example with an entry in /etc/network/interfaces.
Example:
you can configure the CAN interface for example with an entry in /etc/network/interfaces.
Example:
Code: Select all
auto can0
iface can0 inet manual
pre-up /sbin/ip link set can0 type can bitrate 250000 termination 120
up /sbin/ip link set can0 up
down /sbin/ip link set can0 down
-
- Posts: 2
- Joined: 30 Jun 2025, 16:48
Re: CAN permanent on
Thanks for responding, yeah that is what I also thought, but because we have to modifiy the rate and termination dynamically we choose a different way because for the described way we would need sudo for any changes on the bitrate/termination.
We made some entries in the sudoers file so we can run these specific commands without sudo - so now we can activate different bitrates and terminations by a non privileged python script with subprocess.run
We made some entries in the sudoers file so we can run these specific commands without sudo - so now we can activate different bitrates and terminations by a non privileged python script with subprocess.run
