|
|
@ -3,6 +3,7 @@ import time |
|
|
|
import argparse |
|
|
|
import argparse |
|
|
|
import cereal.messaging as messaging |
|
|
|
import cereal.messaging as messaging |
|
|
|
from cereal import car |
|
|
|
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.fw_versions import get_fw_versions, match_fw_to_car |
|
|
|
from opendbc.car.vin import get_vin |
|
|
|
from opendbc.car.vin import get_vin |
|
|
|
from openpilot.common.params import Params |
|
|
|
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') |
|
|
|
parser.add_argument('--brand', help='Only query addresses/with requests for this brand') |
|
|
|
args = parser.parse_args() |
|
|
|
args = parser.parse_args() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if args.debug: |
|
|
|
|
|
|
|
carlog.setLevel('DEBUG') |
|
|
|
|
|
|
|
|
|
|
|
logcan = messaging.sub_sock('can') |
|
|
|
logcan = messaging.sub_sock('can') |
|
|
|
pandaStates_sock = messaging.sub_sock('pandaStates') |
|
|
|
pandaStates_sock = messaging.sub_sock('pandaStates') |
|
|
|
sendcan = messaging.pub_sock('sendcan') |
|
|
|
sendcan = messaging.pub_sock('sendcan') |
|
|
@ -46,13 +50,13 @@ if __name__ == "__main__": |
|
|
|
t = time.time() |
|
|
|
t = time.time() |
|
|
|
print("Getting vin...") |
|
|
|
print("Getting vin...") |
|
|
|
set_obd_multiplexing(True) |
|
|
|
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'RX: {hex(vin_rx_addr)}, BUS: {vin_rx_bus}, VIN: {vin}') |
|
|
|
print(f"Getting VIN took {time.time() - t:.3f} s") |
|
|
|
print(f"Getting VIN took {time.time() - t:.3f} s") |
|
|
|
print() |
|
|
|
print() |
|
|
|
|
|
|
|
|
|
|
|
t = time.time() |
|
|
|
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) |
|
|
|
_, candidates = match_fw_to_car(fw_vers, vin) |
|
|
|
|
|
|
|
|
|
|
|
print() |
|
|
|
print() |
|
|
|