From ea17311f8c468737d24bb9920c2ea2fd51ad8583 Mon Sep 17 00:00:00 2001 From: Danny Date: Sun, 22 Nov 2026 11:13:08 -0800 Subject: [PATCH] StarPort: Add experimental phone services fix for 2018 Honda Fit --- .../starpilot/system/starport/head_unit_fixes.py | 11 ++++++++++- openpilot/starpilot/system/starport/session.py | 4 ++++ .../system/starport/tests/test_head_unit_fixes.py | 13 +++++++++++++ .../tests/test_head_unit_fixes_session.py | 15 +++++++++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/openpilot/starpilot/system/starport/head_unit_fixes.py b/openpilot/starpilot/system/starport/head_unit_fixes.py index cdc3a1c36d..547c19401e 100644 --- a/openpilot/starpilot/system/starport/head_unit_fixes.py +++ b/openpilot/starpilot/system/starport/head_unit_fixes.py @@ -16,7 +16,8 @@ OPEN_SENSORS = "open_sensors" # open the car-data channel (driving OPEN_VENDOR = "open_vendor" # open the car's vendor channel; nothing is sent on it REQUEST_BT_PAIRING = "request_bt_pairing" # send the Bluetooth pairing request with this comma's own address UNACKED_VIDEO = "unacked_video" # send video without waiting for acknowledgments; the car's pings show it is there -ACTIONS = (OPEN_BLUETOOTH, OPEN_PHONE_STATUS, OPEN_SENSORS, OPEN_VENDOR, REQUEST_BT_PAIRING, UNACKED_VIDEO) +OPEN_PHONE_SERVICES = "open_phone_services" # open the car-data and Bluetooth channels together, as a phone does +ACTIONS = (OPEN_BLUETOOTH, OPEN_PHONE_STATUS, OPEN_SENSORS, OPEN_VENDOR, REQUEST_BT_PAIRING, UNACKED_VIDEO, OPEN_PHONE_SERVICES) # ServiceDiscoveryResponse field numbers (JSON turns them into strings). SDR_LABELS = {"2": "car_make", "3": "car_model", "4": "car_year", "7": "head_unit_make", "8": "head_unit_model", @@ -63,6 +64,14 @@ RULES: tuple[Rule, ...] = ( ("2026-11-16 sessions 1-15",)), ladder=(UNACKED_VIDEO,), summary="This car shows a still picture for a few seconds, then reconnects, over and over."), + Rule(id="honda_fit_t5a_83_01d", label="2018 Honda Fit (83.01D.00.B.1021 build)", + match={"car_make": "Honda", "car_model": "T5A", "car_year": "2018", "head_unit_make": "HONDA/06", + "head_unit_model": "39100-T5A-L313-M1", "head_unit_software_version": "83.01D.00.B.1021"}, + transports=(WIRED,), status=EXPERIMENTAL, + evidence=Evidence("The car answers the screen request with its own screen and stays silent when the Android Auto tile is tapped.", + ("2026-11-22 sessions 1, 6-9", "2026-11-22 after-tap sessions 1, 3")), + ladder=(OPEN_PHONE_SERVICES,), + summary="This car connects but never shows the Android Auto screen."), ) diff --git a/openpilot/starpilot/system/starport/session.py b/openpilot/starpilot/system/starport/session.py index adf99e0c7b..217ec5b2e1 100644 --- a/openpilot/starpilot/system/starport/session.py +++ b/openpilot/starpilot/system/starport/session.py @@ -894,6 +894,10 @@ class ProjectionSession(Session): done = False if action == "open_bluetooth": done = self.bluetooth_channel is not None or self._open_bluetooth(pair=False) + elif action == "open_phone_services": + sensors = self.sensor_channel is not None or self._open_sensors() + bluetooth = self.bluetooth_channel is not None or self._open_bluetooth(pair=False) + done = sensors and bluetooth elif action == "open_phone_status": if self.phone_status_channel is None: self.phone_status_channel = self._open_service(PHONE_STATUS_SERVICE, "phone_status") diff --git a/openpilot/starpilot/system/starport/tests/test_head_unit_fixes.py b/openpilot/starpilot/system/starport/tests/test_head_unit_fixes.py index fafed21f0f..ecc2b0bdeb 100644 --- a/openpilot/starpilot/system/starport/tests/test_head_unit_fixes.py +++ b/openpilot/starpilot/system/starport/tests/test_head_unit_fixes.py @@ -97,6 +97,19 @@ def test_gates_block_selection(kwargs): assert pick(CFG_ON, **kwargs) is None +FIT = {"car_make": "Honda", "car_model": "T5A", "car_year": "2018", "head_unit_make": "HONDA/06", + "head_unit_model": "39100-T5A-L313-M1", "head_unit_software_version": "83.01D.00.B.1021"} +FIT_ON = {"head_unit_experiments": True, "head_unit_experiment_rules": ["honda_fit_t5a_83_01d"]} + + +def test_fit_rule_opens_phone_services_on_wired_only(): + selection = pick(FIT_ON, FIT, transport="wired", key="usb:fit") + assert selection is not None and selection.actions == (hf.OPEN_PHONE_SERVICES,) + assert pick(FIT_ON, FIT, transport="wireless") is None + assert pick(FIT_ON, {**FIT, "head_unit_software_version": "83.01E.00.B.1021"}, transport="wired", key="usb:fit") is None + assert pick({"head_unit_experiments": True}, FIT, transport="wired", key="usb:fit") is None + + def test_wired_selection_with_key(): assert pick(CFG_ON, transport="wired", key="usb:x") is not None diff --git a/openpilot/starpilot/system/starport/tests/test_head_unit_fixes_session.py b/openpilot/starpilot/system/starport/tests/test_head_unit_fixes_session.py index 98a5a3d2fe..1b6343e021 100644 --- a/openpilot/starpilot/system/starport/tests/test_head_unit_fixes_session.py +++ b/openpilot/starpilot/system/starport/tests/test_head_unit_fixes_session.py @@ -74,6 +74,21 @@ def test_ladder_adds_one_channel_per_level(identity, tmp_path): assert VENDOR_CHANNEL in hu.opened and hu.pairing_requests == [] +def test_phone_services_action_opens_sensors_and_bluetooth_without_pairing(identity, tmp_path): + hu = FakeHeadUnit(identity, bolt=True) + session = connect(hu, identity) + session.on_discovered = lambda info: (hf.OPEN_PHONE_SERVICES,) + session.authenticate() + session.start("StarPilot", "comma.ai") + pump_until(session, lambda: session.focused, timeout=8.0) + session.shutdown() + session.peer.close() + hu.thread.join(5) + assert hu.error is None, hu.error + assert sorted(hu.opened) == [1, 3, SENSOR_CHANNEL, BLUETOOTH_CHANNEL] + assert hu.sensor_requests and hu.pairing_requests == [] + + def test_pairing_request_only_at_the_last_level(identity, tmp_path): hu, _ = run(identity, tmp_path, ON, level=5) assert hu.pairing_requests == [("39:90:21:64:07:00", 2)]