Open rzetterberg opened 4 years ago
ELM327 device version: result of GetVersion: "Device has version OBDII to RS232 Interpreter" ELM327 device: Revesun ELM327 USB OBD2 Car make: Hyundai Car model: Accent Car production year: 2004
Thanks for the additional info!
According to this page your car uses the ISO 9141
protocol.
If you make the following change to line 226 of device.go:
+ rawRes := dev.rawDevice.RunCommand("ATSP3")
- rawRes := dev.rawDevice.RunCommand("ATSP0")
Then your ELM327-device will use protocol 3 (ISO 9141
).
Can you reproduce the problem if you make this change only (and not the changes with added timeouts)? If you can, then we can drop the idea about the problem being related to automatic protocol handling.
Hello there, I tried ATSP3 with the RPM example, and instead of getting a "Failed to get rpm EOF" error, I get "Engine spins at 0.000000 RPMs". What was confusing me at first is that the "Engine spins at 0.000000 RPMs" message occurs when the engine is OFF (ignition on) but also when engine is ON, but is failing. This means if I run the command, I get "Engine spins at 0.000000 RPMs" and then I wait 5-6 seconds and run the command, then I get the proper rpm.
Note that the change I made for the timeout (https://github.com/rzetterberg/elmobd/pull/29/commits/0c547782d23b774bce53253b63d76f51fbd84fce#diff-ddb58cf92a33f42e2239251c44f1f93eL84) didn't change anything for ATSP3. for ATSP3 protocol, it works well with the 5 sec ReadTimeout AND with the wait delay of 5 seconds between calls.
On the bottomline, I think ATSP3 protocol seems to mute the problem - or maybe, the ATSP0 return a wrong message? (UNABLE TO CONNECT)
Description
This issue is created from the PR #29, to separate the investigation of the root cause of the problem that the PR is trying to solve.
The following code is used to build an executable:
The following steps is performed:
The expected result should have been:
Environment
Device has version OBDII to RS232 Interpreter