@alanm,
Thanks for the clarification! Let me paste a bit of code in here and I would like you to let me know if this code should work, given the discussion above.
Filtering (for now, just include anything with an extended message format); this runs before calling canDriver.begin()
canDriver.addFilter(0, 0, CAN_FILTER_EXTENDED);
Request message construction:
CANMessage message;
message.id = 0x7DF;
message.len = 8; // message will always be 8 bytes
message.data[0] = 0x02; // 2 bytes of data in message
message.data[1] = 0x01; // Get current data
message.data[2] = 0x0C; // The PID to retrieve (Engine RPM)
message.data[3] = 0x00;
message.data[4] = 0x00;
message.data[5] = 0x00;
message.data[6] = 0x00;
message.data[7] = 0x00;
if (!canDriver.transmit(message))
{
Serial.println("Unable to transmit message!");
}
The below code runs in a loop that sleeps for just 10ms between loops:
CANMessage replyMessage;
int messageCount = canDriver.available();
if (messageCount > 0)
{
while (canDriver.receive(replyMessage))
{
// Got an extended message; light up the LED
digitalWrite(ledPin, HIGH);
}
}
So you can see that the above code is pretty forgiving and doesn't even look for a reply specifically with the ID of 0x18DAF111 (just looks for any extended message). I still can't get a reply though (i.e. blue LED doesn't light up). What am I not doing correctly?
Thanks,
Mike