Page 1 of 1

Freematics ONE OBD not working

Posted: Thu Oct 28, 2021 4:45 am
by juliuslt
Hello. I have a Freematics ONE and Freematics ONE+ Model H. The OBD connection works perfectly fine on my one+, however, it fails to connect on the freematics one with the same car. Function obd.init() always returns False.

Here is my code, am I doing something wrong? I tried the original datalogger code, I got the OBD: FAIL on it also. By the way, I tried with specifying the protocol in init() function, and without it. Both returns false.

Code: Select all

#include <FreematicsONE.h>

COBDSPI obd;
bool connected = false;
int value;

void setup()
{
  Serial.begin(115200);

  while(!obd.begin()) Serial.println("Failed to begin");
  Serial.println("OBD init.");
  
  while (!connected) {
    Serial.print("Connecting to OBD...");
    if (obd.init(PROTO_CAN_11B_500K)) {
      Serial.println("OK");
      connected = true;
    } else {
      Serial.println("Failed to connect to OBD.");
    }
  }
}

void loop()
{
  delay(5000);
}

Re: Freematics ONE OBD not working

Posted: Thu Oct 28, 2021 10:28 am
by stanley
Could you uncomment the following line in FreematicsONE.cpp and compile again so more information will be output to serial to help find out the cause.

Code: Select all

#define DEBUG Serial