Can't load DBC file with extended frames
See original GitHub issueAfter 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:
- Created 5 years ago
- Comments:29 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@JulianWgs Concerning tests: The attributes test covers this case when PR is merged, I have added such a signal attribute.
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.