Code Monkey home page Code Monkey logo

Comments (4)

zorce avatar zorce commented on June 7, 2024

Forgot to actually say whats happening.. get some decode error:
Traceback (most recent call last):
File "proto.py", line 256, in load_configuration
db.add_dbc_file(file)
File "/home/dennis/.local/lib/python3.6/site-packages/cantools/db/database.py", line 106, in add_dbc_file
self.add_dbc(fin)
File "/home/dennis/.local/lib/python3.6/site-packages/cantools/db/database.py", line 94, in add_dbc
self.add_dbc_string(fp.read())
File "/usr/lib/python3.6/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 2452: invalid start byte

Worth mentioning is that each file works to load separately if I dont use the db.add_dbc_file() function

from cantools.

eerimoq avatar eerimoq commented on June 7, 2024

Try with the newst version of cantools: sudo pip3 install -U cantools

from cantools.

zorce avatar zorce commented on June 7, 2024

Just did and I then got some errors in the dbc file it didn't like, after removing those it seams to work ok.
The things it didn't like in the database was signals that was not connected yet so it was connected to a dummy message VECTOR__INDEPENDENT_SIG_MSG that dosen't have a size.

cantools.database.errors.Error: The signal <my_signalname> does not fit in message VECTOR__INDEPENDENT_SIG_MSG

Thank you for an awesome library!

from cantools.

eerimoq avatar eerimoq commented on June 7, 2024

You can give strict=False to load_file() to skip various checks, among the the size check. If you are lucky your original DBC-files does not have to be modified at all.

I'm glad you like the library =)

from cantools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.