Several users have brought up the discussions about sending custom CAN messages with Freematics ONE+. Well, this has always been possible but we just didn’t include API for doing this in the OBD library due to security concern as ONE+ could be internet connected. With EV uprising, sending custom CAN messages seems to be the only way to extract data from these vehicles though proprietary information is needed to make the data meaningful. We have now added simple APIs for sending CAN messages to ECU in a move to open up more possibilities and leave the hard job to the community. Following is an example of send a CAN message for clearing DTC.

  // send a CAN message (clearing DTC)
  obd.setCANID(0x7E0);
  obd.setHeaderMask(0xFFFFFF);
  obd.setHeaderFilter(0x7E8);
  byte msg[] = {0x14, 0xFF, 0x00};
  char buf[128];
  if (obd.sendCANMessage(msg, sizeof(msg), buf, sizeof(buf))) {
    // print the ECU response to the message
    Serial.println(buf);
  }