Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get CANBus to come up on boot with txqueuelen=1000 #12

Open
danzimmerman opened this issue Oct 12, 2024 · 5 comments
Open

Get CANBus to come up on boot with txqueuelen=1000 #12

danzimmerman opened this issue Oct 12, 2024 · 5 comments

Comments

@danzimmerman
Copy link
Owner

Currently I have a can-init function in .bash_aliases to bring up the CAN interfaces.

I'd rather that they come up on boot.

@danzimmerman
Copy link
Owner Author

systemd way:

https://askubuntu.com/a/1376096

@danzimmerman
Copy link
Owner Author

danzimmerman commented Oct 12, 2024

systemd-networkd CAN man page here.

BitRate=

Per this Reddit link TransmitQueueLength= is a thing, but in the link section. See [Link] options here.

So I think we want in /etc/systemd/network/80-can.network

[Match]
Name=can*

[CAN]
BitRate=1000K

[Link]
TransmitQueueLength=1234

We apparently also need

sudo systemctl enable systemd-networkd

Will this cause other problems (for example with NetworkManager?)

@danzimmerman
Copy link
Owner Author

This didn't quite work. They come up but the txqueuelen is not set:

3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP group default qlen 10
    link/can
4: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP group default qlen 10
    link/can

Trying the fix here that we need the CAN to match before 73 USB.

There was also a typo, we need in /etc/systemd/network/70-can.link:

[Match]
Name=can*

[Link]
TransmitQueueLength=1234

@danzimmerman danzimmerman changed the title Get CANBus to come up on boot. Get CANBus to come up on boot with txqueuelen=1000 Oct 13, 2024
@danzimmerman
Copy link
Owner Author

Changed the title to reflect the fact that it just needs a fix to the queue length problem now.

@danzimmerman
Copy link
Owner Author

If I put it in the .network file I get:

Oct 12 20:11:02 computer systemd-networkd[2209]: /etc/systemd/network/70-can.network:8: Unknown key 'TransmitQueueLength' in section [Link], ignoring.

I'm getting with sudo journalctl | grep 70-can.link:

Oct 12 20:13:11 computer systemd-udevd[332]: /etc/systemd/network/70-can.link: No valid settings found in the [Match] section, ignoring file. To match all interfaces, add OriginalName=* in the [Match] section.
Oct 12 20:13:40 computer systemd-udevd[332]: /etc/systemd/network/70-can.link:2: Unknown key 'Name' in section [Match], ignoring.

So need to dig into the man page a little more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant