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

New tools: canerrsim and canerrdump #525

Open
zeljkoavramovic opened this issue May 22, 2024 · 3 comments
Open

New tools: canerrsim and canerrdump #525

zeljkoavramovic opened this issue May 22, 2024 · 3 comments

Comments

@zeljkoavramovic
Copy link
Contributor

Developing robust CAN software is not easy when you do not have a quick way to generate all kinds of CAN errors. So I created such tool and called it canerrsim. Although candump is able to show CAN errors, I have created canerrdump which is specialized to do just that.

I would like to donate both canerrsim and canerrdump to can-utils project, but before doing that I would like to discuss them here and find out if anything needs to be changed to reach that goal (like different code formatting, or adding features like timestamp to canerrdump).

For now, you can find source code of both tools in the attachments.

canerrsim.zip
canerrdump.zip

@marckleinebudde
Copy link
Member

Hey @zeljkoavramovic,

thanks for your contribution. canerrsim looks interesting, but I think the functionality of canerrdump is already covered with candump. Compare the output of both tools:

$ candump any,0:0,#FFFFFFFF -cexdtd
 (590.634662)  vcan0  TX - -  20000025   [8]  00 40 00 00 00 00 00 00   ERRORFRAME
        tx-timeout
        controller-problem{back-to-error-active}
        no-acknowledgement-on-tx
$ ./canerrdump vcan0
CAN Sockets Error Messages Dumper
Listening CAN bus vcan0 for errors...
0x025 [8] 00 40 00 00 00 00 00 00  ERR=TxTimeout,NoAck,Ctrl(Active)

@zeljkoavramovic
Copy link
Contributor Author

zeljkoavramovic commented May 23, 2024

Hello @marckleinebudde,

I thank you for your comments and I am glad you like canerrsim. Please let me know if there are any changes needed before it's acceptance.

It's fine if canerrdump is not accepted, but please let me try to explain why I still think it should be. There are 2 main use cases for canerrdump: troubleshooting CAN errors, and as a checker tool when you develop CAN application that you want to react properly on some specific CAN errors. In both cases it is beneficial if you can hide regular messages, show all errors, or ignore some specific annoying recurring errors that are not in your current focus. This is where specialized tool like canerrdump shines. For example, using simple switches like IgnoreTxTimeout, IgnoreController and IgnoreBusError is very descriptive and does the job quickly. While it can be done with candump, you would need to browse through several documents and do some bit calculations before figuring out the proper hex mask. What do you think?

marckleinebudde pushed a commit to marckleinebudde/can-utils that referenced this issue May 23, 2024
marckleinebudde pushed a commit to marckleinebudde/can-utils that referenced this issue May 23, 2024
@marckleinebudde
Copy link
Member

I've imported the canerrsim and done some cleanups and creates PR #528 for further review.

marckleinebudde pushed a commit to marckleinebudde/can-utils that referenced this issue May 29, 2024
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

2 participants