MCP2515 using mcp_can at 1000Kbps

Trying to capture multi-frame messages at 1000Kbps using MCP2515 but seem to miss lots of expected parts.
I am trying to discover and understand the protocol used in a Solar inverter, battery management system. I started with simple esphome project and was soon dumping frames but when trying to reassemble the multi-frame messages, I found lots were missing or out of sequence.
The can_id seems to determin whic part of the message the frame belongs to, the starting frame can_id will start 100, this should be followed by several times 101 and finally 102 to finish. The 100 message incluses the overall expected message length as well as the XOR byte used to encode strings. I seem to capture to miss lots as there are at times more 102 frames that 100 and even 101 frames.
I am using simple code with the INT pin connected and as this runs on a esp32 with no local storage, the can_id and payload are being POSTed to a local webserver. I know this is not going to be efficient but am open to other ideas for logging all frames more efficiently.

  if (CAN.begin(MCP_ANY, CAN_1000KBPS, MCP_8MHZ) != CAN_OK) {
    Serial.println("CAN init failed");
    while (true) delay(1000);
  }
  CAN.setMode(MCP_NORMAL);
  Serial.println("CAN initialized in normal mode.");
void loop() {
  if (CAN_MSGAVAIL == CAN.checkReceive()) {
    unsigned long can_id;
    byte ext;
    byte len;
    byte buf[8];

    CAN.readMsgBuf(&can_id, &ext, &len, buf);

    Serial.printf("Received CAN ID: %08lX [%d] Extended: %d\n", can_id, len, ext);
    send_can_frame_http(can_id, buf, len, ext != 0);
  }

  delay(10);
}

using @coryjfowler mcp_can library

Is this cheap little board able cope or do I need to spend some money on an alternative transceiver?

can you show an example of the serial output indicating the problems?
what baudrate is your Serial? try increasing it?

the ESP32 has a builtin Canbus interface - see Two-Wire Automotive Interface (TWAI)
just requires an external CAN transciver - see what-is-can-bus-how-to-use-can-interface-with-esp32-and-arduino
also see ESP32-TWAI-CAN library

The device that I am connecting too is outside and battery powered, the serial is not used as it is not accessible when actually connected, I do a loopback test as part of the initialization:

Connecting to WiFi....... connected!
Running loopback test...
Entering Configuration Mode Successful!
Setting Baudrate Successful!
Loopback received: ID=10014001 EXT=1 DATA=AB CD 
HTTP POST success [200]: {"can_id":"10014001","payload":"AB CD ","timestamp_us":1747822381038293}
Entering Configuration Mode Successful!
Setting Baudrate Successful!
CAN initialized in normal mode.
void setup() {
  Serial.begin(115200);
  setup_wifi();

  configTime(0, 0, "pool.ntp.org", "time.nist.gov");  // Needed for correct epoch timestamp
  delay(1000);

  if (ENABLE_LOOPBACK_TEST) {
    if (!loopback_test()) { 

      Serial.println("Loopback test failed. Halting.");
      while (true) delay(1000);
    }
  }

  if (CAN.begin(MCP_ANY, CAN_1000KBPS, MCP_8MHZ) != CAN_OK) {
    Serial.println("CAN init failed");
    while (true) delay(1000);
  }
  CAN.setMode(MCP_NORMAL);
  Serial.println("CAN initialized in normal mode.");
}

I think you need to give more details of the overall project
e.g. what is the WiFi used for?
also an example of the expected data and the actual data received?

That delay(10); is not helping you. That line is telling the microcontroller to stop doing anything for 10 milliseconds after informing you of a message which is where a lot of frames are dropping. I see no reason for it to be there, I'd suggest simply just deleting it.

The wifi is being used to POST each "message" to a local webserver as the device is otherwise remote.
I want to capture the possible messages and eventually filter only those of use.
As I said in the OP, the device is a solar inverter which is using canbus to communicate with battery storage and other power generating equipment. At the moment this is connected only to the inverter to discover what data is available.

What is the best format to output raw frames? I am reading from the DB behind the webserver.

got rid of the 10ms delay
changed sketch to publish to mqtt instead because less overhead than http/db
still seems to be missing.

Don't try to simultaneously receive CAN data and forward it at the same time.
Set the CAN acquisition going and store several seconds worth of data in a queue, then stop acquiring data and forward all the readings to MQTT or web server at your leisure.

Also, I'm surprised that you managed to get 1MB/s working using a 8MHz board. Normally a 16MHz crystal is required for reliable reception, or maybe that is part of the problem that you currently have.

I did buffered read and batch publish, ESP32 has plenty of free ram. I still miss some messages so will upgrade the crystal as I read about others who were also dropping until they simply switched out the crystal.