From 133d754b779c8b2b353ba7badb5203b2a45f9d44 Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 6 Oct 2026 15:44:21 -0700 Subject: [PATCH] Dont Write if Not Needed, FAQ v2, Wonky Words. (cherry picked from commit 423bbf6a36c0146a281c9366b4fc55155a7b334d) --- .../honda/tests/test_bosch_longitudinal.py | 7 +++++ openpilot/starpilot/car/honda/longitudinal.py | 10 ++++-- .../starpilot/galaxy/web/js/android-auto.js | 31 ++++++++++++------- .../system/android_auto/supervisor.py | 25 +++++++++------ 4 files changed, 50 insertions(+), 23 deletions(-) diff --git a/opendbc_repo/opendbc/car/honda/tests/test_bosch_longitudinal.py b/opendbc_repo/opendbc/car/honda/tests/test_bosch_longitudinal.py index 7ed2cd70e2..53c419bafe 100644 --- a/opendbc_repo/opendbc/car/honda/tests/test_bosch_longitudinal.py +++ b/opendbc_repo/opendbc/car/honda/tests/test_bosch_longitudinal.py @@ -120,3 +120,10 @@ def test_actual_configure_loads_typed_factors_without_startup_rewrite(): time.sleep(0.01) assert saved.get("HondaGasFactorParams") == pytest.approx(1.1) assert saved.get("HondaWindFactorParams") == pytest.approx(0.9) + writes = [] + learning.params = SimpleNamespace(put=lambda *args: writes.append(args)) + learning.persist(12000) + assert writes == [] + learning.owner.set_factors(1.2, 0.9) + learning.persist(18000) + assert writes == [("HondaGasFactorParams", 1.2), ("HondaWindFactorParams", 0.9)] diff --git a/openpilot/starpilot/car/honda/longitudinal.py b/openpilot/starpilot/car/honda/longitudinal.py index 0f0b24bf8f..5af52a6ba5 100644 --- a/openpilot/starpilot/car/honda/longitudinal.py +++ b/openpilot/starpilot/car/honda/longitudinal.py @@ -15,8 +15,14 @@ class BoschLearningParams: value = 1.0 factors.append(value) owner.set_factors(*factors) + self.saved = (owner.bosch_gas_factor, owner.bosch_wind_factor) def persist(self, frame): if frame > 0 and frame % 6000 == 0: - self.params.put("HondaGasFactorParams", self.owner.bosch_gas_factor) - self.params.put("HondaWindFactorParams", self.owner.bosch_wind_factor) + # Learning only moves while openpilot drives the pedals; skip rewriting unchanged values. + factors = (self.owner.bosch_gas_factor, self.owner.bosch_wind_factor) + if factors == self.saved: + return + self.params.put("HondaGasFactorParams", factors[0]) + self.params.put("HondaWindFactorParams", factors[1]) + self.saved = factors diff --git a/openpilot/starpilot/galaxy/web/js/android-auto.js b/openpilot/starpilot/galaxy/web/js/android-auto.js index b5c9a233c9..304b9a64b9 100644 --- a/openpilot/starpilot/galaxy/web/js/android-auto.js +++ b/openpilot/starpilot/galaxy/web/js/android-auto.js @@ -710,30 +710,37 @@ export const AndroidAutoPage = {
It won’t connect automatically when other phones are paired to my car -

When you start the car, it reconnects to the phones it knows, usually starting with its favorite or the one used most recently. Android Auto only runs on one device at a time, so whichever device gets there first usually wins. If that’s a phone, the comma has to wait.

-

The comma doesn’t give up. It keeps asking about every 30 seconds while you drive, so it takes over within about half a minute once the screen is free.

-

To make the car pick the comma:

+

When you start the car, it reconnects to the phones it knows, usually starting with its favorite or the one used most recently. Most cars run Android Auto on only one device at a time, so whichever device gets there first usually wins. If that’s a phone, the comma may have to wait.

+

The comma keeps asking about every 30 seconds while you drive, so it can usually take over within about half a minute once the screen is free.

+

Things that may help the car pick the comma:

  1. Make the comma the car’s preferred device. Many cars have a setting for this in the phone or Bluetooth menu, called something like “Preferred device,” “Priority phone,” or “Primary device.”
  2. Turn off wireless Android Auto on the phones. On each phone paired to the car, including other drivers’ phones, open Settings → Android Auto and turn off wireless Android Auto for this car, or remove the car from its list of connected cars.
  3. Make room for the comma. Some cars only keep two phones connected at once. If two are already connected, there may be no room left for the comma. Turn off Bluetooth on one phone, or delete old phones the car no longer needs.
  4. -
  5. Using a wireless adapter? The adapter chooses which phone to use, not the car. Remove the adapter from your phone’s Bluetooth list, or set the comma as the main device in the adapter’s app.
  6. +
  7. Using a wireless adapter? Usually the adapter chooses which phone to use, not the car. Try removing the adapter from your phone’s Bluetooth list, or setting the comma as the main device in the adapter’s app.
