r/arduino • u/Money_Comedian7734 • Sep 18 '26
CAN Bus injection issue (MCP2515+Arduino)
Hey all, I think my research into this problem has finally hit a wall. Hoping you guys can steer me in the right direction.
I have a setup with Arduino Leonardo -> MCP2515 to sniff/inject CAN bus frames to my car. I'm using autowp-mcp2515, autowp-arduino-canhacker libraries and software CANHacker V2 written by fuchs.
Now, the sniffing part works flawlessly, I've intercepted/decoded window motor can frames. The problem comes up when I try to inject the frame to my car to simulate window pushdown.

Once the mode changes to mcp2515.setNormalMode(); my car gets Electrical failure (central electronics failure) fault on the dash. Hence, I believe CAN bus ignores my frame that I'm trying to send. In the meantime, I still can see frames coming from my car CAN bus.
If mode mcp2515.setListenOnlyMode(); activates, then no electrical failure appears. Though, CANHacker V2 software Listen only mode doesn't work, so I've tested this with the code that I wrote myself and looking at serial monitor in Arduino IDE.
After doing a lot of research into the problem, I was a little surprised that I couldn't find anyone else experiencing the exact same issue, so I started to think that maybe something was wrong on my end. Btw, tried to inject the frame to my car with sketch I built and also with CANHacker V2 software - none of them worked.
Anyone had similar issue trying to inject the frame? Am I stuck with only sniffing? :(
FYI:
Clock is configured to 8mhz based on MCP2515;
120 ohm resistor is not shorted on MCP2515;
BMW 5-Series E61 2007
Connected to K-CAN bus with CAN baudrate 100Kbit/s (not via OBD, but CAS module)

Libs:
autowp/arduino-mcp2515
autowp/arduino-canhacker
Codes on Arduino:
https://pastebin.com/ccfhk9H7 <- arduino sketch to communicate with CANHacker V2 soft
https://pastebin.com/pmdxx20K <- arduino sketch to send the frame

