-
Notifications
You must be signed in to change notification settings - Fork 41
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
retry attempts on "UNABLE TO CONNECT" #29
retry attempts on "UNABLE TO CONNECT" #29
Conversation
Thanks for the PR! 👍 I don't think I understand the problem you are trying to solve. Can you take me through what you are doing, step by step, and then explain what the problem is? |
Sure! 1- I plug my usb OBD-II adapter in my laptop
Now this "change" would retry the command if we get a "UNABLE TO CONNECT" error. The problem is that I don't know if this problem of retries is with my car, or with my usb adapter. But in any case, I think retrying could be a good thing (defensive coding?). Also, please note that I've changed the readtimeout. With a timeout of 5 seconds, I get an EOF error. I think my car is just too slow to answer - but I also think a lot of cars could be slow so. Thanks a lot for your feedback! |
Thanks for the explanation! Now I get it. I've been looking at the datasheet for the ELM327 IC and here's the explanation for the error you are receiving:
I also found a reference to this problem here:
When you run
So there are actually 2 commands sent to the device before you, as the user of the library, get back the device instance. What I'm wondering if your problem could be related to using automatic protocol selection, like the one quoted above or if it's related to timeouts. By default the ELM327-device uses something called "Adaptive Timing" which checks how long it takes for the vehicle to respond and then sets the timeout thereafter. "Adaptive Timing" can be used with 2 different settings or be disabled. I think we should start by looking closer at the conditions of your use case and then try to figure out what the root cause of your problem is. I have created a separate issue #30 where I've put in the information you've written so we can continue the investigation. Can you fill in the missing information and correct the assumptions I've made that are wrong? |
Description
With my obd-ii adapter (this one https://www.amazon.ca/Revesun-ELM327-Engine-MODELS-DIAGNOSTIC/dp/B00R285RU6) I get the error "UNABLE TO CONNECT" if I re-try after in succeeding one. If I wait 5 seconds, it works.
This PR does an auto-retry.
Checklist
go test
locally is successful