-

Your phone can stay paired over regular Bluetooth, so calls and music keep working.

+

Your phone may be able to stay connected for music. See “Can I still take calls and play music from my phone?” below.

Can I still take calls and play music from my phone? -

Yes. The comma never handles calls or audio. Keep your phone connected to the car over regular Bluetooth like you always do. The car’s screen shows StarPilot, and your phone keeps doing calls and music. Most cars allow two phones to be connected at once, so the comma and your phone can both be connected.

+

It depends on your car. The comma never handles calls or audio itself, but to show StarPilot it connects to the car as a phone.

+

Some cars treat the phone and Android Auto as one device. In those cars, choosing your real phone as the car’s phone can move Android Auto to that phone and disconnect the comma. Other cars may let both stay connected.

+

If the comma disconnects when your phone connects, try this:

+ +

The comma can’t pass calls through to your phone yet.

Will this work with my car? -

It works with cars that have wireless Android Auto built in. If your car only has wired Android Auto through a USB cable, add a wireless adapter (AAWireless, Motorola MA1, Carlinkit, and similar). A direct USB cable from the comma isn’t supported yet.

+

It’s made for cars that have wireless Android Auto built in, though not every car has been tested. If your car only has wired Android Auto through a USB cable, a wireless adapter (AAWireless, Motorola MA1, Carlinkit, and similar) may work. A direct USB cable from the comma isn’t supported yet.

Every car brand does things a little differently. If yours gives you trouble, a log from your car helps get it fixed. You can download one from Connection Logs at the bottom of this page.

@@ -750,10 +757,10 @@ export const AndroidAutoPage = {

If it happens often, a phone may be taking the screen back. See “It won’t connect automatically when other phones are paired” above. If it keeps happening, download your Connection Logs at the bottom of this page so it can be looked at.

Does it start by itself, or do I tap Connect every time? -

With Automatic Connection turned on, it connects every time you start driving. You don’t need to open this page.

+

With Automatic Connection turned on, it tries to connect each time you start driving, so you usually don’t need to open this page.

Why are some buttons grayed out? diff --git a/openpilot/starpilot/system/android_auto/supervisor.py b/openpilot/starpilot/system/android_auto/supervisor.py index 5355187f71..1a9348a22d 100644 --- a/openpilot/starpilot/system/android_auto/supervisor.py +++ b/openpilot/starpilot/system/android_auto/supervisor.py @@ -1096,21 +1096,23 @@ class Supervisor: bg_color = (10, 10, 22, 255) # Cosmic void #0a0a16 canvas = Image.new("RGBA", (request.width, request.height), bg_color) + # Text is drawn at 4x and shrunk: at car-screen sizes Sora's round letters (S, a, o) dip about half a + # pixel below the baseline, which renders as a 1 px step and makes the bottoms look crooked. + supersample = 4 font_size = max(18, min(64, int(request.height * 0.06))) try: - font = ImageFont.truetype(str(brand_font_path), font_size) + font = ImageFont.truetype(str(brand_font_path), font_size * supersample) font.set_variation_by_axes([800]) except Exception: font = None try: - font = font or (ImageFont.truetype(str(fallback_font_path), font_size) if fallback_font_path.exists() else ImageFont.load_default()) + font = font or ImageFont.truetype(str(fallback_font_path), font_size * supersample) except Exception: - font = ImageFont.load_default() + font, supersample = ImageFont.load_default(), 1 - draw = ImageDraw.Draw(canvas) - bbox = draw.textbbox((0, 0), text, font=font) - text_w = bbox[2] - bbox[0] - text_h = bbox[3] - bbox[1] + bbox = font.getbbox(text) + text_w = -(-(bbox[2] - bbox[0]) // supersample) + text_h = -(-(bbox[3] - bbox[1]) // supersample) gap = max(12, int(request.height * 0.04)) target_logo_h = int(min(request.height * 0.42, request.width * 0.35)) @@ -1128,8 +1130,13 @@ class Supervisor: text_y = (request.height - text_h) // 2 text_x = (request.width - text_w) // 2 - draw.text((text_x + 1, text_y + 1), text, font=font, fill=(30, 20, 50, 180)) - draw.text((text_x, text_y), text, font=font, fill=(250, 248, 255, 255)) + layer = Image.new("RGBA", ((text_w + 1) * supersample, (text_h + 1) * supersample), (0, 0, 0, 0)) + draw = ImageDraw.Draw(layer) + origin = (-bbox[0], -bbox[1]) + draw.text((origin[0] + supersample, origin[1] + supersample), text, font=font, fill=(30, 20, 50, 180)) # 1 px shadow + draw.text(origin, text, font=font, fill=(250, 248, 255, 255)) + layer = layer.resize((text_w + 1, text_h + 1), Image.Resampling.LANCZOS) + canvas.alpha_composite(layer, (int(text_x), int(text_y))) return canvas.tobytes() except Exception: try: