Using the V2 adapter with esp8266

Inquiry and support for Arduino OBD-II Adapter
pkn
Posts: 3
Joined: Mon Dec 19, 2016 4:43 am

Using the V2 adapter with esp8266

Postby pkn » Mon Dec 19, 2016 4:57 am

Hi,
I've recently ordered and received the OBD-II UART adapter V2 and wanted to try it out today.
Unfortunately I haven't been able to get it to work with my wemos D1 mini pro (esp8266) board.

When trying the basic RPM example, the board just gets stuck in some kind of boot loop (soft WDT reset, rst cause: 2, boot mode: 3 6).
The reboot seems to be caused by .begin() or .init(), but I'm not too sure about that. Code compiles without errors, of course.

I've tried everything I could think of but now I'm out of ideas.
Do you have any advice for me? What could I possibly do wrong? Does the adapter (or the library) for some reason not work with an esp8266 board?


Regards

stanley
Site Admin
Posts: 534
Joined: Sat Mar 01, 2014 3:15 am

Re: Using the V2 adapter with esp8266

Postby stanley » Tue Dec 20, 2016 8:55 am

Did you disconnect USB cable from esp8266? It has only one usable hardware serial just like UNO.

pkn
Posts: 3
Joined: Mon Dec 19, 2016 4:43 am

Re: Using the V2 adapter with esp8266

Postby pkn » Tue Dec 20, 2016 11:26 pm

Yes, I've tried it with the USB cable unplugged, but that doesn't help either. It still reboots continuously.

stanley
Site Admin
Posts: 534
Joined: Sat Mar 01, 2014 3:15 am

Re: Using the V2 adapter with esp8266

Postby stanley » Sun Jan 08, 2017 11:22 am

Did your esp8266 board receive anything from serial?

pkn
Posts: 3
Joined: Mon Dec 19, 2016 4:43 am

Re: Using the V2 adapter with esp8266

Postby pkn » Tue Jan 10, 2017 6:23 am

Hi,

after trying around for quite some time now, I've finally got it to work and can now read the RPM values with the engine running.

In OBD2UART.h, I've commented out the following lines:

#ifndef OBDUART
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168P__)
#define OBDUART Serial
#else
#define OBDUART Serial1
#endif
#endif

and instead inserted following:
#ifndef OBDUART
#define OBDUART Serial
#endif


Although I can't be a 100% sure, I think that's what got it working finally.
I've connected an LED and an OLED display, the LED turns on when RPM is >= 1500, the display shows the RPM values. Works.

I've also discovered that the pin serial seems to be prioritized over the USB serial, so it wouldn't matter if I had the USB cable plugged in, but I haven't tested this specifically since I won't use USB to power the esp anyway. I could be wrong here.

Nevertheless, I got it working! Great stuff. Thanks for helping me out.


Return to “OBD-II Adapter for Arduino”

Who is online

Users browsing this forum: No registered users and 1 guest