From 26f972b9f738e490a73f0221b791ee76e3334fee Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 3 Feb 2025 23:05:23 -0600 Subject: [PATCH] Bump opendbc (#34525) * no debug param and new import * bump * bump to master * and fix that * oop * bump to master --- opendbc_repo | 2 +- selfdrive/car/card.py | 3 ++- selfdrive/debug/car/disable_ecu.py | 2 +- selfdrive/debug/car/ecu_addrs.py | 6 +++++- selfdrive/debug/car/fw_versions.py | 8 ++++++-- selfdrive/debug/car/vin.py | 6 +++++- selfdrive/debug/clear_dtc.py | 6 +++++- selfdrive/debug/hyundai_enable_radar_points.py | 6 +++++- selfdrive/debug/read_dtc_status.py | 6 +++++- selfdrive/debug/vw_mqb_config.py | 6 +++++- 10 files changed, 40 insertions(+), 11 deletions(-) diff --git a/opendbc_repo b/opendbc_repo index 44c977fe68..3d24af948e 160000 --- a/opendbc_repo +++ b/opendbc_repo @@ -1 +1 @@ -Subproject commit 44c977fe68f490367152b131f5e877e97fa8c96f +Subproject commit 3d24af948e24f48250d7d2cc34df44dff411a3f9 diff --git a/selfdrive/car/card.py b/selfdrive/car/card.py index 78cd19e78b..b8735359e1 100755 --- a/selfdrive/car/card.py +++ b/selfdrive/car/card.py @@ -13,8 +13,9 @@ from openpilot.common.params import Params from openpilot.common.realtime import config_realtime_process, Priority, Ratekeeper from openpilot.common.swaglog import cloudlog, ForwardingHandler -from opendbc.car import DT_CTRL, carlog, structs +from opendbc.car import DT_CTRL, structs from opendbc.car.can_definitions import CanData, CanRecvCallable, CanSendCallable +from opendbc.car.carlog import carlog from opendbc.car.fw_versions import ObdCallback from opendbc.car.car_helpers import get_car, get_radar_interface from opendbc.car.interfaces import CarInterfaceBase, RadarInterfaceBase diff --git a/selfdrive/debug/car/disable_ecu.py b/selfdrive/debug/car/disable_ecu.py index 185139324d..14d0cbb9cf 100755 --- a/selfdrive/debug/car/disable_ecu.py +++ b/selfdrive/debug/car/disable_ecu.py @@ -11,5 +11,5 @@ if __name__ == "__main__": time.sleep(1) # honda bosch radar disable - disabled = disable_ecu(*can_callbacks, bus=1, addr=0x18DAB0F1, com_cont_req=b'\x28\x83\x03', timeout=0.5, debug=False) + disabled = disable_ecu(*can_callbacks, bus=1, addr=0x18DAB0F1, com_cont_req=b'\x28\x83\x03', timeout=0.5) print(f"disabled: {disabled}") diff --git a/selfdrive/debug/car/ecu_addrs.py b/selfdrive/debug/car/ecu_addrs.py index 58781222dc..584c930ebf 100755 --- a/selfdrive/debug/car/ecu_addrs.py +++ b/selfdrive/debug/car/ecu_addrs.py @@ -2,6 +2,7 @@ import argparse import time import cereal.messaging as messaging +from opendbc.car.carlog import carlog from opendbc.car.ecu_addrs import get_all_ecu_addrs from openpilot.common.params import Params from openpilot.selfdrive.car.card import can_comm_callbacks, obd_callback @@ -15,6 +16,9 @@ if __name__ == "__main__": parser.add_argument('--timeout', type=float, default=1.0) args = parser.parse_args() + if args.debug: + carlog.setLevel('DEBUG') + logcan = messaging.sub_sock('can') sendcan = messaging.pub_sock('sendcan') can_callbacks = can_comm_callbacks(logcan, sendcan) @@ -29,7 +33,7 @@ if __name__ == "__main__": obd_callback(params)(not args.no_obd) print("Getting ECU addresses ...") - ecu_addrs = get_all_ecu_addrs(*can_callbacks, args.bus, args.timeout, debug=args.debug) + ecu_addrs = get_all_ecu_addrs(*can_callbacks, args.bus, args.timeout) print() print("Found ECUs on rx addresses:") diff --git a/selfdrive/debug/car/fw_versions.py b/selfdrive/debug/car/fw_versions.py index 18a287b38e..03d066cdcb 100755 --- a/selfdrive/debug/car/fw_versions.py +++ b/selfdrive/debug/car/fw_versions.py @@ -3,6 +3,7 @@ import time import argparse import cereal.messaging as messaging from cereal import car +from opendbc.car.carlog import carlog from opendbc.car.fw_versions import get_fw_versions, match_fw_to_car from opendbc.car.vin import get_vin from openpilot.common.params import Params @@ -18,6 +19,9 @@ if __name__ == "__main__": parser.add_argument('--brand', help='Only query addresses/with requests for this brand') args = parser.parse_args() + if args.debug: + carlog.setLevel('DEBUG') + logcan = messaging.sub_sock('can') pandaStates_sock = messaging.sub_sock('pandaStates') sendcan = messaging.pub_sock('sendcan') @@ -46,13 +50,13 @@ if __name__ == "__main__": t = time.time() print("Getting vin...") set_obd_multiplexing(True) - vin_rx_addr, vin_rx_bus, vin = get_vin(*can_callbacks, (0, 1), debug=args.debug) + vin_rx_addr, vin_rx_bus, vin = get_vin(*can_callbacks, (0, 1)) print(f'RX: {hex(vin_rx_addr)}, BUS: {vin_rx_bus}, VIN: {vin}') print(f"Getting VIN took {time.time() - t:.3f} s") print() t = time.time() - fw_vers = get_fw_versions(*can_callbacks, set_obd_multiplexing, query_brand=args.brand, extra=extra, num_pandas=num_pandas, debug=args.debug, progress=True) + fw_vers = get_fw_versions(*can_callbacks, set_obd_multiplexing, query_brand=args.brand, extra=extra, num_pandas=num_pandas, progress=True) _, candidates = match_fw_to_car(fw_vers, vin) print() diff --git a/selfdrive/debug/car/vin.py b/selfdrive/debug/car/vin.py index 7946b429e4..9b1d6528cc 100755 --- a/selfdrive/debug/car/vin.py +++ b/selfdrive/debug/car/vin.py @@ -2,6 +2,7 @@ import argparse import time import cereal.messaging as messaging +from opendbc.car.carlog import carlog from opendbc.car.vin import get_vin from openpilot.selfdrive.car.card import can_comm_callbacks @@ -13,10 +14,13 @@ if __name__ == "__main__": parser.add_argument('--retry', type=int, default=5) args = parser.parse_args() + if args.debug: + carlog.setLevel('DEBUG') + sendcan = messaging.pub_sock('sendcan') logcan = messaging.sub_sock('can') can_callbacks = can_comm_callbacks(logcan, sendcan) time.sleep(1) - vin_rx_addr, vin_rx_bus, vin = get_vin(*can_callbacks, (args.bus,), args.timeout, args.retry, debug=args.debug) + vin_rx_addr, vin_rx_bus, vin = get_vin(*can_callbacks, (args.bus,), args.timeout, args.retry) print(f'RX: {hex(vin_rx_addr)}, BUS: {vin_rx_bus}, VIN: {vin}') diff --git a/selfdrive/debug/clear_dtc.py b/selfdrive/debug/clear_dtc.py index 55e2bb47de..2c7f525d80 100755 --- a/selfdrive/debug/clear_dtc.py +++ b/selfdrive/debug/clear_dtc.py @@ -2,6 +2,7 @@ import sys import argparse from subprocess import check_output, CalledProcessError +from opendbc.car.carlog import carlog from opendbc.car.uds import UdsClient, MessageTimeoutError, SESSION_TYPE, DTC_GROUP_TYPE from panda import Panda @@ -11,6 +12,9 @@ parser.add_argument("--bus", type=int, default=0) parser.add_argument('--debug', action='store_true') args = parser.parse_args() +if args.debug: + carlog.setLevel('DEBUG') + try: check_output(["pidof", "pandad"]) print("pandad is running, please kill openpilot before running this script! (aborted)") @@ -21,7 +25,7 @@ except CalledProcessError as e: panda = Panda() panda.set_safety_mode(Panda.SAFETY_ELM327) -uds_client = UdsClient(panda, args.addr, bus=args.bus, debug=args.debug) +uds_client = UdsClient(panda, args.addr, bus=args.bus) print("extended diagnostic session ...") try: uds_client.diagnostic_session_control(SESSION_TYPE.EXTENDED_DIAGNOSTIC) diff --git a/selfdrive/debug/hyundai_enable_radar_points.py b/selfdrive/debug/hyundai_enable_radar_points.py index 298a719e86..27e6c68c0e 100755 --- a/selfdrive/debug/hyundai_enable_radar_points.py +++ b/selfdrive/debug/hyundai_enable_radar_points.py @@ -16,6 +16,7 @@ import argparse from typing import NamedTuple from subprocess import check_output, CalledProcessError +from opendbc.car.carlog import carlog from opendbc.car.uds import UdsClient, SESSION_TYPE, DATA_IDENTIFIER_TYPE from panda.python import Panda @@ -78,6 +79,9 @@ if __name__ == "__main__": parser.add_argument('--bus', type=int, default=0, help='can bus to use (default: 0)') args = parser.parse_args() + if args.debug: + carlog.setLevel('DEBUG') + try: check_output(["pidof", "pandad"]) print("pandad is running, please kill openpilot before running this script! (aborted)") @@ -93,7 +97,7 @@ if __name__ == "__main__": panda = Panda() panda.set_safety_mode(Panda.SAFETY_ELM327) - uds_client = UdsClient(panda, 0x7D0, bus=args.bus, debug=args.debug) + uds_client = UdsClient(panda, 0x7D0, bus=args.bus) print("\n[START DIAGNOSTIC SESSION]") session_type : SESSION_TYPE = 0x07 # type: ignore diff --git a/selfdrive/debug/read_dtc_status.py b/selfdrive/debug/read_dtc_status.py index 80f7ef0cd0..4ae471aefa 100755 --- a/selfdrive/debug/read_dtc_status.py +++ b/selfdrive/debug/read_dtc_status.py @@ -2,6 +2,7 @@ import sys import argparse from subprocess import check_output, CalledProcessError +from opendbc.car.carlog import carlog from opendbc.car.uds import UdsClient, SESSION_TYPE, DTC_REPORT_TYPE, DTC_STATUS_MASK_TYPE, get_dtc_num_as_str, get_dtc_status_names from panda import Panda @@ -11,6 +12,9 @@ parser.add_argument("--bus", type=int, default=0) parser.add_argument('--debug', action='store_true') args = parser.parse_args() +if args.debug: + carlog.setLevel('DEBUG') + try: check_output(["pidof", "pandad"]) print("pandad is running, please kill openpilot before running this script! (aborted)") @@ -21,7 +25,7 @@ except CalledProcessError as e: panda = Panda() panda.set_safety_mode(Panda.SAFETY_ELM327) -uds_client = UdsClient(panda, args.addr, bus=args.bus, debug=args.debug) +uds_client = UdsClient(panda, args.addr, bus=args.bus) print("extended diagnostic session ...") uds_client.diagnostic_session_control(SESSION_TYPE.EXTENDED_DIAGNOSTIC) print("read diagnostic codes ...") diff --git a/selfdrive/debug/vw_mqb_config.py b/selfdrive/debug/vw_mqb_config.py index 0cd9534d0e..69d2951941 100755 --- a/selfdrive/debug/vw_mqb_config.py +++ b/selfdrive/debug/vw_mqb_config.py @@ -3,6 +3,7 @@ import argparse import struct from enum import IntEnum +from opendbc.car.carlog import carlog from opendbc.car.uds import UdsClient, MessageTimeoutError, NegativeResponseError, SESSION_TYPE,\ DATA_IDENTIFIER_TYPE, ACCESS_TYPE from panda import Panda @@ -33,10 +34,13 @@ if __name__ == "__main__": parser.add_argument("action", choices={"show", "enable", "disable"}, help="show or modify current EPS HCA config") args = parser.parse_args() + if args.debug: + carlog.setLevel('DEBUG') + panda = Panda() panda.set_safety_mode(Panda.SAFETY_ELM327) bus = 1 if panda.has_obd() else 0 - uds_client = UdsClient(panda, MQB_EPS_CAN_ADDR, MQB_EPS_CAN_ADDR + RX_OFFSET, bus, timeout=0.2, debug=args.debug) + uds_client = UdsClient(panda, MQB_EPS_CAN_ADDR, MQB_EPS_CAN_ADDR + RX_OFFSET, bus, timeout=0.2) try: uds_client.diagnostic_session_control(SESSION_TYPE.EXTENDED_DIAGNOSTIC)