From 5936bd0e607caa88f38d9956492da97d158e89ef Mon Sep 17 00:00:00 2001 From: JamesH1978 <87171443+JamesH1978@users.noreply.github.com> Date: Mon, 27 Jan 2025 22:56:29 +0000 Subject: [PATCH 1/2] Update CANBUS.md for Bookworm This is a PR to add the steps needed for bookworm installations to enable the can0 network for host hardware Thanks James Signed-off-by: James Hartley --- docs/CANBUS.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/CANBUS.md b/docs/CANBUS.md index 321f8e8914c6..4089f457e453 100644 --- a/docs/CANBUS.md +++ b/docs/CANBUS.md @@ -25,7 +25,10 @@ mode") or that run the [candlelight firmware](https://github.com/candle-usb/candleLight_fw). It is also necessary to configure the host operating system to use the -adapter. This is typically done by creating a new file named +adapter. + +If you are using a Bullseye based system using ifupdown, this +is typically done by creating a new file named `/etc/network/interfaces.d/can0` with the following contents: ``` allow-hotplug can0 @@ -34,6 +37,28 @@ iface can0 can static up ip link set $IFACE txqueuelen 128 ``` +In newer Bookworm installations it is necessary to use systemd-networkd, +two files need to be created, one to define the interface and another to +set the txqueuelen, these are: +`/etc/systemd/network/80-can0.network` with the contents: +``` +[Match] +Name=can* + +[CAN] +BitRate=1M +``` +and `/etc/systemd/network/80-can0.link` with the contents: +``` +[Match] +OriginalName=can0 + +[Link] +TransmitQueueLength=128 +``` +then enable the service with `sudo systemctl enable systemd-networkd --now` + + ## Terminating Resistors A CAN bus should have two 120 ohm resistors between the CANH and CANL From 0fd02f0e2ee8aa7288e53a84015365fc905439e6 Mon Sep 17 00:00:00 2001 From: JamesH1978 <87171443+JamesH1978@users.noreply.github.com> Date: Wed, 29 Jan 2025 15:22:46 +0000 Subject: [PATCH 2/2] Update CANBUS.md Clarifying that these are Debian versions, as suggested. Thanks James --- docs/CANBUS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/CANBUS.md b/docs/CANBUS.md index 4089f457e453..f6485f519a2a 100644 --- a/docs/CANBUS.md +++ b/docs/CANBUS.md @@ -27,7 +27,7 @@ mode") or that run the It is also necessary to configure the host operating system to use the adapter. -If you are using a Bullseye based system using ifupdown, this +If you are using a Debian Bullseye based system using ifupdown, this is typically done by creating a new file named `/etc/network/interfaces.d/can0` with the following contents: ``` @@ -37,7 +37,7 @@ iface can0 can static up ip link set $IFACE txqueuelen 128 ``` -In newer Bookworm installations it is necessary to use systemd-networkd, +In newer Debian Bookworm installations it is necessary to use systemd-networkd, two files need to be created, one to define the interface and another to set the txqueuelen, these are: `/etc/systemd/network/80-can0.network` with the contents: