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

I need to add delay in between each PID request #28

Open
Jonoox opened this issue Oct 23, 2019 · 1 comment
Open

I need to add delay in between each PID request #28

Jonoox opened this issue Oct 23, 2019 · 1 comment

Comments

@Jonoox
Copy link

Jonoox commented Oct 23, 2019

Hello, I'm using MC33660 chip with 540 ohm K-line pull-up and I tried your reader_time example, modified it to support soft serial as I'm using Arduino Uno with only one HW serial.

When I have three PIDs in the loop, just like in example reader_softserial which polls 0x11, 0x0C, 0x0D, I'm only getting 0x11 and then 0x0D, without the middle one 0x0C. But if I add an delay(10) in between each PID poll, I get all of them. Looks like a timing problem, my ECU isn't ready to receive another request right after sending response to the one before. I haven't hooked up logic analyser yet. 10ms delay at each PID is not a problem for me, the response time is still much faster than on ELM327 so I'm good with that, but can I add a delay somewhere to the library so I won't have to enter it manually every time?

@iwanders
Copy link
Owner

Always happy to hear that things are working :)

I considered adding this delay, but since the specification doesn't state anything about the necessary delay between PID's I think it's very much dependent on the hardware. So I made the call not to add it. The readme states this in the timing section.

There is no delay parameter for the minimum duration between two requests, that is up to the user.

If you want to manually add it to the library, you can add it in the getPID function. But I feel that functionality should not be provided by the library as it makes the system blocking.

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

No branches or pull requests

2 participants