collin80 / ESP32RET

CAN Reverse engineering tool for ESP32 based boards (specifically EVTV ESP32Due)
MIT License
197 stars 56 forks source link

Frame forwarding #20

Open collin80 opened 1 year ago

collin80 commented 1 year ago

The older GVRET firmware had the ability to forward traffic back and forth between CAN0 and CAN1. This firmware should allow for the same basic thing. But, this time it might be nice if the forwarding was optional (it's unfortunately stuck on in the GVRET firmware!)

ksmagala commented 1 year ago

Hi. For the past few days, I've been trying to programmed the operation gateway CAN. I'm using an ESP32-WROOM-32E with an additional CAN FD MCP2517FD controller on Windows 10. I attempted to rewrite the functionality directly from GVRET to ESP32RET, adding pins for ENABLE_PASS_0TO1 and 1TO0, using pins 33 and 36 on the ESP32-WROOM-32E. Sometimes, it transmitted frames from CAN1 to CAN0, but not from CAN0 to CAN1. During certain attempts to edit the code, it only managed to transmit a few frames, with a significant portion getting lost during reception. I also used CAN-HACKER for frame transmission.

Have there been any developments on your end regarding a solution to this gateway problem? Perhaps you could give me some hints. Could the issue be due to the ESP32 not having two built-in CAN ports like the Arduino Due, and the additional CAN controller MCP2517FD using SPI communication instead of being directly integrated into the processor? Thanks for your response and suggestions.

collin80 commented 1 year ago

It certainly should be able to work with your set up. SavvyCAN now has the ability to do this on the PC side. But, I'm sure it'd be a lot handier if you could do it in hardware directly on the board. A lot of people write sketches to do man in the middle where the dual setup takes in frames on one side, modifies them, and spits out modified traffic on the other side. That's almost the same idea but with modification in the loop. I will try to get passthrough added to the firmware for ESP32RET so that this sort of thing can be done directly in hardware more easily.