Probable reasons for delay in CAN bus

Hi,

I am getting the sensor (s) data from to the Xavier as follows: A dedicated microcontroller reads it from each of the sensors and dumps them to the CAN0. It does this indefinitely at 250kbps.

The transceiver between the Jetson and the controller, helps Jetson avail these values. I fetch them whenever needed. Now, I am experiencing delay of 1-2s in the sensor values. Actually, its latency, as my sensors are 1D lidars that return distance in mm. i.e., I get the measurements made 1-2s ago.

I am doubtful that there are duplicates on the CAN0. If all my CAN IDs are unique (I can confirm), is it possible that there exist two data packets with same ID (say 111 and 111) but with different data (100 and 200) ? In this case, I may be reading the previous value. If NO, what possibilities do arise ?

Do you have a CAN transceiver receiving CAN messages before your micro gets theSe CAN signals?

Hi pradan,
Can you rule out this possibility by removing frames with same id and different data and still receiving with delay?
Also, it depends on in which sequence of ids you are transferring data.
Is it possible to provide sequence of transferred frames and sequence of received frames?
Also would like to know if sequence of received frames is same as transferred but some frames are with delay and some are at exact time?

I need to look into that. But in the general case, does every microcontroller require such transceiver for dumping data to the can bus ?

I don’t know how can that be done ? When using candump can0, I get a very fast stream of data of all ids.

The ids (I know of) are 801, 802, 907,909,etc. Does this make any sense ?

You mean, I should try a loopback test with a particular sequence ?

Initially, only ids 801 and 802 were getting read. All the others were lost. I sought help here and it works now. But all the frames/ids still have a considerable delay. I need to check for individual delays.