question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't load DBC file with extended frames

See original GitHub issue

After updating up to 22 version, it was lose ability to load DBC files with extended frames.

import cantools
db = cantools.db.load_file(some_extended_db)

If frame ID has high bit is on, I get assert error on such frame:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/cantools/db/__init__.py", line 67, in load_file
  File "build/bdist.linux-x86_64/egg/cantools/db/__init__.py", line 89, in load
  File "build/bdist.linux-x86_64/egg/cantools/db/__init__.py", line 123, in load_string
  File "build/bdist.linux-x86_64/egg/cantools/db/database.py", line 123, in add_dbc_string
  File "build/bdist.linux-x86_64/egg/cantools/db/formats/dbc.py", line 1139, in load_string
  File "build/bdist.linux-x86_64/egg/cantools/db/formats/dbc.py", line 702, in _load_attributes
KeyError: 3221225472

But, if I remove only high bit from frame id, the same dbc successfully loaded.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:29 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
juleqcommented, Jun 26, 2018

@JulianWgs Concerning tests: The attributes test covers this case when PR is merged, I have added such a signal attribute.

1reaction
juleqcommented, Jun 26, 2018

Hello @JulianWgs. Thanks for reporting. This bug is waiting for merge (#45) already. It happend due to a missing initialisation when the load_attributes method hit a signal attribute without having a message attribute with the same id before.

If you need a quick fix, just look at PR #45, commit 9b37564, the four lines at the very bottom.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't load DBC file with extended frames · Issue #44 - GitHub
After updating up to 22 version, it was lose ability to load DBC files with extended frames. import cantools db = cantools.db.load_file( ...
Read more >
CAN DBC File Explained - A Simple Intro [+Editor Playground]
A CAN DBC file (CAN database) is a text file that contains information for decoding raw CAN bus data to 'physical values'. To...
Read more >
TF6650 - TwinCAT 3 | DBC File Import for CAN - download
Used to distinguish between. • standard CAN frames (11-bit ID) and. • extended frames (29-bit ID). • as well as J1939PG messages. GenMsgDelayTime....
Read more >
DBC File Explained - A Simple Intro (2020) - YouTube
Your browser can't play this video. ... In particular, a DBC file describes how parameters (signals) are stored within each CAN frame.
Read more >
DBC Introduction — Open Vehicles documentation
DBC files only specify the passive (reading) part, they don't provide a means to define transmissions. If you need to send frames to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found