I’ve created a OBD2 simulator using CAN BUS shield and I’m able to see all the sensor data as programmed.
I would like to know if Can Bus shield is capable of responding to DTC’s requests from an ELM327 device.
When the request for DTC info is made, CAN Bus receives the request as 1,3,0,0,0,0,0,0. Could any please guide me on what should be response format for this request to simulate any error code.
//random values for sensors
char rndCoolantTemp=random(1,200);
char rndRPM=random(1,55);
//set the values
unsigned char CoolantTemp[7] = {4, 65, 5, rndCoolantTemp, 0, 185, 147};
unsigned char rpm[7] = {4, 65, 12, rndRPM, 224, 185, 147};
//SEND SENSOR STATUSES
if(BuildMessage==“2,1,5,0,0,0,0,0,”) {CAN.sendMsgBuf(0x7E8, 0, 7, CoolantTemp);}
if(BuildMessage==“2,1,12,0,0,0,0,0,”){CAN.sendMsgBuf(0x7E8, 0, 7, rpm);}
I’m unable to figure out what should be sent to simulate DTC when BuildMessage gets the below value
if(BuildMessage==“1,3,0,0,0,0,0,0,”)