Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
label: Project version
description: The release you installed, or the commit you built. From 0.13.0-rc.10, the title of the Help page
in the Android Auto menu shows it.
placeholder: 0.13.0-rc.16
placeholder: 0.13.0-rc.17
validations:
required: true
- type: input
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> [!IMPORTANT]
> This is a translation of the authoritative [French changelog](CHANGELOG.md), based on
> [`v0.13.0-rc.16`](https://github.com/Jiraiya43/EntryNav2-Android-Auto/blob/v0.13.0-rc.16/CHANGELOG.md).
> [`v0.13.0-rc.17`](https://github.com/Jiraiya43/EntryNav2-Android-Auto/blob/v0.13.0-rc.17/CHANGELOG.md).
> It may become outdated; consult the French changelog for the source of truth.

All notable changes to this project. Format inspired by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
Expand All @@ -13,6 +13,15 @@ QEMU with the car's libraries).

## [Unreleased]

## [0.13.0-rc.17] - 2026-12-03 · PC

Release candidate: a *Use the phone's GPS* box in the Android Auto menu, for a car whose position drifts
at a stop. Installs from a USB stick since 0.13.0-rc.10. Tested on PC and under QEMU.

### Added

- Android Auto menu: a *Use the phone's GPS* box, next to *Keep logs*. Ticked, the service no longer offers the car's position to the phone, which keeps its own GPS; the `gps-telephone` file already did this, but it had to be created over SSH. On an M2 F87 the car's position drifted at every stop in Android Auto, and the phone's GPS removed the drift ([#265](https://github.com/Jiraiya43/EntryNav2-Android-Auto/issues/265)). The service reads the choice when it starts: changed while Android Auto runs, it stops Android Auto and starts it again, as the USB cable box does. Tested on PC.

## [0.13.0-rc.16] - 2026-12-02 · PC

Release candidate: on software 202402191339, the iDrive hidden under Android Auto no longer reacts to
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ QEMU avec les bibliothèques de la voiture).
- USB : une erreur temporaire lors de la première requête au téléphone ne le fait plus abandonner immédiatement ;
le service réessaie jusqu'à trois fois. Testé sur PC.

## [0.13.0-rc.17] - 2026-12-03 · PC

Version candidate : case *Utiliser le GPS du téléphone* dans le menu Android Auto, pour une voiture dont
la position dérive à l'arrêt. S'installe par clé USB depuis la 0.13.0-rc.10. Testée sur PC et sous QEMU.

### Ajouté

- Menu Android Auto : case *Utiliser le GPS du téléphone*, à côté de *Garder les journaux*. Cochée, le service ne propose plus la position de la voiture au téléphone, qui garde son propre GPS ; c'est ce que faisait déjà le fichier `gps-telephone`, qu'il fallait créer par SSH. Sur une M2 F87, la position de la voiture dérivait à chaque arrêt dans Android Auto, et le GPS du téléphone l'a supprimée ([#265](https://github.com/Jiraiya43/EntryNav2-Android-Auto/issues/265)). Le service lit ce choix à son démarrage : changé pendant qu'Android Auto tourne, il l'arrête puis le relance, comme la case du câble USB. Testé sur PC.

## [0.13.0-rc.16] - 2026-12-02 · PC

Version candidate : sur le logiciel 202402191339, l'iDrive caché sous Android Auto ne réagit plus aux
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.0-rc.16
0.13.0-rc.17
2 changes: 1 addition & 1 deletion docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Le protocole Android Auto côté voiture, sans rien de propre à BMW.
| `entry_aa_app.cpp` | L'appli elle-même : création, menu, bouton d'entrée, relevé d'état chaque seconde |
| `bmw_framework` | Déclarations de l'interface BMW des applis, accroches de la table virtuelle |
| `hold_machine` | Quand demander la page vide de l'iDrive sous Android Auto (classe pure, testée sur PC) |
| `pending_restart.hpp` | Redémarrage d'Android Auto quand la case du câble USB change en marche (testé sur PC) |
| `pending_restart.hpp` | Redémarrage d'Android Auto quand la case du câble USB ou du GPS du téléphone change en marche (testé sur PC) |
| `service_link` | Lancement du superviseur, commandes au service, arrêt, copie des journaux et mise à jour par clé USB |
| `update_flow.hpp` | Ligne *Mettre à jour par clé USB* : vérification au premier appui, installation au second, arrêt d'Android Auto avant (et relance, une fois arrêté, si rien n'a été installé), textes affichés (classe pure, testée sur PC) |
| `car_signals` | Marche arrière, appels, jour et nuit, mode de conduite, lus dans l'iDrive |
Expand Down
7 changes: 5 additions & 2 deletions docs/INSTALLATION.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ the one in its archive (in 0.10.0, the supervisor is called `evo-trial`, not `aa
From the PC, in the archive's folder:

```sh
scp entrynav2-android-auto-0.13.0-rc.16-armhf.tar root@169.254.1.0:/tmp/
scp entrynav2-android-auto-0.13.0-rc.17-armhf.tar root@169.254.1.0:/tmp/
ssh root@169.254.1.0
```

Expand All @@ -50,7 +50,7 @@ flash memory yet.
Nothing is changed during this step.

```sh
V=0.13.0-rc.16
V=0.13.0-rc.17
cd /tmp && rm -rf entrynav2-android-auto-$V && tar -xf entrynav2-android-auto-$V-armhf.tar && cd entrynav2-android-auto-$V
md5sum -c MD5SUMS
head -n 1 /etc/version
Expand Down Expand Up @@ -139,6 +139,9 @@ itself. The menu's *Start automatically* box starts Android Auto with iDrive.
Android Auto can also use a USB cable: tick *USB cable instead of wireless* in the same menu, see [USB](USB.md) (in
French).

If the position moves by itself in Android Auto while the car is stopped, tick *Use the phone's GPS*: the phone then
keeps its own GPS instead of the car's.

## Updating

### From a USB stick, without a PC
Expand Down
7 changes: 5 additions & 2 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ancienne, suivre celle de l'archive (dans la 0.10.0, le superviseur s'appelle `e
Depuis le PC, dans le dossier de l'archive :

```sh
scp entrynav2-android-auto-0.13.0-rc.16-armhf.tar root@169.254.1.0:/tmp/
scp entrynav2-android-auto-0.13.0-rc.17-armhf.tar root@169.254.1.0:/tmp/
ssh root@169.254.1.0
```

Expand All @@ -45,7 +45,7 @@ encore écrit sur la mémoire flash.
Rien n'est modifié pendant cette étape.

```sh
V=0.13.0-rc.16
V=0.13.0-rc.17
cd /tmp && rm -rf entrynav2-android-auto-$V && tar -xf entrynav2-android-auto-$V-armhf.tar && cd entrynav2-android-auto-$V
md5sum -c MD5SUMS
head -n 1 /etc/version
Expand Down Expand Up @@ -135,6 +135,9 @@ voiture tout seul. La case *Démarrage automatique* du menu lance Android Auto a
Android Auto peut aussi passer par un câble USB : cocher *Câble USB au lieu du sans-fil* dans le même menu, voir
[USB](USB.md).

Si la position bouge toute seule dans Android Auto quand la voiture est arrêtée, cocher *Utiliser le GPS du téléphone* :
le téléphone garde alors son propre GPS au lieu de celui de la voiture.

## Mettre à jour

### Par clé USB, sans PC
Expand Down
2 changes: 1 addition & 1 deletion docs/MAINTENANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Le service ne lit aucun réglage dans son environnement : ses valeurs sont fixes
| `kombi-off` | Présent : rien n'est envoyé au compteur ni à la tête haute (Ethernet des Série G ou MOST des Série F) |
| `kombi-most-layout` | Écrit par le service sur une Série F au compteur MOST : l'adresse du compteur et les champs que la navigation BMW y utilise, appris pendant un guidage ([compatibilité](COMPATIBILITE.md#flèches-sur-le-compteur-des-série-f)). Supprimé, il est appris de nouveau au prochain guidage BMW ; abîmé, il est ignoré puis réécrit |
| `kombi-single-maneuver` | Présent au démarrage : graphe limité à la prochaine manœuvre, pour un compteur qui refuse le trajet complet (voir ci-dessous). Sans ce fichier : graphe historique |
| `gps-telephone` | Présent : le téléphone garde son propre GPS, celui de la voiture n'est pas transmis |
| `gps-telephone` | Présent : le téléphone garde son propre GPS, celui de la voiture n'est pas transmis (case *Utiliser le GPS du téléphone* du menu) |
| `maintenance` | Présent : l'appli et le service gardent leurs journaux (case *Garder les journaux* du menu, voir [Journaux](#journaux)) |
| `update-report.txt` | Écrit par la mise à jour par clé USB ([installation](INSTALLATION.md#par-clé-usb-sans-pc)) : ce que sa dernière vérification ou installation a trouvé et fait. Copié avec les journaux |
| `update-pending` | Présent pendant les quelques secondes où une mise à jour par clé USB met ses fichiers en place, ou après une coupure à ce moment-là : la mise à jour suivante le lit pour terminer. Ne pas y toucher, sauf après une réinstallation par SSH, qui le rend inutile |
Expand Down
6 changes: 6 additions & 0 deletions hmiapp/EntryAad.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<raAction id="27"/>
<raAction id="28"/>
<raAction id="29"/>
<raAction id="30"/>
<hmiAction id="25" target="12"/>
</actions>
<models>
Expand All @@ -39,6 +40,10 @@
<synonyms/>
</textIdModel>
<raBoolModel id="33"/>
<raBoolModel id="44"/>
<textIdModel id="45" textId="19">
<synonyms/>
</textIdModel>
<textIdModel id="41" textId="18">
<synonyms/>
</textIdModel>
Expand Down Expand Up @@ -91,6 +96,7 @@
<separator id="66"/>
<checkbox action="24" id="64" model="34" text="Demarrage automatique" textModel="35"/>
<checkbox action="26" id="68" model="38" text="Cable USB au lieu du sans-fil" textModel="39"/>
<checkbox action="30" id="72" model="44" text="Utiliser le GPS du telephone" textModel="45"/>
<checkbox action="27" id="69" model="33" text="Garder les journaux" textModel="41"/>
<button action="28" id="63" model="42" text="Copier les journaux sur cle USB"/>
<button action="29" id="60" model="43" text="Mettre a jour par cle USB"/>
Expand Down
19 changes: 17 additions & 2 deletions hmiapp/app_guards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,15 @@ bool autostartOn() {
return fileExists(contract::kAutostart);
}

// One of the menu's checkboxes changed: what it was, and what its file says now.
static void logToggle(const char* name, bool before, bool after) {
alog("menu: %s %s -> %s", name, before ? "on" : "off", after ? "on" : "off");
}

void toggleAutostart() {
bool on = autostartOn();
setSwitch("autostart", contract::kAutostart, !on, "1\n");
alog("menu: start automatically %s -> %s", on ? "on" : "off", autostartOn() ? "on" : "off");
logToggle("start automatically", on, autostartOn());
}

bool usbCableOn() {
Expand All @@ -194,7 +199,17 @@ bool usbCableOn() {
void toggleUsbCable() {
bool on = usbCableOn();
setSwitch("USB cable", contract::kUsb, !on, ""); // empty: every USB port, as `touch` leaves it
alog("menu: USB cable %s -> %s", on ? "on" : "off", usbCableOn() ? "on" : "off");
logToggle("USB cable", on, usbCableOn());
}

bool phoneGpsOn() {
return fileExists(contract::kPhoneGps);
}

void togglePhoneGps() {
const bool on = phoneGpsOn();
setSwitch("phone's GPS", contract::kPhoneGps, !on, ""); // empty, as `touch` leaves it
logToggle("phone's GPS", on, phoneGpsOn());
}

bool keepLogsOn() {
Expand Down
5 changes: 5 additions & 0 deletions hmiapp/app_guards.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// 2 minutes with it.
// autostart present: Android Auto starts by itself 30 s after iDrive
// usb present: Android Auto over a USB cable instead of wireless (docs/USB.md)
// gps-telephone present: the phone keeps its own GPS, the car's position is not offered to it (platform/evo_gps.hpp)
// bootguard the automatic starts of the last 15 minutes not followed by 15 s of running (or of this start of the
// unit); at 3, the automatic start is skipped (Start in the menu still works). Removed by a manual
// start and once the HMI has been up 2 minutes.
Expand All @@ -35,6 +36,10 @@ void toggleAutostart(); // the menu's checkbox
// port name someone may have written in it by hand.
bool usbCableOn();
void toggleUsbCable();
// "Use the phone's GPS": for a car whose position wanders when it stops (#265). The service reads it at its start,
// like the link.
bool phoneGpsOn();
void togglePhoneGps();
// The "keep logs" box: the maintenance profile's file (log_profile.hpp). The app's log follows at once, the
// service's from its next start. Unticking keeps the logs already written, for a copy to a USB stick.
bool keepLogsOn();
Expand Down
62 changes: 45 additions & 17 deletions hmiapp/entry_aa_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// service_link the supervisor /opt/aa/aa-supervisor, control messages, the service's state, the stop sequence
// car_signals gear, phone calls, day/night and driving mode from the car's CDS
// hold_machine iDrive kept on the blank state while Android Auto is on screen (pure, tested on the PC)
// pending_restart the restart the USB checkbox asks for while Android Auto runs (pure, tested on the PC)
// pending_restart the restart the USB cable or phone's GPS checkbox asks for while Android Auto runs (pure, tested)
// The menu also keeps the logs (maintenance profile), copies them onto a USB stick (platform/log_copy.hpp) and updates
// Android Auto from one (update_flow.hpp, platform/update_install.hpp).
// Uninstall: delete the plugin folder and reboot.
Expand Down Expand Up @@ -202,10 +202,11 @@ bool g_settingsShown = false;
void showSettings(bmw::PluginApp* app) {
app->updateModel(kAutostartModel, autostartOn());
app->updateModel(kUsbCableModel, usbCableOn());
app->updateModel(kPhoneGpsModel, phoneGpsOn());
app->updateModel(kKeepLogsModel, keepLogsOn());
g_settingsShown = true;
}
PendingRestart g_restart; // the USB checkbox changed while Android Auto ran
PendingRestart g_restart; // a checkbox the service reads at its start (USB cable, phone's GPS) changed while it ran
// "Update from USB stick" (hmiapp/update_flow.hpp): a press checks the stick; a second one installs.
UpdateFlow g_update;

Expand Down Expand Up @@ -331,25 +332,30 @@ bool onAutostartToggle(void*, const bmw::Parcel&) {
return true;
}

// A setting the service reads at its start changed: one that runs is stopped, and started again by the status poll
// once nothing of it is left.
void restartForSetting(const char* what) {
if (stopInProgress()) {
if (g_restart.asked()) {
g_restart.ask(monoSeconds()); // changed again during its own restart
}
} else if (readServiceState().pid != 0) {
alog("menu: %s changed while Android Auto runs: stopping it, then starting it again", what);
beginStop();
g_restart.ask(monoSeconds());
}
}

// Wireless or USB cable: chosen here and nowhere else, never guessed from what is plugged in (a passenger's
// phone on charge must not take Android Auto over). The service reads the choice at its start: one that runs is
// stopped, and started again by the status poll once nothing of it is left.
// phone on charge must not take Android Auto over).
bool onUsbCableToggle(void*, const bmw::Parcel&) {
try {
if (!g_runApp) {
return true;
}
if (!guardedByOverlay("USB cable")) {
toggleUsbCable();
if (stopInProgress()) {
if (g_restart.asked()) {
g_restart.ask(monoSeconds()); // changed again during its own restart
}
} else if (readServiceState().pid != 0) {
alog("menu: link changed while Android Auto runs: stopping it, then starting it again");
beginStop();
g_restart.ask(monoSeconds());
}
restartForSetting("link");
}
showSettings(g_runApp); // the setting as it is now, changed or not
} catch (abi::__forced_unwind&) {
Expand All @@ -360,6 +366,26 @@ bool onUsbCableToggle(void*, const bmw::Parcel&) {
return true;
}

// The car's position or the phone's own GPS: Android Auto takes the car's when it is offered, and on some cars it
// wanders at a stop (#265). The service decides what it offers the phone at its start.
bool onPhoneGpsToggle(void*, const bmw::Parcel&) {
try {
if (!g_runApp) {
return true;
}
if (!guardedByOverlay("phone's GPS")) {
togglePhoneGps();
restartForSetting("GPS");
}
showSettings(g_runApp);
} catch (abi::__forced_unwind&) {
throw; // a thread being cancelled
} catch (...) {
alog("exception in onPhoneGpsToggle");
}
return true;
}

// "Keep logs": the maintenance profile's file, so the logs need no SSH either.
bool onKeepLogsToggle(void*, const bmw::Parcel&) {
try {
Expand Down Expand Up @@ -533,12 +559,12 @@ void statusRun(void*) {
stopInProgress() || launchCoolingDown(now) || readServiceState().pid != 0 || supervisorRunning();
const PendingRestart::Turn restart = g_restart.turn(now, busy);
if (restart == PendingRestart::kStart) {
alog("link changed: Android Auto has stopped, starting it again over %s",
alog("setting changed: Android Auto has stopped, starting it again over %s",
usbCableOn() ? "the USB cable" : "wireless");
forgetBootGuard();
launchService();
} else if (restart == PendingRestart::kGiveUp) {
alog("link changed: Android Auto still there after %ld s, not started again (Start in the menu)",
alog("setting changed: Android Auto still there after %ld s, not started again (Start in the menu)",
kRestartGiveUpS);
}
}
Expand Down Expand Up @@ -621,6 +647,7 @@ bool appOnInit(bmw::PluginApp* self) {
addAction(self, kActEntry, &onEntry);
addAction(self, kActAutostart, &onAutostartToggle);
addAction(self, kActUsbCable, &onUsbCableToggle);
addAction(self, kActPhoneGps, &onPhoneGpsToggle);
addAction(self, kActKeepLogs, &onKeepLogsToggle);
addAction(self, kActCopyLogs, &onCopyLogs);
addAction(self, kActUpdate, &onUpdate);
Expand All @@ -633,8 +660,9 @@ bool appOnInit(bmw::PluginApp* self) {
writeIdriveCoding(); // the car's keys, brand and driver's side, for the service
readDriveModePopup(); // only logged here: read again at each driving mode change
g_touch.set(findTouchSwitch());
alog("onInit: handlers registered, base onInit -> %d, start automatically %s, USB cable %s",
static_cast<int>(ok), autostartOn() ? "on" : "off", usbCableOn() ? "on" : "off");
alog("onInit: handlers registered, base onInit -> %d, start automatically %s, USB cable %s, phone's GPS %s",
static_cast<int>(ok), autostartOn() ? "on" : "off", usbCableOn() ? "on" : "off",
phoneGpsOn() ? "on" : "off");
g_runApp = self;
makeRunnable(g_subRunnable, &subscribeRun);
postRunnable(self, g_subRunnable, 1500);
Expand Down
5 changes: 5 additions & 0 deletions hmiapp/make_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
16: "Help",
17: "USB cable instead of wireless",
18: "Keep logs",
19: "Use the phone's GPS",
40: "Copy logs to USB stick",
41: "Copying logs...",
42: "Logs copied to the USB stick",
Expand Down Expand Up @@ -87,6 +88,7 @@
16: "Aide",
17: "Câble USB au lieu du sans-fil",
18: "Garder les journaux",
19: "Utiliser le GPS du téléphone",
40: "Copier les journaux sur clé USB",
41: "Copie des journaux...",
42: "Journaux copiés sur la clé USB",
Expand Down Expand Up @@ -129,6 +131,7 @@
16: "Hilfe",
17: "USB-Kabel statt kabellos",
18: "Protokolle speichern",
19: "GPS des Telefons nutzen",
40: "Protokolle auf USB-Stick kopieren",
41: "Protokolle werden kopiert...",
42: "Protokolle auf USB-Stick kopiert",
Expand Down Expand Up @@ -170,6 +173,7 @@
15: "Avvio automatico",
16: "Aiuto",
17: "Cavo USB anziché wireless",
19: "Usa il GPS del telefono",
20: "NAV, MAP: navigazione Android Auto",
21: "MEDIA: musica Android Auto",
22: "COM: telefono Android Auto",
Expand All @@ -187,6 +191,7 @@
16: "Pomoc",
17: "Kabel USB zamiast WiFi",
18: "Zachowaj logi",
19: "Używaj GPS telefonu",
40: "Kopiuj logi na USB",
41: "Kopiowanie logów...",
42: "Logi skopiowane na USB",
Expand Down
Loading
Loading