Support ELM327 error messages#87
Support ELM327 error messages#87ffries wants to merge 13 commits intobrendan-w:masterfrom ffries:error_mngt
Conversation
…t_baud_rate() to query speed of connection.
…otocol, port name, port speed and supported commands.
|
This also sent my previous patch. |
|
Please review this patch. If you don't like it, just cancel it and ask for modifications or propose your own. |
| [b"STOPPED", "STOPPED: ELM327 reports that OBD operation was interrupted by a received RS232 character, or by a low level on the RTS pin."], | ||
| [b"UNABLE TO CONNECT", "UNABLE TO CONNECT: ELM327 tried all available protocols, and could not detect a compatible one."], | ||
| [b"ERR", "ERR: ELM327 reports an error number following."] | ||
| ] |
There was a problem hiding this comment.
Can this be turned into a dictionary for clarity?
{
b"?" : "?: ELM327 reports misundersting command received on the RS232 input.",
...
}
|
|
||
| else: | ||
| print ("Impossible to print discovered information: no connection to the ECU.") | ||
|
|
There was a problem hiding this comment.
Would you mind rebasing-out these changes? (assuming that they aren't co-dependant) That way, the two changes can cleanly come in via two PR's. Same with the addition of the get_ prefixes; Discuss that separately.
| break | ||
|
|
||
| #Check errors received by ELM327 and write debug | ||
| for iError in self._ERROR_MESSAGES: |
There was a problem hiding this comment.
minor nit-pick: in python, we typically prefer lower-case, underscore separated names. For this, simply error would suffice (especially if we used the dictionary approach I mentioned above, which iterates over keys).
| OBDCommand("ELM_VERSION" , "ELM327 version string" , b"ATI", 0, raw_string, ECU.UNKNOWN, False), | ||
| OBDCommand("ELM_VOLTAGE" , "Voltage detected by OBD-II adapter" , b"ATRV", 0, elm_voltage, ECU.UNKNOWN, False), | ||
| OBDCommand("FAKE_COMMAND_1" , "Non-existing command returning error" , b"ATXYZ", 0, raw_string, ECU.UNKNOWN, False), | ||
|
|
There was a problem hiding this comment.
Is this used for anything here besides development? I don't think python-OBD needs to be shipped with a fake command.
| # OBDCommand("VIN" , "Get Vehicle Identification Number" , b"0902", 20, raw_string, ECU.ENGINE, True), | ||
| OBDCommand("PIDS_9A" , "Supported PIDs [01-20]" , b"0900", 4, pid, ECU.ENGINE, True), | ||
| OBDCommand("VIN_MESSAGE_COUNT" , "VIN Message Count" , b"0901", 1, uas(0x01), ECU.ENGINE, True), | ||
| OBDCommand("VIN" , "Get Vehicle Identification Number" , b"0902", 20, raw_string, ECU.ENGINE, True), |
There was a problem hiding this comment.
Were you able to get VIN to work?
|
Hello Kellogs, Are you able to make the requested changes? If you aren't do you mind if I pickup the patches and get them merged? |
robert-jf-close
left a comment
There was a problem hiding this comment.
Just need to remove the test code Brendan mentioned
Dear friends,
This is a first attempt to display debug information when an error message is returned by the ELM327. Please review with care, as I am new to the project and this is a way to learn more about it.
Kind regards,
Kellogs