'Sending long messages on CAN FD using python-can library on vector hardware
I am trying to send a message on CAN FD which is very long (DLC=70) but have been unsuccessful. I have been successful sending shorter messages (DLC=8)
I have set up the bus as follows using the python-can package :
can.interface.Bus(bustype='vector', app_name='CANoe', channel=[0], bitrate=500000, data_bitrate=2000000, fd=True)
Everything works as long as the messages are short.
The log files from CANoe shows that nothing is being written beyond the first 8 bits. I would really appreciate any help on this matter. Do let me know if the question is clearer with more detail
These are the messages I am trying to send
msg6 = can.Message(arbitration_id=0x74A, dlc=64, data=messagedata1,
extended_id=False)
task6 = bus.send(msg6)
time.sleep(5)
msg7 = can.Message(arbitration_id=0x74A, dlc=9, data=trailingbits,
extended_id=False)
task7 = bus.send(msg7)
time.sleep(5)
Solution 1:[1]
I know this is old, but it turns out setting the fd flag in the bus configuration too let me start sending CAN FD messages. Add "fd=True" to the bus like this
busA=can.interface.Bus(bustype='socketcan',channel='vcan0',bitrate=500000, fd=True)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | DarsilRain |
