I am using the MCP2515 CAN module to receive data from a BMS battery bank using Arduino. However, I am only receiving data with the CAN ID 70. Below is the code I am using:
for (int i = 0; i < canMsg.can_dlc; i++) { // print the data
Serial.print(canMsg.data[i], HEX);
Serial.print(" ");
}
Serial.println();
}
}
Environment:
MCP2515 Library: autowp-mcp2515
Microcontroller: Arduino
IDE: Arduino IDE
CAN Bus Bitrate: 500kbps
Oscillator Frequency: 8MHz
Observed Behavior:
I am only receiving data with the CAN ID 70. The data received looks like this:
I am using the MCP2515 CAN module to receive data from a BMS battery bank using Arduino. However, I am only receiving data with the CAN ID 70. Below is the code I am using:
include
include
struct can_frame canMsg; MCP2515 mcp2515(10);
void setup() { Serial.begin(115200);
mcp2515.reset(); mcp2515.setBitrate(CAN_500KBPS, MCP_8MHZ); mcp2515.setNormalMode();
Serial.println("------- CAN Read ----------"); Serial.println("ID DLC DATA"); }
void loop() { if (mcp2515.readMessage(&canMsg) == MCP2515::ERROR_OK) { Serial.print(canMsg.can_id, HEX); // print ID Serial.print(" "); Serial.print(canMsg.can_dlc, HEX); // print DLC Serial.print(" ");
} } Environment:
MCP2515 Library: autowp-mcp2515 Microcontroller: Arduino IDE: Arduino IDE CAN Bus Bitrate: 500kbps Oscillator Frequency: 8MHz Observed Behavior: I am only receiving data with the CAN ID 70. The data received looks like this: