rzetterberg / elmobd

A Go library for talking to cars over OBD-II
MIT License
218 stars 37 forks source link

ELM327 cable sends different response payload that is not treated on elmobd #5

Closed AramisHM closed 6 years ago

AramisHM commented 6 years ago

While trying a cheap chinese ELM327 cable, I got: "Failed to get rpm Expected at least 3 OBD literals: SEARCHING..."

This is happens because parseOBDResponse on device.go is receiving 2 arguments, the first is "SEARCHING..." and the other are the OBD literals. So, when it calls NewResult(payload), it passes only the first argument wich, in this case, is "SEARCHING...".

This is the call sequence I got while testing in a car:

runs command to get engine RPM

I made a pull request (b6e3ddf) with a workaround that solved my problem

rzetterberg commented 6 years ago

Oi, @AramisHM! Muito obrigado! :+1:

I'll have a look at your PR and see if it works well with my device and car. Hopefully no special cases are needed for different devices.