Reputation: 607
I develope an android application which can read(and send) the data from OBD2 and show it in real time. My question is what the optimal frequency for reading data and sending commands to OBD? For example, when I make the initialization of OBD with four commands one after another, the init almost always fails. But sometimes it can be executed successfuly... If I make the init with 500ms delay between commands it is always OK. Now, when I send a command to OBD, how much time I suppose to wait for an answer to be sure getting it OK? Is there any way to know it or just try different delays in real time? Thanx
Upvotes: 0
Views: 1021
Reputation: 1621
Optimal frequency for sending commands depends on the OBD-II device, depends on the car you are using. So it would not make very much sense to optimize that. Just take a safe time when you are testing it and play with your hard-coded delay.
A better way to solve this, is send a command. Now wait for your response, as the OBD-II device is busy handling the command. When you receive your response, that's the trigger you will use to send your next command in your queue.
The OBD-II device handles 1 command at a time, so this would be more stable and effective method to send your data.
Upvotes: 0