ESP32 Bit Pirate home
  • CAN
  • Intermediate
  • 5 min
  • Serial CLI

Recipe · Intermediate · CAN

How to sniff CAN frames with MCP2515

CAN support uses an MCP2515 module. The first good workflow is configure, status, then passive sniff.

CAN bus connected to an MCP2515 controller module.
Configure bitrate and verify controller status before trusting captured CAN frames.

Wiring View

MCP2515 BP CSSPI CSSCKSPI CLKSISPI MOSISOSPI MISOGNDBP GND
Generated from the wiring summary: MCP2515 to BP.
Step 1

Commands

Run the typed commands first. If the command opens an interactive shell, select the named action from the shell menu instead of treating it as another CLI command.

Result

What success looks like

A visible frame means the controller and bus settings are close enough to receive data. If status shows errors, fix bitrate and wiring first.

Troubleshooting

  • Wrong bitrate.
  • No CAN transceiver or wrong module wiring.
  • Missing CAN bus termination.
  • Sniffing a silent bus and assuming the adapter failed.

Next steps

  • Use status after the bitrate and MCP2515 wiring are selected.
  • Use receive <id> to focus on one frame ID.
  • Use send <id> only on a bus you control.

CAN sniffing FAQ

What does passive CAN sniffing tell me?

Passive sniffing shows observed CAN identifiers, payload bytes and bus activity without intentionally injecting frames. It is the right first step before active send tests.

Should I use status before sniffing?

Yes. Status gives a quick baseline for controller state and error flags. If status already shows problems, fix bitrate, wiring and termination before trusting captures.

Can sniffing affect the CAN bus?

A passive receive workflow is much safer than transmitting, but a connected CAN node can still affect electrical loading and acknowledgements depending on mode and transceiver wiring. Use a lab or authorized bus.

Go deeper