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

generating dbc file for obd2 fails #70

Open
nandra opened this issue May 13, 2022 · 2 comments
Open

generating dbc file for obd2 fails #70

nandra opened this issue May 13, 2022 · 2 comments

Comments

@nandra
Copy link

nandra commented May 13, 2022

I'm trying to generate code for this dbc file: https://canlogger1000.csselectronics.com/files/guides/mdf-intro/OBD2-DBC-MDF4.zip (CSS-Electronics-OBD2-Extended-v1.4.dbc) but if fails first with:

go run go.einride.tech/can/cmd/cantool generate `pwd` `pwd` > out.txt
cantool: error: failed to parse DBC source file: /home/marek/CSS-Electronics-OBD2-Extended-v1.4.dbc:190:28: invalid multiplexer value (parse), try --help
exit status 1

which point to the line:

SG_ ParameterID_Service01 m1M : 23|8@0+ (1,0) [0|255] "" Vector__XXX

by replacing m1M to m1 only it seems to generate code but generation fails with go generated output and at the end:

: 4:12: expected ';', found '-', try --help
exit status 1

I really have no clue what is going on there ;). Any ideas? Thanks.

@hashemmm96
Copy link

This is due to the fact that the generator does not yet support Extended signal multiplexing.

PR #42 adds support for this feature.

Running the command you provided in after checking out PR #42 causes the error you get when replacing m1M with m1. This is due to the name of the dbc file, which contains a dot. This causes it to parse an invalid go package name CSS-Electronics-OBD2-Extended-v1.4can. By renaming the file to e.g. obd2Extended.dbc, you get a package name obd2Extendedcan which is valid, and the generation succeeds. In short:

  1. Check out Better support for multiple multiplexing switches #42
  2. Rename dbc file to obd2Extended.dbc
  3. Run cantool again

@hashemmm96
Copy link

Added this fix for the package naming #97

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