Skip to content

add FD support to slcan according to CANable 2.0 impementation #1920

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ssj71
Copy link

@ssj71 ssj71 commented Feb 18, 2025

The canable 2.0 project has extended the slcan interface to add support for CAN-FD frames and bitrate switching (see https://github.com/normaldotcom/canable2-fw). I needed this support for my work so I've implemented it in the library. If this work is useable I'd love to have it merged in. Happy to make tweaks or whatever, just need some direction.

Thank you for maintaining this project. It's immensely useful.

@ssj71
Copy link
Author

ssj71 commented Feb 18, 2025

fixed the black and ruff failings.

@CallmeLins
Copy link

Hi Bro, I have modify the code as your commit, send message is ok, but seems can not received message (windows platform), do you have this issue?

@Nakakiyo092
Copy link

Hello,

Thank you for submitting this pull request.
This update will be very useful for me.

However, I noticed an issue regarding compatibility with classical devices that do not support CAN FD.
In the latest release, a device can be initialized as follows:

bus = can.interface.Bus(interface="slcan", channel="COM9", bitrate=500000)

When using your branch, the initialization fails with the following exception:

Invalid data bitrate, choose one of 2000000, 5000000.

In my opinion, the initialization should still work to support classical slcan devices.

By the way, I tested the CAN FD capability with a 500k/2Mbps bus.
I had any issue with sending/receiving on a Windows PC.

Thank you.

@ssj71
Copy link
Author

ssj71 commented Mar 24, 2025

When using your branch, the initialization fails

I agree my changes should not have that effect. I will update and check that useage.

@ssj71
Copy link
Author

ssj71 commented Mar 24, 2025

Hi Bro, I have modify the code as your commit, send message is ok, but seems can not received message (windows platform), do you have this issue?

I send and receive without issue. I have found that ListenOnly mode doesn't work properly. I believe it is a canable firmware issue.

@ssj71
Copy link
Author

ssj71 commented Apr 22, 2025

Apologies for the delays. That fix is in to allow non-FD rates again and I believe this to be ready to merge.

@Nakakiyo092
Copy link

Apologies for the delays. That fix is in to allow non-FD rates again and I believe this to be ready to merge.

I confirmed that my issue has been resolved. Thank you for the update.

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

Successfully merging this pull request may close these issues.

3 participants