fix: add OBD_SKIP_VOLTAGE_CHECK support for clone ELM327 adapters

Counterfeit ELM327 chips (common in cheap PL2303 USB adapters) often report
bad/zero voltage even when the OBD connection is working. python-obd's
check_voltage=True default rejects these. Add OBD_SKIP_VOLTAGE_CHECK=1 env
var to pass check_voltage=False to obd.OBD(), documented in yaris-obd.service.

Also document Phase 24.6 Yaris 2013 compatibility analysis in PLAN.md.

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
Mathieu Moran
2026-08-10 05:26:40 -04:00
co-authored by Copilot
parent 10dea22f9a
commit c03cd6d48d
3 changed files with 47 additions and 1 deletions
+6 -1
View File
@@ -186,15 +186,20 @@ def connect_obd():
return None
protocol = os.environ.get("OBD_PROTOCOL") or None
# Some counterfeit ELM327 chips report bad/zero voltage even when the
# connection is working; set OBD_SKIP_VOLTAGE_CHECK=1 if the adapter
# fails to connect and logs a voltage-related error.
check_voltage = os.environ.get("OBD_SKIP_VOLTAGE_CHECK") != "1"
selected_port = port or detected_ports[0]
print(
f"{obd_status[2]} to {selected_port}"
+ (f" using protocol {protocol}" if protocol else " using auto protocol")
+ ("" if check_voltage else " (voltage check disabled)")
+ "..."
)
try:
candidate = obd.OBD(portstr=selected_port, protocol=protocol)
candidate = obd.OBD(portstr=selected_port, protocol=protocol, check_voltage=check_voltage)
except Exception as error:
print(
f"OBD adapter detected at {selected_port}, but the ELM327 "