Page 1 of 1

OBD-II Emulator vs. real cars - init()

Posted: Thu Aug 19, 2021 10:55 am
by jchastine
Good evening/afternoon,
First, thank you for creating such useful devices! I'm truly looking forward to working with them.

I bought both the OBD-II emulator (v2) and connected it to the OBD-II to UART adapter. I am using a ESP32-cam board for deployment. While using the emulator, everything works perfectly. However, when I use the OBD2UART adapter with a real car (e.g. Nissan, Honda and Infiniti), the program cannot pass the init() call. I modified the COBD::begin() method to change to pins 13 and 12, but nothing else has changed. Here is the code, based on the example code provided. From reading other posts, I have checked to make sure the ESP32 is grounded to the OBD2UART adapter. Any insight would be very appreciated, and thank you.

#include <OBD2UART.h>
COBD obd;

void setup()
{
// Note: on a ESP32-cam chip, 33 is the on board LED
Serial.begin(115200);
pinMode(33, OUTPUT);
// The line below works on the emulator and cars
obd.begin();
// The line below only works on the emulator. It cannot complete this line when plugged into a car.
while (!obd.init());
}

// The code below works perfectly on the emulator
void loop()
{
int value;
if (obd.readPID(PID_RPM, value)) {
Serial.println(value);
digitalWrite(33, value > 2000 ? HIGH : LOW);
}
}

Re: OBD-II Emulator vs. real cars - init()

Posted: Fri Aug 20, 2021 1:10 am
by jchastine
As a quick follow up, I think I'm getting extraneous noise from my GPS chip on UART. In removing it altogether, init() completes. I'm not sure how those two things relate, but if I find out, I'll post with the answer.