1

I am using the python-can library to send and receive CAN messages and learn more about the protocol.

I currently have a system working to transmit and receive messages, and now I want to request CAN data through remote frame messages.

I populate the address 0x480 using this CAN message:

can.Message(arbitration_id=0x480, data=[1, 0, 2, 0, 3, 0, 4, 0], is_extended_id=False)

And here is the remote frame CAN message that I transmit to try and pull the data in 0x480:

can.Message(arbitration_id=0x480, is_remote_frame=True, is_extended_id=False, dlc=8)

After I send the remote frame message I wait for a response:

msg = bus.recv()
listener.on_message_received(msg)

Here is the response I receive:

ID: 0000       S E       DLC:  4        00 01 00 00

Am I requesting the data incorrectly? I would have expected this instead:

ID: 0480       S         DLC:  7        01 00 02 00 03 00 04
mkrieger1
  • 19,194
  • 5
  • 54
  • 65
  • I think I solved the issue. My DLC parameter should have been 7 instead of 8. When I made this change I started to receive the correct data back. – PythonIsCool Jun 10 '21 at 20:16
  • 1
    The DLC of a RTR frame may or may not matter, it depends on the higher layer protocol. Some protocols demand that RTR frames must have a DLC matching the data requested. Others don't care. Obviously the DLC fills to purpose in the RTR frame itself. – Lundin Jun 11 '21 at 06:37

0 Answers0