-
Notifications
You must be signed in to change notification settings - Fork 417
Description
I was working on a '19 Hyundai Tucson, 2.0L, and I attempted to run the Mode 6 MONITOR_EVAP [150, 090, 040, 020, FLOW] commands. I've included my debug print out as per the documentation website request.
Hopefully this helps the development of the MODE 6 obd py library.
Debug
Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
= RESTART:
[]
True
[obd.obd] Sending command: b'063D': Purge Flow Monitor
[obd.elm327] write: b'063D\r'
[obd.elm327] read: b'7E8 10 13 46 3D 88 81 00 00 \r7E8 21 00 00 00 00 3D 88 FE \r7E8 22 00 00 00 00 00 00 00 \r\r>'
[obd.decoders] Encountered unknown Test ID
[obd.decoders] Encountered unknown Test ID
[obd.obd] Closing connection
[obd.elm327] closing port
[obd.elm327] write: b'ATZ\r'
= RESTART:
[]
True
[obd.obd] Sending command: b'063C': EVAP Monitor (0.020")
[obd.elm327] write: b'063C\r'
[obd.elm327] read: b'7E8 10 0A 46 3C 80 2F 00 00 \r7E8 21 00 00 00 00 00 00 00 \r\r>'
[obd.decoders] Encountered unknown Test ID
[obd.obd] Closing connection
[obd.elm327] closing port
[obd.elm327] write: b'ATZ\r'
= RESTART:
[]
True
[obd.obd] Sending command: b'063B': EVAP Monitor (0.040")
[obd.elm327] write: b'063B\r'
[obd.elm327] read: b'7E8 10 0A 46 3B 80 FE 00 00 \r7E8 21 00 00 00 00 00 00 00 \r\r>'
[obd.decoders] Encountered unknown Test ID
[obd.obd] Closing connection
[obd.elm327] closing port
[obd.elm327] write: b'ATZ\r'
= RESTART:
[]
True
[obd.obd] 'b'063A': EVAP Monitor (0.090")' is not supported
[obd.obd] Closing connection
[obd.elm327] closing port
[obd.elm327] write: b'ATZ\r'
= RESTART:
[]
True
[obd.obd] Sending command: b'0639': EVAP Monitor (Cap Off / 0.150")
[obd.elm327] write: b'0639\r'
[obd.elm327] read: b'7E8 10 0A 46 39 80 FE 00 00 \r7E8 21 00 00 00 00 00 00 00 \r\r>'
[obd.decoders] Encountered unknown Test ID
[obd.obd] Closing connection
[obd.elm327] closing port
[obd.elm327] write: b'ATZ\r'
Code
`
Code Scan Junior
Last Changes: Feb. 28, 2026
Code by Jonah Kondro
import obd # Imports the OBD2 Python Library
def main(): # Main Loop of the Program
# List of Mode 1 Commands as Strings
cmds_modeOne = ["PIDS_A",
"STATUS",
"FREEZE_DTC",
"FUEL_STATUS",
"ENGINE_LOAD",
"COOLANT_TEMP",
"SHORT_FUEL_TRIM_1",
"LONG_FUEL_TRIM_1",
"SHORT_FUEL_TRIM_2",
"LONG_FUEL_TRIM_2",
"FUEL_PRESSURE",
"INTAKE_PRESSURE",
"RPM",
"SPEED",
"TIMING_ADVANCE",
"INTAKE_TEMP",
"MAF",
"THROTTLE_POS",
"AIR_STATUS",
"O2_SENSORS",
"O2_B1S1",
"O2_B1S2",
"O2_B1S3",
"O2_B1S4",
"O2_B2S1",
"O2_B2S2",
"O2_B2S3",
"O2_B2S4",
"OBD_COMPLIANCE",
"O2_SENSORS_ALT",
"AUX_INPUT_STATUS",
"RUN_TIME",
"PIDS_B",
"DISTANCE_W_MIL",
"FUEL_RAIL_PRESSURE_VAC",
"FUEL_RAIL_PRESSURE_DIRECT",
"O2_S1_WR_VOLTAGE",
"O2_S2_WR_VOLTAGE",
"O2_S3_WR_VOLTAGE",
"O2_S4_WR_VOLTAGE",
"O2_S5_WR_VOLTAGE",
"O2_S6_WR_VOLTAGE",
"O2_S7_WR_VOLTAGE",
"O2_S8_WR_VOLTAGE",
"COMMANDED_EGR",
"EGR_ERROR",
"EVAPORATIVE_PURGE",
"FUEL_LEVEL",
"WARMUPS_SINCE_DTC_CLEAR",
"DISTANCE_SINCE_DTC_CLEAR",
"EVAP_VAPOR_PRESSURE",
"BAROMETRIC_PRESSURE",
"O2_S1_WR_CURRENT",
"O2_S2_WR_CURRENT",
"O2_S3_WR_CURRENT",
"O2_S4_WR_CURRENT",
"O2_S5_WR_CURRENT",
"O2_S6_WR_CURRENT",
"O2_S7_WR_CURRENT",
"O2_S8_WR_CURRENT",
"CATALYST_TEMP_B1S1",
"CATALYST_TEMP_B2S1",
"CATALYST_TEMP_B1S2",
"CATALYST_TEMP_B2S2",
"PIDS_C",
"STATUS_DRIVE_CYCLE",
"CONTROL_MODULE_VOLTAGE",
"ABSOLUTE_LOAD",
"COMMANDED_EQUIV_RATIO",
"RELATIVE_THROTTLE_POS",
"AMBIANT_AIR_TEMP",
"THROTTLE_POS_B",
"THROTTLE_POS_C",
"ACCELERATOR_POS_D",
"ACCELERATOR_POS_E",
"ACCELERATOR_POS_F",
"THROTTLE_ACTUATOR",
"RUN_TIME_MIL",
"TIME_SINCE_DTC_CLEARED",
"MAX_MAF",
"FUEL_TYPE",
"ETHANOL_PERCENT",
"EVAP_VAPOR_PRESSURE_ABS",
"EVAP_VAPOR_PRESSURE_ALT",
"SHORT_O2_TRIM_B1",
"LONG_O2_TRIM_B1",
"SHORT_O2_TRIM_B2",
"LONG_O2_TRIM_B2",
"FUEL_RAIL_PRESSURE_ABS",
"RELATIVE_ACCEL_POS",
"HYBRID_BATTERY_REMAINING",
"OIL_TEMP",
"FUEL_INJECT_TIMING",
"FUEL_RATE"
]
# MONITOR_PURGE_FLOW
vehicle = obd.OBD() # Auto Connects to Vehicle through ELM 327 cable
ports = obd.scan_serial() # return list of valid USB or RF ports
print (ports)
obd.logger.setLevel(obd.logging.DEBUG) # Prints debug info to the console
#vehicle = obd.OBD(portstr=ports[0], baudrate=38400, protocol="1", fast=False, timeout=1, check_voltage=False)
#vehicle = obd.OBD(portstr=ports[0], baudrate=38400, protocol="6", fast=False, timeout=30, check_voltage=False)
"""
Baud Rates:
9600, 38400, 19200, 57600, 115200
"""
"""
OBD2 Protocols
ID Name
1 SAE J1850 PWM
2 SAE J1850 VPW
3 AUTO, ISO 9141-2
4 ISO 14230-4 (KWP 5BAUD)
5 ISO 14230-4 (KWP FAST)
6 ISO 15765-4 (CAN 11/500)
7 ISO 15765-4 (CAN 29/500)
8 ISO 15765-4 (CAN 11/250)
9 ISO 15765-4 (CAN 29/250)
A SAE J1939 (CAN 29/250)
"""
# Checks if the connection to vehicle was made
status = vehicle.is_connected()
print(status)
"""
# Checks Coolant Temperature
temp = vehicle.query(obd.commands.COOLANT_TEMP) # Celsius
print("Engine Coolant Temp: ", temp.value)
# Checks Engine RPM
rpm = vehicle.query(obd.commands.RPM) # Celsius
print("Engine RPM: ", rpm.value)
# Retrieves all DTCs
dtcs = vehicle.query(obd.commands.GET_DTC)
print(dtcs)
vehicle.query(obd.commands.CLEAR_DTC)
"""
vehicle.query(obd.commands.MONITOR_EVAP_150)
"""
for thing in cmds_modeOne:
print("Supports: ", thing, obd.commands.has_name(thing))
"""
vehicle.close() # Ends Connection to Vehicle
main() # Runs the Main Loop or Program
`