-
Notifications
You must be signed in to change notification settings - Fork 126
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 . Value received for a while and then error happens. #254
Comments
@molotovec, here's what I can see happening in your log file.
Are you certain that protocol 7 (ISO 15765-4 CAN 29bit ID, 500 kbaud) is correct for your vehicle? The way the "AT TP A7" works is that if it doesn't establish a connection with protocol 7, the ELM327 starts an automatic protocol search, which takes some time to complete that needs to be accounted for. Try leaving the protocol off when calling myELM327.begin(). That will do an auto protocol search with the appropriate wait for the search. void loop() {
//float tempRPM = myELM327.rpm();
float tempVolts = myELM327.batteryVoltage();
if (myELM327.nb_rx_state == ELM_SUCCESS) {
//rpm = tempRPM;
volts=tempVolts;
} else {
Serial.println("Failed to receive data from ELM327.");
myELM327.printError();
}
//draw(rpm);
draw(volts);
if (myELM327.nb_rx_state == ELM_TIMEOUT) {
Serial.print("Reset by: ELM_TIMEOUT");
resetDraw();
}
} This is not the correct way to query in a loop. You need to account for the ELM_GETTING_MESSAGE state. See this code from the Bluetooth serial example: void loop()
{
float tempRPM = myELM327.rpm();
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();
} Lastly, batteryVoltage() is not a good query to use for testing your ELM327 connection. Unlike all the other queries, when responding to that query, the EML327 does not communicate with the vehicle ECU, it simply reads the voltage on its own power input and returns that. So it's possible to get a good response to batteryVoltage() and still not have a valid connection from your ELM device to the vehicle ECU. A better option is to use supportedPIDs_1_20() as that is guaranteed to communicate with and work on all ECUs (per the OBDII spec). |
@jimwhitelaw Thanks a lot for the reply!!! Unfortunately setting protocol is not a case. I tried auto before and it fails with timeouts so i've dig issues and found that protocol setting might fix, but is not. Timeout increase in the myELM327.begin(client, true, 2000); doesn't help. I've thinking of try to trigger ELM adapter with AT command to wake it up if it does so, but not sure of this workaround and what command is good to send (AT @1 not helped). What do u think of that? Maybe I need to send some extra AT command on adapter initialization? Please do see code below and log output:
|
The log shows that it’s searching for the protocol, but not connecting. I was going to suggest trying a different adapter, but from your screenshot, it appears to be working with Car Scanner. I don’t really know how to help at this point; the only suggestion I have is to go back to specifying the protocol in begin() with a much longer timeout. |
Hi @jimwhitelaw void loop() { if (myELM327.nb_rx_state == ELM_SUCCESS) { No timeout now as delay raised to 25sec UPDATE: in the car value is stuck with the first received. With the less delay and auto protocol it was showing up to 5 sec of updating value and then had timeout issue 13:40:31.177 -> Sending the following command/query: 010C1 How can this delay be reduced to at least 500msec between results ? Thnx in advance! |
hi with wifi device (vgate Icar 2 wifi) after 9 reading, it stop responding all ok with vgate bluetooth device i have tried with test sketch and manually sending 010C command, even with wifi sketch |
Hi @PowerBroker2 ! Thanks a lot for the library !
I have the same ERROR: ELM_TIMEOUT .
Value received for a while and then error happens.
Code below
Log below
ELM_timeout_LOG.txt
Thanks in advance!
Update: No tft (plain) wifi example also shows timeout issue (library 3.3.0, esp32C3, ELM327 v2.3 VGATE iCar Pro)
Originally posted by @molotovec in #210 (comment)
The text was updated successfully, but these errors were encountered: