diff --git a/obd/commands.py b/obd/commands.py index 0f511009..5c076b9c 100644 --- a/obd/commands.py +++ b/obd/commands.py @@ -287,15 +287,17 @@ __mode9__ = [ # name description cmd bytes decoder ECU fast - # 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), + 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), ] __misc__ = [ # name description cmd bytes decoder ECU fast 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), + ] diff --git a/obd/elm327.py b/obd/elm327.py index c469975b..de8c6a2a 100644 --- a/obd/elm327.py +++ b/obd/elm327.py @@ -101,6 +101,24 @@ class ELM327: # going to be less picky about the time required to detect it. _TRY_BAUDS = [ 38400, 9600, 230400, 115200, 57600, 19200 ] + _ERROR_MESSAGES = [ + [b"?", "?: ELM327 reports misundersting command received on the RS232 input."], + [b"ACT ALERT", "ACT ALERT: ELM327 warns no RS232 activity. Might switch to low-power standby mode."], + [b"BUFFER FULL", "BUFFER FULL: ELM327 reports that RS232 buffer is filling at a faster rate than transmission. Increase baud speed."], + [b"BUS BUSY", "BUS BUSY: ELM327 reports too much activity on BUS. Check wiring."], + [b"BUS ERROR", "BUS ERROR: ELM327 reports a BUS error. This might be normal when starting CAN listening."], + [b"CAN ERROR", "CAN ERROR: ELM327 reports a CAN system ERROR. CAN has difficulty initializing, sending or receiving."], + [b"