ELMduino: Getting either zero values or extremely high wrong values from every request

Hi, Im looking for some help about a little project in which im working on.

Im trying to get some data from my OBD2 ELM327 adapter, then the data will be uploaded to one server through HTTP request with a SIM800L gprs module, I can confirm that everything is working fine except the data that im receiving from the OBD, every time I do a request I get the message “Response not detected”, this cause extremely high wrong values or 0 values some times, the ELM327 is working fine, i can get the right data with the Torque App, also i was able to try the code with an ELM327 simulator on android, the code works fine with the simulator, for some reason i only have this problem when I use the real adapter.

186556733_3890263184419856_1047901450904399859_n

void loop() {

  if (myELM327.status == ELM_SUCCESS) {

    //rpm = (uint32_t)tempRPM;
    rpm = myELM327.rpm();
    consumoCombustible = myELM327.fuelRate();
    millaje = myELM327.distTravelWithMIL();
    torque = myELM327.torque();
    temperaturaTomaDeAire = myELM327.intakeAirTemp();
    temperaturaRefrigerante = myELM327.engineCoolantTemp();
    temperaturaAmbiente = myELM327.ambientAirTemp();
    temperaturaAceite = myELM327.oilTemp();
    //potencia=myELM327.rpm(); //La potencia no se puede obtener

    DEBUG_PORT.println("RPM: " + (String)rpm);
    DEBUG_PORT.println("Consumo de combustible: " + (String)consumoCombustible);
    DEBUG_PORT.println("Millaje: " + (String)millaje);
    DEBUG_PORT.println("Torque: " + (String)torque);
    DEBUG_PORT.println("TemperaturaTomaDeAire: " + (String)temperaturaTomaDeAire);
    DEBUG_PORT.println("TemperaturaRefrigerante: " + (String)temperaturaRefrigerante);
    DEBUG_PORT.println("TemperaturaAmbiente: " + (String)temperaturaAmbiente);
    DEBUG_PORT.println("TemperaturaAceite: " + (String)temperaturaAceite);
    //DEBUG_PORT.println("Potencia: "+(String)potencia);

    //Orden de las variables: RPM,Consumo de combustible,Millaje,Torque,Temperatura de la toma de aire,Temperatura del refrigerante,Temperatura ambiente,Temperatura del aceite,potencia

    //Envio con todos los datos para cuando el servidor este preparado
    //gsm_http_post("param="+(String)rpm+" "+(String)consumoCombustible+" "+(String)millaje+" "+(String)torque+" "+(String)temperaturaTomaDeAire+" "+(String)temperaturaRefrigerante+" "+(String)temperaturaAmbiente+" "+(String)temperaturaAceite+" "+(String)potencia);

    //Envio de solo dos datos para pruebas en el servidor de testing
    gsm_http_post("param=" + (String)rpm + " " + (String)consumoCombustible);

    delay(tiempoDeActualizacion);

  } else {
    DEBUG_PORT.println("El OBD2 tuvo un problema recibiendo la informacion del coche, reintentando....");
    delay(1000);
  }



}

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (10 by maintainers)

Commits related to this issue

Most upvoted comments

It looks like everything is working now, Im reading consistent values and most important, the RPM corresponds with the RPM of the Torque App

Clearing input serial buffer
Sending the following command/query: AT D
	Received char: 4
	Received char: 1
	Received char: 0
	Received char: C
	Received char: 0
	Received char: D
	Received char: 7
	Received char: B
	Received char: \r
	Received char: \r
	Received char: >
Delimiter found
All chars received: 410C0D7B
Clearing input serial buffer
Sending the following command/query: AT Z
	Received char: E
	Received char: L
	Received char: M
	Received char: 3
	Received char: 2
	Received char: 7
	Received char:  
	Received char: v
	Received char: 1
	Received char: .
	Received char: 5
	Received char: \r
	Received char: \r
	Received char: >
Delimiter found
All chars received: ELM327v15
Clearing input serial buffer
Sending the following command/query: AT E0
	Received char: A
	Received char: T
	Received char:  
	Received char: E
	Received char: 0
	Received char: \r
	Received char: O
	Received char: K
	Received char: \r
	Received char: \r
	Received char: >
Delimiter found
All chars received: ATE0OK
Clearing input serial buffer
Sending the following command/query: AT S0
	Received char: O
	Received char: K
	Received char: \r
	Received char: \r
	Received char: >
Delimiter found
All chars received: OK
Clearing input serial buffer
Sending the following command/query: AT AL
	Received char: O
	Received char: K
	Received char: \r
	Received char: \r
	Received char: >
Delimiter found
All chars received: OK
Clearing input serial buffer
Sending the following command/query: AT TP A0
	Received char: O
	Received char: K
	Received char: \r
	Received char: \r
	Received char: >
Delimiter found
All chars received: OK
Connected to ELM327
Service: 1
PID: 12
Normal length query detected
Query string: 010C
Clearing input serial buffer
Sending the following command/query: 010C
	Received char: 4
	Received char: 1
	Received char: 0
	Received char: C
	Received char: 0
	Received char: D
	Received char: 7
	Received char: 0
	Received char: 0
	Received char: 0
	Received char: 0
	Received char: 0
	Received char: \r
	Received char: \r
	Received char: >
Delimiter found
All chars received: 410C0D700000
Expected response header: 410C
Single response detected
64-bit response: 
	responseByte_0: 0
	responseByte_1: 0
	responseByte_2: 112
	responseByte_3: 13
	responseByte_4: 0
	responseByte_5: 0
	responseByte_6: 0
	responseByte_7: 0
RPM: 860
Service: 1
PID: 12
Normal length query detected
Query string: 010C
Clearing input serial buffer
Sending the following command/query: 010C
	Received char: 4
	Received char: 1
	Received char: 0
	Received char: C
	Received char: 0
	Received char: D
	Received char: 6
	Received char: 3
	Received char: 0
	Received char: 0
	Received char: 0
	Received char: 0
	Received char: \r
	Received char: \r
	Received char: >
Delimiter found
All chars received: 410C0D630000
Expected response header: 410C
Single response detected
64-bit response: 
	responseByte_0: 0
	responseByte_1: 0
	responseByte_2: 99
	responseByte_3: 13
	responseByte_4: 0
	responseByte_5: 0
	responseByte_6: 0
	responseByte_7: 0
RPM: 856

I really thank you, it looks like finally this is the solution

I assume that in this case the car does not have those sensors or the library does not support that specific request

The library supports all PIDs that have corresponding functions (i.e. the ones you’re trying to use). The “NO DATA” response is coming directly from the ELM327 and is an issue with either your car or ELM327.