rzetterberg / elmobd

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

Check supported commands results in error #22

Closed Enrico204 closed 6 years ago

Enrico204 commented 6 years ago

Description

When issuing the command CheckSupportedCommands(), an error is returned: 'NO DATA' received, timeout from elm device?. This is the log with the debug set:

=======================================
 Ran command "ATSP0" in 20.79919ms
 Spent 69.911µs writing
 Spent 20.703157ms reading
=======================================
[2018-08-13T19:37:43.783+02:00] [OBD] Opened new device, path /dev/rfcomm0
=======================================
 Ran command "AT@1" in 21.307076ms
 Spent 672.293µs writing
 Spent 20.604472ms reading
=======================================
[2018-08-13T19:37:43.805+02:00] [OBD] Device has version: OBDII to RS232 Interpreter
=======================================
 Ran command "01001" in 354.113666ms
 Spent 175.093µs writing
 Spent 353.912592ms reading
=======================================
=======================================
 Ran command "01201" in 30.687266ms
 Spent 63.975µs writing
 Spent 30.597589ms reading
=======================================
=======================================
 Ran command "01401" in 30.944003ms
 Spent 359.893µs writing
 Spent 30.556803ms reading
=======================================
=======================================
 Ran command "01601" in 217.68309ms
 Spent 219.861µs writing
 Spent 217.437458ms reading
=======================================
[2018-08-13T19:37:44.441+02:00] [OBD] Check supported command error: 'NO DATA' received, timeout from elm device?

(rows with timestamp are added by me)

Environment

rzetterberg commented 6 years ago

@Enrico204 elmobd checks what commands that the connected car supports by sending 5 commands:

Together these commands tell you which of the 160 checked commands that are supported (Each command checks 32 commands each).

It seems that your car doesn't have the command Part4Supported ("01601") implemented, which is why you see that error message "NO DATA".

I've created a potential fix for this problem by only throwing an error when the Part1Supported command fails, while ignoring failures of the rest of the commands. This fix is in the separate branch bugfix/issue-22-check-supported-commands-results-in-error (3b56f1ccb95ba106f8e388482124217c726dbe58). Can you please pull this branch locally and see if it solves your problem? If it does, we can merge it into master.

Enrico204 commented 6 years ago

Yes, the problem is gone in that branch. Thanks! :-)