Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: ELM_TIMEOUT - ELM327 v2.1 - 1 board #146

Closed
robsonsilvaandrade opened this issue Oct 27, 2022 · 6 comments
Closed

ERROR: ELM_TIMEOUT - ELM327 v2.1 - 1 board #146

robsonsilvaandrade opened this issue Oct 27, 2022 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@robsonsilvaandrade
Copy link

robsonsilvaandrade commented Oct 27, 2022

I used sample code but I get no response from OBD. When I use the ELM Terminal App on my smartphone and send 01, it returns normally. How should I proceed?

Follow Arduino Terminal debug and ELM Terminal App.

.INO CODE
//********************************************************************************************************
#include "BluetoothSerial.h"
#include "ELMduino.h"

BluetoothSerial SerialBT;
#define ELM_PORT SerialBT
#define DEBUG_PORT Serial

ELM327 myELM327;
uint32_t rpm = 0;
void setup()
{
#if LED_BUILTIN
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
#endif

DEBUG_PORT.begin(115200);
//SerialBT.setPin("1234");
ELM_PORT.begin("ArduHUD", true);
uint8_t ELM[6] = {0x00, 0x10, 0xCC, 0x4F, 0x36, 0x03};

if (!ELM_PORT.connect(ELM))
{
DEBUG_PORT.println("Couldn't connect to OBD scanner - Phase 1");
while(1);
}

if (!myELM327.begin(ELM_PORT, true, 2000))
{
Serial.println("Couldn't connect to OBD scanner - Phase 2");
while (1);
}

Serial.println("Connected to ELM327");
}

void loop()
{
float tempRPM = myELM327.rpm();
delay(100);

if (myELM327.nb_rx_state == ELM_SUCCESS)
{
rpm = (uint32_t)tempRPM;
Serial.print("RPM: "); Serial.println(rpm);
}
else if (myELM327.nb_rx_state != ELM_GETTING_MSG)
myELM327.printError();
}
//********************************************************************************************************

Screenshot_20221027-164709_ELM Terminal

ARDUINO IDE TERMINAL
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:13160
load:0x40080400,len:3036
entry 0x400805e4
Clearing input serial buffer
Sending the following command/query: AT D
Received char: A
Received char: T
Received char: _
Received char: D
Received char: \r
Received char: O
Received char: K
Received char: \r
Received char: \r
Received char: >
Delimiter found.
All chars received: ATDOK
Clearing input serial buffer
Sending the following command/query: AT Z
Received char: A
Received char: T
Received char: _
Received char: Z
Received char: \r
Received char: \r
Received char: \r
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: 2
Received char: .
Received char: 1
Received char: \r
Received char: \r
Received char: >
Delimiter found.
All chars received: ATZELM327v2.1
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 ST 00
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: 010C1
Clearing input serial buffer
Sending the following command/query: 010C1
Timeout detected with overflow of 0ms
Received:
ERROR: ELM_TIMEOUT
Service: 1
PID: 12
Normal length query detected
Query string: 010C1
Clearing input serial buffer
Sending the following command/query: 010C1
Timeout detected with overflow of 0ms
Received:
ERROR: ELM_TIMEOUT

@robsonsilvaandrade robsonsilvaandrade added the question Further information is requested label Oct 27, 2022
@PowerBroker2
Copy link
Owner

The car/ELM327 is not responding to the PID query, so the lib times-out. Try using a serial pass through to see if you can successfully do manual PID queries with the Arduino.

@robsonsilvaandrade
Copy link
Author

I followed your directions using the code indicated and got the following responses when manually submitting PIDs 010C and 0105: NO DATA

@PowerBroker2
Copy link
Owner

If you get NO DATA that means the ELM327 couldn't get the data from your car for some reason. Maybe try a different ELM327

@robsonsilvaandrade
Copy link
Author

But the same ELM327 responds normally when I use the App Terminal on the smartphone. Look:

Screenshot_20221027-164709_ELM Terminal

@robsonsilvaandrade
Copy link
Author

How should I proceed?

@jimwhitelaw
Copy link
Collaborator

I know it's late (a year later!), but for others who may encounter this issue, I have a couple comments.

  • The App Terminal example in the image above shows the "SEARCHING..." response. What's happening is that the ELM327 device is detecting the correct OBDII protocol with the vehicle's ECU (which can be a slow process) and then eventually returning with a response code.
  • In the code and output example, the program is timing out while waiting for that initial protocol detection. This timeout issue is resolved in later versions of ELMduino, so updating the lib to v 3.1.0 or later should help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants