CAN BUS off state

I am using 3 sparkfun CAN BUS shields and 3 arduino uno. Each shield connected to one arduino and the can bus shields are connected among themselves.
So when performing bus off, I am uploading the victim code and then adversary code. The result I am seeing is that The transmission error count is fluctuating between 0 and 4. So I guess there might be a synchronization problem.
I want to know how can I solve this sync problem. I am using the same laptop to upload the victim and attack code.
Any help would be highly appreciated.

how have your wired the devices ? do you have the 120ohm terminators?
what CAN library are you using?
post your code (using </> code tags) ?

Hard to tell as I cannot see what you are doing. Posting a block diagram how it is connected and termination would help. The 120 Ohm terminators should be at the physical end of the bus and none in the middle. With an ohm meter on the bus, units powered off, you should get between 50 and 70 ohms. It is possible you have a noise problem but that is a guess. Hopefully the bus is a meter or so in length, shorter will cause problems. For testing if the grounds are not connected try connecting them.

Are you trying to generate collisions by transmitting messages with the same IDs at the same time?

I'm not sure this is going to work if the attacker is using a MCP2515 as the CAN bus standard specifically waits for the bus to be idle before attempting a transmission. You'll probably need to bypass the MCP2515 and use the Arduino to monitor the bus and inject bits when it detects the start of a transmission.

If this is a student project then I suspect that your supervisor was expecting you to figure this out for yourself.

Now its working. I used the same setup. Connected the 120ohms between can high and low so that the reflection from can low doesn't occurs.
The TEC error is increasing up to 250-254 and coming back to 0 and again increasing up to between 250-254. So its working. I just increased the frequency of the fabricated message by the attacker so that the two messages gets synced and arbitration occurs.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.