Trouble connecting esp32 v1 dev board to UART Adapter V1

Discussion about software developed by Freematics, including Freematics Builder and Freematics Emulator GUI
Post Reply
fastslash25
Posts: 3
Joined: Mon Aug 26, 2019 8:07 am

Trouble connecting esp32 v1 dev board to UART Adapter V1

Post by fastslash25 »

I tried making as simple of a sketch as I could out of the rpm example sketch as seen below. I connected the green wire to GPIO3 (rx) and the white wire to GPIO1 (tx). However, the blue light on the esp32 (pin 2) never came on. I've tried another sketch with mySerial(115200) to see where the code was hanging up at. It appeared as if it couldnt get past obd.init(), and attempted to initialize once every 1min 13sec. I do know that the esp32 is getting power from the freematics adapter. But maybe not a Serial connection? I was worried the serial connections between the freematics unit and the Serial monitor overlapped so I've been trying to get feedback with just the blue light, hence the code below. Could anyone help me figure out the problem here? I'm kinda a noob at the serial stuff, maybe I can verify the wires on the freematics unit are still working with a multimeter somehow?

Code: Select all

#include <OBD2UART.h>

COBD obd;

void setup()
{
  // we'll use the debug LED as output
  pinMode(2, OUTPUT);  
  // start communication with OBD-II UART adapter
  obd.begin();
  // initiate OBD-II connection until success
  while (!obd.init());  
}

void loop()
{
  int value;
  if (obd.readPID(PID_RPM, value)) {
    // RPM is successfully read and its value stored in variable 'value'
    // light on LED when RPM exceeds 1000
    digitalWrite(2, value > 1000 ? HIGH : LOW);
  }
}
Image
stanley
Site Admin
Posts: 968
Joined: Sat Mar 01, 2014 3:15 am

Re: Trouble connecting esp32 v1 dev board to UART Adapter V1

Post by stanley »

Connect Rx and Tx to GPIO 16 and 17. You can change the pins in the library code (OBD2UART.cpp).
JVanlla
Posts: 1
Joined: Mon Feb 07, 2022 7:57 am

Re: Trouble connecting esp32 v1 dev board to UART Adapter V1

Post by JVanlla »

stanley wrote: Tue Jan 25, 2022 7:58 pm Connect Rx and Tx to GPIO 16 and 17. You can change the pins in the library code (OBD2UART.cpp).
I am in a similar situation except I am using the UART Adapter V2 and I have had no luck getting my ESP32 to connect. I have tried connecting the adapter to pins 16 and 17 and it still cannot detect it. I tried changing the ports but it kind of sends the system into shock if I change it. I have tested the adapter with an arduino nano and it works perfectly fine. Any thoughts?

I am using the obd_uart_test example code that was provided. This is the link to the ESP32: https://www.amazon.com/gp/product/B07QC ... UTF8&psc=1
stanley
Site Admin
Posts: 968
Joined: Sat Mar 01, 2014 3:15 am

Re: Trouble connecting esp32 v1 dev board to UART Adapter V1

Post by stanley »

Did you connect GND?
Post Reply