Last active
February 19, 2025 15:20
-
-
Save Lauszus/733c4c4c6abacd19a0b5dad099fab172 to your computer and use it in GitHub Desktop.
Ubuntu 20.04 auto configure CAN bus interfaces using systemd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Match] | |
Name=can* | |
[CAN] | |
BitRate=250000 | |
RestartSec=100ms | |
# Put this file in: "/etc/systemd/network/" and then run "sudo systemctl enable systemd-networkd" to enable systemd-networkd | |
# Now start systemd-networkd: "sudo systemctl start systemd-networkd" | |
# Credit: https://github.com/linux-can/can-utils/issues/68#issuecomment-584505426 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SUBSYSTEM=="net", KERNEL=="can*", ACTION=="add|change", ATTR{tx_queue_len}="1000" | |
# Add this to "/etc/udev/rules.d/80-can.rules" to increase the "txqueuelen" to 1000 | |
# Then run to trigger an update: | |
# sudo udevadm control --reload-rules | |
# sudo udevadm trigger --subsystem-match=net --action=change |
Okie, I resolved the file issue. May I know what CAN-Controller board do you use, please?
@vibnwis I use a PCAN-USB dongle: https://www.peak-system.com/PCAN-USB.199.0.html?&L=1.
This work as intend! Thanks for sharing!
I'm using those configuration with Mainsail OS with a CanBus over serial from a STM32 MCU w/ CAN Chain
- A Raspberry Pi Custom purpose distro for 3d printers.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would you mind sharing what CAN-controller board do you use? what file is it you put in "/etc/systemd/network/"