0

I used cantools python package to decode canbus message. I used a dbc file created by me for testing. I copied a sample file. When I use can id like 419358976, I get error. But for smaller can ids like 350, it works. Does cantools fail for extended frame ids? how do I get this working?

my code which is failing for extended id's is as follows:

db = cantools.database.load_file('.\\src\\test\\resources\\j1939.dbc')
print(db.decode_message(419358976,b'\xff\xff\xff\xc0\x0c\xff\xff\xff'))

error: cantools.database.errors.Error: Standard frame id 0x18fee900 is more than 11 bits in message EEC1.

Shehan Simen
  • 1,046
  • 1
  • 17
  • 28

1 Answers1

1

I found the answer for my question. The can id like 419358976 is an extended id. So to map that id to the id in the dbc file, I need to add another 32 bit hex number 8000 0000 to the hex can id. Then convert that result hex number to decimal and use it as the id field in the dbc file. It works perfectly after. The above error message is gone after

Shehan Simen
  • 1,046
  • 1
  • 17
  • 28