From 97bd888e6353e3aeb6cbf93bc86702467fa45ad1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 15:17:33 +0000 Subject: [PATCH 01/10] 2.5.23: Subaru CVT and all-wheel-drive readings Each reading is tried under every number owners have found it under, transmission computer at 7E1 first, then 7A3, and only the first that answers is shown. Once one answers, the other numbers aren't asked. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iBpQoZ1YYqwwUyfcpJpti --- CHANGELOG.md | 4 ++ .../com/obdreader/app/MainDeeperChecks.kt | 7 +-- .../com/obdreader/app/obd/EnhancedReadings.kt | 41 +++++++++++++++- .../com/obdreader/app/session/ObdSession.kt | 5 +- .../obdreader/app/obd/EnhancedReadingsTest.kt | 48 ++++++++++++++++++- gradle.properties | 2 +- 6 files changed, 99 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53a8526c1..6859dad6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ Every change to OBD2 Reader, newest first. Each GitHub release shows the entry for its version. +## 2.5.23 (29 November 2026) +- **More Subaru CVT and all-wheel-drive readings.** Enhanced diagnostics now reads, from Subaru's transmission computer, the CVT ratio, the primary and secondary pulley speeds, the torque converter's turbine speed and lock-up duty, and the all-wheel-drive clutch duty, along with the transmission fluid temperature. +- **Subaru transmission temperature on more cars.** It was only asked for where the 2023 and later Outback keeps it, so many 2013–2022 CVT Subarus may not have shown it. Owners have found these readings under different numbers on different Subarus, so the app now tries each number known and shows the first your car answers. Like the other manufacturer readings, they come from owners testing them on their own cars rather than from Subaru, and the app says so. + ## 2.5.22 (29 November 2026) - **More standard readings.** 24 more readings from the OBD2 standard, shown on cars that report them, to graph or put on the Dashboard: absolute engine load, the mixture the engine computer is aiming for, relative and secondary throttle positions, accelerator pedal positions, the commanded throttle, fuel injection timing, engine friction torque, cylinder fuel rate, the gear ratio the gearbox is in, the odometer (in km or miles), AdBlue dosing, and the current of wide-band oxygen sensors that report one. Readings whose scaling isn't published openly, such as turbo speed, boost control, the diesel particulate filter and the NOx sensor, are still left out rather than guessed. - **One more Subaru code.** U1566, a Multi-View system data fault, on the 2023–2025 Legacy and Outback, 2023–2024 Ascent, 2024 Impreza and Crosstrek and 2025 Forester. Subaru's own bulletin says it can be set falsely and is fixed by an infotainment software update. diff --git a/app/src/main/java/com/obdreader/app/MainDeeperChecks.kt b/app/src/main/java/com/obdreader/app/MainDeeperChecks.kt index 61803557c..5e68a3f78 100644 --- a/app/src/main/java/com/obdreader/app/MainDeeperChecks.kt +++ b/app/src/main/java/com/obdreader/app/MainDeeperChecks.kt @@ -547,7 +547,8 @@ internal suspend fun MainActivity.showEnhanced() { val volvo = ObdSession.isVolvoD3B0(this) val volvoKm = if (volvo) ObdSession.readVolvoMileage() else null if (volvo) android.util.Log.i("OBD2Deep", "volvo mileage: " + (volvoKm?.let { String.format(Locale.US, "%.0f km", it) } ?: "none")) - val answered = tried.filter { first[it] != null } + val answered = EnhancedReadings.shown(tried, first) + val known = EnhancedReadings.known(tried) android.util.Log.i("OBD2Deep", "enhanced: tried ${tried.size}, answered " + answered.joinToString(", ") { "${it.name}=${first[it]?.let(it::format)}" }.ifEmpty { "none" }) val values = mutableMapOf() infoSheet(getString(R.string.enhanced_title)) { heading, line, body -> @@ -570,7 +571,7 @@ internal suspend fun MainActivity.showEnhanced() { when { volvo && tried.isEmpty() -> {} tried.isEmpty() -> line("No manufacturer readings are known for ${make ?: "this make"} yet. Module information, below, works on every make.", true) - answered.isEmpty() -> line("Your car didn't answer any of the ${tried.size} readings known for ${make ?: "its make"}. Not every model has them.", true) + answered.isEmpty() -> line("Your car didn't answer any of the $known readings known for ${make ?: "its make"}. Not every model has them.", true) else -> answered.forEach { r -> body.addView(LinearLayout(this).apply { orientation = LinearLayout.HORIZONTAL; gravity = Gravity.CENTER_VERTICAL; setPadding(0, dp(6f).toInt(), 0, 0) @@ -586,7 +587,7 @@ internal suspend fun MainActivity.showEnhanced() { }) } } - if (answered.isNotEmpty() && answered.size < tried.size) line("${tried.size - answered.size} more known for your make weren't answered by your car.", true) + if (answered.isNotEmpty() && answered.size < known) line("${known - answered.size} more known for your make weren't answered by your car.", true) if (tried.isNotEmpty()) line(getString(R.string.enhanced_source), true) heading("Module information") line("Part numbers, software versions and the VIN each module holds, read with the standard identifiers every make's modules use.", true) diff --git a/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt b/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt index 856ac8f43..e1765c248 100644 --- a/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt +++ b/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt @@ -74,8 +74,37 @@ object EnhancedReadings { r("toyota.fuel_litres", "Fuel in the tank", "Instrument cluster", "7C0", "2129", "L", 1) { b -> u(b, 0, 1)?.div(2) }, ) + private const val TCM = "Transmission" + + /** + * Subaru's CVT (Lineartronic) and all-wheel-drive readings. Owners have found them under different + * numbers on different cars, so each is listed under every number it's been found under, best + * known first: the transmission computer at 7E1 on 2013–2022 CVT cars, then at 7A3 on newer ones. + * They share an id, and only the first that answers is shown (see [shown]). + */ private val SUBARU = listOf( - r("subaru.trans_temp", "Transmission fluid temperature", "Transmission", "7A3", "2210D2", "°C", 0) { b -> u(b, 0, 1)?.minus(50) }, + r("subaru.trans_temp", "Transmission fluid temperature", TCM, "7E1", "2210D2", "°C", 0) { b -> u(b, 0, 1)?.minus(50) }, + r("subaru.trans_temp", "Transmission fluid temperature", TCM, "7E1", "221017", "°C", 0) { b -> u(b, 0, 1)?.minus(50) }, + r("subaru.trans_temp", "Transmission fluid temperature", TCM, "7A3", "2210D2", "°C", 0) { b -> u(b, 0, 1)?.minus(50) }, + r("subaru.trans_temp", "Transmission fluid temperature", TCM, "7A3", "221017", "°C", 0) { b -> u(b, 0, 1)?.minus(50) }, + r("subaru.cvt_ratio", "CVT ratio", TCM, "7E1", "22113E", "", 2) { b -> u(b, 0, 2)?.div(256) }, + r("subaru.cvt_ratio", "CVT ratio", TCM, "7E1", "2230DA", "", 2) { b -> u(b, 0, 2)?.div(255) }, + r("subaru.cvt_ratio", "CVT ratio", TCM, "7A3", "2230DA", "", 2) { b -> u(b, 0, 2)?.div(255) }, + r("subaru.primary_pulley", "CVT primary pulley speed", TCM, "7E1", "221146", "rpm", 0) { b -> u(b, 0, 2) }, + r("subaru.primary_pulley", "CVT primary pulley speed", TCM, "7E1", "22300E", "rpm", 0) { b -> u(b, 0, 2) }, + r("subaru.primary_pulley", "CVT primary pulley speed", TCM, "7A3", "22300E", "rpm", 0) { b -> u(b, 0, 2) }, + r("subaru.secondary_pulley", "CVT secondary pulley speed", TCM, "7E1", "221138", "rpm", 0) { b -> u(b, 0, 2) }, + r("subaru.secondary_pulley", "CVT secondary pulley speed", TCM, "7E1", "2230D0", "rpm", 0) { b -> u(b, 0, 2) }, + r("subaru.secondary_pulley", "CVT secondary pulley speed", TCM, "7A3", "2230D0", "rpm", 0) { b -> u(b, 0, 2) }, + r("subaru.turbine", "Torque converter turbine speed", TCM, "7E1", "2210CB", "rpm", 0) { b -> u(b, 0, 1)?.times(32) }, + r("subaru.turbine", "Torque converter turbine speed", TCM, "7E1", "221067", "rpm", 0) { b -> u(b, 0, 1)?.times(32) }, + r("subaru.turbine", "Torque converter turbine speed", TCM, "7A3", "221067", "rpm", 0) { b -> u(b, 0, 1)?.times(32) }, + r("subaru.lockup", "Torque converter lock-up duty", TCM, "7E1", "2210C8", "%", 0) { b -> u(b, 0, 1)?.div(2) }, + r("subaru.lockup", "Torque converter lock-up duty", TCM, "7E1", "221045", "%", 0) { b -> u(b, 0, 1)?.div(2) }, + r("subaru.lockup", "Torque converter lock-up duty", TCM, "7A3", "221045", "%", 0) { b -> u(b, 0, 1)?.div(2) }, + r("subaru.awd_duty", "All-wheel-drive clutch duty", TCM, "7E1", "2210C9", "%", 0) { b -> u(b, 0, 1)?.div(2) }, + r("subaru.awd_duty", "All-wheel-drive clutch duty", TCM, "7E1", "221065", "%", 0) { b -> u(b, 0, 1)?.div(2) }, + r("subaru.awd_duty", "All-wheel-drive clutch duty", TCM, "7A3", "221065", "%", 0) { b -> u(b, 0, 1)?.div(2) }, r("subaru.maf", "Airflow (engine computer)", PCM, "7A2", "2212ED", "g/s", 2) { b -> u(b, 0, 2)?.div(100) }, ) @@ -119,6 +148,16 @@ object EnhancedReadings { return list } + /** + * The readings to show, from [values] read for [tried]: those that answered, and for a reading + * listed under several numbers, only the first that answered. + */ + fun shown(tried: List, values: Map): List = + tried.filter { values[it] != null }.distinctBy { it.id } + + /** How many different readings [tried] holds: one listed under several numbers counts once. */ + fun known(tried: List): Int = tried.distinctBy { it.id }.size + /** Every reading, for tests. */ val ALL: List get() = FORD + TOYOTA + SUBARU + LEAF + ZOE + OPEL diff --git a/app/src/main/java/com/obdreader/app/session/ObdSession.kt b/app/src/main/java/com/obdreader/app/session/ObdSession.kt index be00e1d23..cd019c618 100644 --- a/app/src/main/java/com/obdreader/app/session/ObdSession.kt +++ b/app/src/main/java/com/obdreader/app/session/ObdSession.kt @@ -870,14 +870,17 @@ object ObdSession { if (!c.isCan) return readings.associateWith { null } val defaultHeader = CarCoverage.defaultHeader(_state.value.protocolCode) val out = linkedMapOf() + // A reading listed under several numbers (see EnhancedReadings): once one answers, the rest aren't asked. + val found = mutableSetOf() for ((key, group) in readings.groupBy { it.header to it.request }) { val (header, request) = key val first = group.first() + if (group.all { it.id in found }) { group.forEach { out[it] = null }; continue } val point = if (header == null) emptyList() else listOfNotNull("ATSH $header", first.reply?.let { "ATCRA $it" }, "ATFCSH $header", "ATFCSD 300000", "ATFCSM 1") val back = if (header == null) emptyList() else ModuleScan.pointBack(defaultHeader) val lines = c.sequence(point.map { it to 1500L } + (request to 2000L), back).last() val data = if (ElmParser.errorIn(lines) != null) null else ElmParser.extractData(lines, first.replyHeader) - group.forEach { r -> out[r] = data?.let { d -> try { r.decode(d)?.takeIf { !it.isNaN() && !it.isInfinite() } } catch (e: Exception) { null } } } + group.forEach { r -> out[r] = data?.let { d -> try { r.decode(d)?.takeIf { !it.isNaN() && !it.isInfinite() } } catch (e: Exception) { null } }?.also { found += r.id } } } return out } diff --git a/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt b/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt index d220b96d4..11b75996e 100644 --- a/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt +++ b/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt @@ -19,9 +19,11 @@ class EnhancedReadingsTest { assertTrue(EnhancedReadings.forCar("Nissan", "Leaf", 2015).any { it.id == "leaf.soc" }) assertTrue(EnhancedReadings.forCar("Nissan", "Leaf", 2020).none { it.id.startsWith("leaf") }) assertTrue(EnhancedReadings.forCar("Peugeot", "308", 2018).isEmpty()) - // Every request is a read the guard lets through, and every id is unique. + // Every request is a read the guard lets through, and no reading is listed twice under the same number. EnhancedReadings.ALL.forEach { assertTrue(it.request, ReadOnlyGuard.isAllowed(it.request)) } - assertEquals(EnhancedReadings.ALL.size, EnhancedReadings.ALL.map { it.id }.toSet().size) + assertEquals(EnhancedReadings.ALL.size, EnhancedReadings.ALL.map { Triple(it.id, it.header, it.request) }.toSet().size) + // A reading listed under several numbers is the same reading each time: same name, module and unit. + EnhancedReadings.ALL.groupBy { it.id }.values.forEach { v -> assertEquals(v.first().id, 1, v.map { Triple(it.name, it.module, it.unit) }.toSet().size) } EnhancedReadings.IDENTIFIERS.forEach { assertTrue(ReadOnlyGuard.isAllowed("22" + it.did)) } assertTrue(ReadOnlyGuard.isAllowed("1A6D")) } @@ -42,6 +44,48 @@ class EnhancedReadingsTest { assertEquals("72E", reading("ford.odometer").reply) } + @Test + fun subaruTransmissionReadings() { + val tried = EnhancedReadings.forCar("Subaru", "Outback", 2016) + val cvt = tried.filter { it.module == "Transmission" } + assertEquals(listOf("subaru.trans_temp", "subaru.cvt_ratio", "subaru.primary_pulley", "subaru.secondary_pulley", "subaru.turbine", "subaru.lockup", "subaru.awd_duty"), cvt.map { it.id }.distinct()) + // Each is tried at 7E1 (2013–2022 cars) before 7A3 (newer ones); the earlier 7A3 temperature is still tried. + cvt.groupBy { it.id }.values.forEach { v -> assertEquals(v.first().id, "7E1", v.first().header); assertEquals("7A3", v.last().header) } + assertTrue(tried.any { it.id == "subaru.trans_temp" && it.header == "7A3" && it.request == "2210D2" }) + assertTrue(cvt.all { it.reply == "7E9" || it.reply == "7AB" }) + // Not tried on other makes. + assertTrue(EnhancedReadings.forCar("Toyota", "Camry", 2016).none { it.id.startsWith("subaru") }) + + fun at(id: String, request: String) = cvt.first { it.id == id && it.request == request } + assertEquals(40.0, at("subaru.trans_temp", "221017").decode(intArrayOf(90))!!, 1e-9) + assertEquals(2.5, at("subaru.cvt_ratio", "22113E").decode(intArrayOf(0x02, 0x80))!!, 1e-9) + assertEquals(1.0, at("subaru.cvt_ratio", "2230DA").decode(intArrayOf(0x00, 0xFF))!!, 1e-9) + assertEquals(2000.0, at("subaru.primary_pulley", "221146").decode(intArrayOf(0x07, 0xD0))!!, 1e-9) + assertEquals(1600.0, at("subaru.turbine", "221067").decode(intArrayOf(50))!!, 1e-9) + assertEquals(50.0, at("subaru.lockup", "2210C8").decode(intArrayOf(100))!!, 1e-9) + assertEquals(12.5, at("subaru.awd_duty", "221065").decode(intArrayOf(25))!!, 1e-9) + assertEquals("2.50", at("subaru.cvt_ratio", "22113E").format(2.5)) + assertEquals("2,000 rpm", at("subaru.primary_pulley", "221146").format(2000.0)) + } + + @Test + fun aReadingUnderSeveralNumbersShowsOnce() { + val tried = EnhancedReadings.forCar("Subaru", "Forester", 2018) + assertEquals(8, EnhancedReadings.known(tried)) + // The car answers the temperature under two numbers and the ratio under one: two readings, the first number's value. + val first = tried.first { it.id == "subaru.trans_temp" } + val second = tried.filter { it.id == "subaru.trans_temp" }[1] + val ratio = tried.last { it.id == "subaru.cvt_ratio" } + val values = tried.associateWith { r -> when (r) { first -> 40.0; second -> 41.0; ratio -> 2.1; else -> null } } + val shown = EnhancedReadings.shown(tried, values) + assertEquals(listOf("subaru.trans_temp", "subaru.cvt_ratio"), shown.map { it.id }) + assertEquals(40.0, values[shown[0]]!!, 1e-9) + assertTrue(EnhancedReadings.shown(tried, emptyMap()).isEmpty()) + // Makes without repeated readings count as before. + val ford = EnhancedReadings.forCar("Ford", "Focus", 2012) + assertEquals(ford.size, EnhancedReadings.known(ford)) + } + @Test fun moduleIdentifiers() { assertEquals("1L8T-2C219-AB", EnhancedReadings.identifierText("1L8T-2C219-AB".map { it.code }.toIntArray())) diff --git a/gradle.properties b/gradle.properties index ecd536f1b..6198f5ed3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,4 +4,4 @@ android.nonTransitiveRClass=true kotlin.code.style=official # The app version shown to users. Bump it with each release and add a CHANGELOG.md entry. -obdVersion=2.5.22 +obdVersion=2.5.23 From 21e29d5dda58ac90f39b59e1d8003d42f2f34651 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 15:24:13 +0000 Subject: [PATCH 02/10] 2.5.23: GM and Holden transmission temperature Read with the same number GM uses on its older cars, tried on the transmission computer first, then the engine computer. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iBpQoZ1YYqwwUyfcpJpti --- CHANGELOG.md | 1 + .../com/obdreader/app/obd/EnhancedReadings.kt | 13 +++++++++++- .../obdreader/app/obd/EnhancedReadingsTest.kt | 21 +++++++++++++++++-- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6859dad6f..effa0d686 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Every change to OBD2 Reader, newest first. Each GitHub release shows the entry f ## 2.5.23 (29 November 2026) - **More Subaru CVT and all-wheel-drive readings.** Enhanced diagnostics now reads, from Subaru's transmission computer, the CVT ratio, the primary and secondary pulley speeds, the torque converter's turbine speed and lock-up duty, and the all-wheel-drive clutch duty, along with the transmission fluid temperature. - **Subaru transmission temperature on more cars.** It was only asked for where the 2023 and later Outback keeps it, so many 2013–2022 CVT Subarus may not have shown it. Owners have found these readings under different numbers on different Subarus, so the app now tries each number known and shows the first your car answers. Like the other manufacturer readings, they come from owners testing them on their own cars rather than from Subaru, and the app says so. +- **Transmission temperature for GM and Holden.** Enhanced diagnostics now shows the transmission fluid temperature on Chevrolet, GMC, Holden, Buick, Cadillac, Pontiac, Saturn and Hummer cars that give it, from the transmission computer or the engine computer, whichever answers. GM and Holden cars had no manufacturer readings before. ## 2.5.22 (29 November 2026) - **More standard readings.** 24 more readings from the OBD2 standard, shown on cars that report them, to graph or put on the Dashboard: absolute engine load, the mixture the engine computer is aiming for, relative and secondary throttle positions, accelerator pedal positions, the commanded throttle, fuel injection timing, engine friction torque, cylinder fuel rate, the gear ratio the gearbox is in, the odometer (in km or miles), AdBlue dosing, and the current of wide-band oxygen sensors that report one. Readings whose scaling isn't published openly, such as turbo speed, boost control, the diesel particulate filter and the NOx sensor, are still left out rather than guessed. diff --git a/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt b/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt index e1765c248..e2992912c 100644 --- a/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt +++ b/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt @@ -126,6 +126,16 @@ object EnhancedReadings { r("zoe.batt_temp", "Battery temperature", "Electric vehicle controller", null, "222001", "°C", 0) { b -> u(b, 0, 1)?.minus(40) }, ) + /** + * GM's own makes, Holden included, on CAN (about 2008 on): transmission fluid temperature, + * which GM keeps under the same number on its older cars. Some cars give it from the + * transmission computer (7E2, Allison gearboxes among them), others from the engine computer. + */ + private val GM = listOf( + r("gm.trans_temp", "Transmission fluid temperature", TCM, "7E2", "221940", "°C", 0) { b -> u(b, 0, 1)?.minus(40) }, + r("gm.trans_temp", "Transmission fluid temperature", PCM, "7E0", "221940", "°C", 0) { b -> u(b, 0, 1)?.minus(40) }, + ) + /** Opel and Vauxhall: GM's own read service, 1A, on the engine computer. */ private val OPEL = listOf( r("opel.oil_life", "Oil life remaining", PCM, "7E0", "1A6D", "%", 0) { b -> u(b, 0, 1)?.div(2.55) }, @@ -142,6 +152,7 @@ object EnhancedReadings { if (m in setOf("ford", "lincoln", "mercury") || fordBuiltMazda) list += FORD if (m in setOf("toyota", "lexus", "scion")) list += TOYOTA if (m == "subaru") list += SUBARU + if (m in setOf("chevrolet", "gmc", "holden", "buick", "cadillac", "pontiac", "saturn", "hummer")) list += GM if (m == "nissan" && mo == "leaf" && (year == null || year <= 2017)) list += LEAF if (m == "renault" && mo == "zoe" && (year == null || year <= 2019)) list += ZOE if (m == "opel / vauxhall" || m == "opel" || m == "vauxhall") list += OPEL @@ -159,7 +170,7 @@ object EnhancedReadings { fun known(tried: List): Int = tried.distinctBy { it.id }.size /** Every reading, for tests. */ - val ALL: List get() = FORD + TOYOTA + SUBARU + LEAF + ZOE + OPEL + val ALL: List get() = FORD + TOYOTA + SUBARU + GM + LEAF + ZOE + OPEL /** * Module information: the identifiers every UDS module is meant to answer (ISO 14229), so it diff --git a/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt b/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt index 11b75996e..4e2ea97ea 100644 --- a/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt +++ b/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt @@ -22,8 +22,8 @@ class EnhancedReadingsTest { // Every request is a read the guard lets through, and no reading is listed twice under the same number. EnhancedReadings.ALL.forEach { assertTrue(it.request, ReadOnlyGuard.isAllowed(it.request)) } assertEquals(EnhancedReadings.ALL.size, EnhancedReadings.ALL.map { Triple(it.id, it.header, it.request) }.toSet().size) - // A reading listed under several numbers is the same reading each time: same name, module and unit. - EnhancedReadings.ALL.groupBy { it.id }.values.forEach { v -> assertEquals(v.first().id, 1, v.map { Triple(it.name, it.module, it.unit) }.toSet().size) } + // A reading listed under several numbers is the same reading each time: same name and unit (the module can differ). + EnhancedReadings.ALL.groupBy { it.id }.values.forEach { v -> assertEquals(v.first().id, 1, v.map { it.name to it.unit }.toSet().size) } EnhancedReadings.IDENTIFIERS.forEach { assertTrue(ReadOnlyGuard.isAllowed("22" + it.did)) } assertTrue(ReadOnlyGuard.isAllowed("1A6D")) } @@ -68,6 +68,23 @@ class EnhancedReadingsTest { assertEquals("2,000 rpm", at("subaru.primary_pulley", "221146").format(2000.0)) } + @Test + fun gmTransmissionTemperature() { + listOf("Chevrolet" to "Silverado 1500", "Holden" to "Commodore", "GMC" to "Sierra 1500", "Cadillac" to "Escalade").forEach { (make, model) -> + val gm = EnhancedReadings.forCar(make, model, 2015).filter { it.id == "gm.trans_temp" } + // The transmission computer first, then the engine computer. + assertEquals(make, listOf("7E2", "7E0"), gm.map { it.header }) + assertEquals(listOf("7EA", "7E8"), gm.map { it.reply }) + } + assertTrue(EnhancedReadings.forCar("Ford", "F-150", 2015).none { it.id.startsWith("gm.") }) + assertTrue(EnhancedReadings.forCar("Opel / Vauxhall", "Astra", 2015).none { it.id.startsWith("gm.") }) + val r = reading("gm.trans_temp") + assertEquals(85.0, r.decode(intArrayOf(125))!!, 1e-9) + assertEquals(-40.0, r.decode(intArrayOf(0))!!, 1e-9) + assertEquals("621940", r.replyHeader) + assertEquals("85 °C", r.format(85.0)) + } + @Test fun aReadingUnderSeveralNumbersShowsOnce() { val tried = EnhancedReadings.forCar("Subaru", "Forester", 2018) From 661bce6ee9689d6c46fe03371f7f513f853774a3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 15:30:49 +0000 Subject: [PATCH 03/10] 2.5.23: Toyota, Lexus and older Ford transmission temperatures Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iBpQoZ1YYqwwUyfcpJpti --- CHANGELOG.md | 1 + .../com/obdreader/app/obd/EnhancedReadings.kt | 11 +++++++++ .../obdreader/app/obd/EnhancedReadingsTest.kt | 24 ++++++++++++++++--- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index effa0d686..ffedbe792 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Every change to OBD2 Reader, newest first. Each GitHub release shows the entry f - **More Subaru CVT and all-wheel-drive readings.** Enhanced diagnostics now reads, from Subaru's transmission computer, the CVT ratio, the primary and secondary pulley speeds, the torque converter's turbine speed and lock-up duty, and the all-wheel-drive clutch duty, along with the transmission fluid temperature. - **Subaru transmission temperature on more cars.** It was only asked for where the 2023 and later Outback keeps it, so many 2013–2022 CVT Subarus may not have shown it. Owners have found these readings under different numbers on different Subarus, so the app now tries each number known and shows the first your car answers. Like the other manufacturer readings, they come from owners testing them on their own cars rather than from Subaru, and the app says so. - **Transmission temperature for GM and Holden.** Enhanced diagnostics now shows the transmission fluid temperature on Chevrolet, GMC, Holden, Buick, Cadillac, Pontiac, Saturn and Hummer cars that give it, from the transmission computer or the engine computer, whichever answers. GM and Holden cars had no manufacturer readings before. +- **Transmission temperature for Toyota, Lexus and older Fords.** Toyota and Lexus automatics now show the transmission fluid temperature, and the torque converter's where the car gives it. Fords that don't answer the transmission temperature the app already asked for, such as the 2002–2010 Explorer, are now asked under the number they use. ## 2.5.22 (29 November 2026) - **More standard readings.** 24 more readings from the OBD2 standard, shown on cars that report them, to graph or put on the Dashboard: absolute engine load, the mixture the engine computer is aiming for, relative and secondary throttle positions, accelerator pedal positions, the commanded throttle, fuel injection timing, engine friction torque, cylinder fuel rate, the gear ratio the gearbox is in, the odometer (in km or miles), AdBlue dosing, and the current of wide-band oxygen sensors that report one. Readings whose scaling isn't published openly, such as turbo speed, boost control, the diesel particulate filter and the NOx sensor, are still left out rather than guessed. diff --git a/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt b/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt index e2992912c..4462d830d 100644 --- a/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt +++ b/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt @@ -59,6 +59,11 @@ object EnhancedReadings { /** Ford's (and the Ford-built Mazdas') engine computer and body module. */ private val FORD = listOf( r("ford.trans_temp", "Transmission fluid temperature", PCM, "7E0", "221E1C", "°C", 1) { b -> s(b, 0, 2)?.div(16) }, + // The same temperature on cars that give it from the transmission computer, and under the number + // older Fords (such as the 2002–2010 Explorer) use, which comes in eighths of a °F. + r("ford.trans_temp", "Transmission fluid temperature", TCM, "7E1", "221E1C", "°C", 1) { b -> s(b, 0, 2)?.div(16) }, + r("ford.trans_temp", "Transmission fluid temperature", TCM, "7E1", "221674", "°C", 1) { b -> u(b, 0, 2)?.let { (it / 8 - 32) * 5 / 9 } }, + r("ford.trans_temp", "Transmission fluid temperature", PCM, "7E0", "221674", "°C", 1) { b -> u(b, 0, 2)?.let { (it / 8 - 32) * 5 / 9 } }, r("ford.gear", "Gear engaged", PCM, "7E0", "221E12", "", 0) { b -> u(b, 0, 1) }, r("ford.oil_life", "Oil life remaining", PCM, "7E0", "22054B", "%", 0) { b -> u(b, 0, 1) }, r("ford.fuel_pump", "Fuel pump duty", PCM, "7E0", "220307", "%", 0) { b -> u(b, 0, 1)?.times(100)?.div(255) }, @@ -72,6 +77,12 @@ object EnhancedReadings { r("toyota.odometer", "Odometer", PCM, "7E0", "2128", "km", 0) { b -> u(b, 0, 3) }, r("toyota.oil_temp", "Engine oil temperature", PCM, "7E0", "2151", "°C", 0) { b -> u(b, 11, 1)?.minus(40) }, r("toyota.fuel_litres", "Fuel in the tank", "Instrument cluster", "7C0", "2129", "L", 1) { b -> u(b, 0, 1)?.div(2) }, + // Automatic transmission fluid in the pan (first two bytes) and at the torque converter (next two), + // in 1/256 °C above -40: from the transmission computer, or the engine computer on some cars. + r("toyota.trans_temp", "Transmission fluid temperature", TCM, "7E1", "2182", "°C", 0) { b -> u(b, 0, 2)?.let { it / 256 - 40 } }, + r("toyota.trans_temp", "Transmission fluid temperature", PCM, "7E0", "2182", "°C", 0) { b -> u(b, 0, 2)?.let { it / 256 - 40 } }, + r("toyota.converter_temp", "Torque converter fluid temperature", TCM, "7E1", "2182", "°C", 0) { b -> u(b, 2, 2)?.let { it / 256 - 40 } }, + r("toyota.converter_temp", "Torque converter fluid temperature", PCM, "7E0", "2182", "°C", 0) { b -> u(b, 2, 2)?.let { it / 256 - 40 } }, ) private const val TCM = "Transmission" diff --git a/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt b/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt index 4e2ea97ea..5781133cf 100644 --- a/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt +++ b/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt @@ -85,6 +85,23 @@ class EnhancedReadingsTest { assertEquals("85 °C", r.format(85.0)) } + @Test + fun toyotaAndOlderFordTransmissionTemperatures() { + val toyota = EnhancedReadings.forCar("Lexus", "ES", 2015) + val pan = toyota.first { it.id == "toyota.trans_temp" } + val converter = toyota.first { it.id == "toyota.converter_temp" } + assertEquals("7E1", pan.header); assertEquals("6182", pan.replyHeader) + // 0x7D00 is 125 × 256: 85 °C in the pan; the converter's two bytes follow. + assertEquals(85.0, pan.decode(intArrayOf(0x7D, 0x00, 0x82, 0x80))!!, 1e-9) + assertEquals(90.5, converter.decode(intArrayOf(0x7D, 0x00, 0x82, 0x80))!!, 1e-9) + assertNull(converter.decode(intArrayOf(0x7D, 0x00))) // a car that only gives the pan + // Ford: the newer number first (the demo car answers it), then the older one, in eighths of a °F. + val ford = EnhancedReadings.forCar("Ford", "Explorer", 2007).filter { it.id == "ford.trans_temp" } + assertEquals(listOf("7E0" to "221E1C", "7E1" to "221E1C", "7E1" to "221674", "7E0" to "221674"), ford.map { it.header to it.request }) + assertEquals(80.0, ford[2].decode(intArrayOf(0x05, 0x80))!!, 1e-9) // 1408 / 8 = 176 °F + assertEquals("80.0 °C", ford[2].format(80.0)) + } + @Test fun aReadingUnderSeveralNumbersShowsOnce() { val tried = EnhancedReadings.forCar("Subaru", "Forester", 2018) @@ -98,9 +115,10 @@ class EnhancedReadingsTest { assertEquals(listOf("subaru.trans_temp", "subaru.cvt_ratio"), shown.map { it.id }) assertEquals(40.0, values[shown[0]]!!, 1e-9) assertTrue(EnhancedReadings.shown(tried, emptyMap()).isEmpty()) - // Makes without repeated readings count as before. - val ford = EnhancedReadings.forCar("Ford", "Focus", 2012) - assertEquals(ford.size, EnhancedReadings.known(ford)) + // Readings listed once count as before; Ford's transmission temperature counts once. + val leaf = EnhancedReadings.forCar("Nissan", "Leaf", 2015) + assertEquals(leaf.size, EnhancedReadings.known(leaf)) + assertEquals(8, EnhancedReadings.known(EnhancedReadings.forCar("Ford", "Focus", 2012))) } @Test From 76b0b5ab117f49c703b5b1d367915002c08f7f8c Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 21:48:53 +0000 Subject: [PATCH 04/10] 2.5.23: Subaru engine readings, marked unconfirmed Seen in one list only, so each is shown as unconfirmed in the manufacturer readings sheet, with a line saying what that means. Target boost and injector pulse width are left out: their scaling doesn't give plausible values. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iBpQoZ1YYqwwUyfcpJpti --- CHANGELOG.md | 1 + .../com/obdreader/app/MainDeeperChecks.kt | 3 ++- .../com/obdreader/app/obd/EnhancedReadings.kt | 27 ++++++++++++++++++- app/src/main/res/values/strings.xml | 2 ++ .../obdreader/app/obd/EnhancedReadingsTest.kt | 27 ++++++++++++++++++- 5 files changed, 57 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffedbe792..f5a14207f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Every change to OBD2 Reader, newest first. Each GitHub release shows the entry f ## 2.5.23 (29 November 2026) - **More Subaru CVT and all-wheel-drive readings.** Enhanced diagnostics now reads, from Subaru's transmission computer, the CVT ratio, the primary and secondary pulley speeds, the torque converter's turbine speed and lock-up duty, and the all-wheel-drive clutch duty, along with the transmission fluid temperature. - **Subaru transmission temperature on more cars.** It was only asked for where the 2023 and later Outback keeps it, so many 2013–2022 CVT Subarus may not have shown it. Owners have found these readings under different numbers on different Subarus, so the app now tries each number known and shows the first your car answers. Like the other manufacturer readings, they come from owners testing them on their own cars rather than from Subaru, and the app says so. +- **Subaru engine readings, marked unconfirmed.** On the 2014 and later Forester and WRX and the Ascent, Enhanced diagnostics also tries engine oil temperature, a roughness (misfire) monitor for each cylinder, knock correction, cam timing advance on each bank, turbo wastegate, fuel pump and alternator duty, 12 V battery temperature and radiator fan duty. They've only been seen in one owner-made list so far, so the app marks them unconfirmed until they're checked on more cars. Target boost and injector pulse width were left out because their scaling didn't add up. - **Transmission temperature for GM and Holden.** Enhanced diagnostics now shows the transmission fluid temperature on Chevrolet, GMC, Holden, Buick, Cadillac, Pontiac, Saturn and Hummer cars that give it, from the transmission computer or the engine computer, whichever answers. GM and Holden cars had no manufacturer readings before. - **Transmission temperature for Toyota, Lexus and older Fords.** Toyota and Lexus automatics now show the transmission fluid temperature, and the torque converter's where the car gives it. Fords that don't answer the transmission temperature the app already asked for, such as the 2002–2010 Explorer, are now asked under the number they use. diff --git a/app/src/main/java/com/obdreader/app/MainDeeperChecks.kt b/app/src/main/java/com/obdreader/app/MainDeeperChecks.kt index 5e68a3f78..0d5d94667 100644 --- a/app/src/main/java/com/obdreader/app/MainDeeperChecks.kt +++ b/app/src/main/java/com/obdreader/app/MainDeeperChecks.kt @@ -578,7 +578,7 @@ internal suspend fun MainActivity.showEnhanced() { addView(LinearLayout(this@showEnhanced).apply { orientation = LinearLayout.VERTICAL addView(TextView(this@showEnhanced).apply { text = r.name; setTextSize(TypedValue.COMPLEX_UNIT_SP, 14f); setTextColor(themeColor(R.attr.obdTextPrimary)) }) - addView(TextView(this@showEnhanced).apply { text = r.module; setTextSize(TypedValue.COMPLEX_UNIT_SP, 12f); setTextColor(themeColor(R.attr.obdTextSecondary)) }) + addView(TextView(this@showEnhanced).apply { text = if (r.confirmed) r.module else getString(R.string.enhanced_unconfirmed_module, r.module); setTextSize(TypedValue.COMPLEX_UNIT_SP, 12f); setTextColor(themeColor(R.attr.obdTextSecondary)) }) }, LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1f)) addView(TextView(this@showEnhanced).apply { text = first[r]?.let(r::format) ?: "N/A"; typeface = titleTypeface(); setTextSize(TypedValue.COMPLEX_UNIT_SP, 18f); setTextColor(themeColor(R.attr.obdAccentText)) @@ -589,6 +589,7 @@ internal suspend fun MainActivity.showEnhanced() { } if (answered.isNotEmpty() && answered.size < known) line("${known - answered.size} more known for your make weren't answered by your car.", true) if (tried.isNotEmpty()) line(getString(R.string.enhanced_source), true) + if (answered.any { !it.confirmed }) line(getString(R.string.enhanced_unconfirmed), true) heading("Module information") line("Part numbers, software versions and the VIN each module holds, read with the standard identifiers every make's modules use.", true) body.addView(MaterialButton(this, null, com.google.android.material.R.attr.materialButtonOutlinedStyle).apply { diff --git a/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt b/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt index 4462d830d..4ecea74c1 100644 --- a/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt +++ b/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt @@ -29,6 +29,8 @@ object EnhancedReadings { val decimals: Int, /** The value from the answer's data bytes (after the reply's service and identifier). */ val decode: (IntArray) -> Double?, + /** False for a reading seen in only one owner-made list, not yet checked on a second car: marked "unconfirmed". */ + val confirmed: Boolean = true, ) { /** The answer starts with the service + 0x40 and the identifier: "221E1C" → "621E1C". */ val replyHeader: String get() = String.format(Locale.US, "%02X", request.substring(0, 2).toInt(16) + 0x40) + request.substring(2) @@ -137,6 +139,28 @@ object EnhancedReadings { r("zoe.batt_temp", "Battery temperature", "Electric vehicle controller", null, "222001", "°C", 0) { b -> u(b, 0, 1)?.minus(40) }, ) + /** + * Subaru's engine computer on the 2014 and later Forester and WRX and the Ascent. These have been + * seen in only one owner-made list so far, so they're marked unconfirmed. Oil temperature is under + * one number on the Forester and WRX and another on the Ascent; the first that answers is shown. + */ + private val SUBARU_ENGINE = listOf( + r("subaru.oil_temp", "Engine oil temperature", PCM, "7E0", "2210AF", "°C", 0) { b -> u(b, 0, 1)?.minus(40) }, + r("subaru.oil_temp", "Engine oil temperature", PCM, "7E0", "229D5C", "°C", 0) { b -> u(b, 0, 1)?.minus(40) }, + r("subaru.roughness1", "Roughness monitor, cylinder 1", PCM, "7E0", "223062", "", 0) { b -> u(b, 0, 1) }, + r("subaru.roughness2", "Roughness monitor, cylinder 2", PCM, "7E0", "223048", "", 0) { b -> u(b, 0, 1) }, + r("subaru.roughness3", "Roughness monitor, cylinder 3", PCM, "7E0", "223068", "", 0) { b -> u(b, 0, 1) }, + r("subaru.roughness4", "Roughness monitor, cylinder 4", PCM, "7E0", "22304A", "", 0) { b -> u(b, 0, 1) }, + r("subaru.knock", "Knock correction", PCM, "7E0", "223018", "°", 2) { b -> u(b, 0, 1)?.let { it / 4 - 32 } }, + r("subaru.cam_right", "Cam timing advance, right bank", PCM, "7E0", "221099", "°", 1) { b -> u(b, 0, 1)?.div(2) }, + r("subaru.cam_left", "Cam timing advance, left bank", PCM, "7E0", "2210B9", "°", 1) { b -> u(b, 0, 1)?.div(2) }, + r("subaru.wastegate", "Turbo wastegate duty", PCM, "7E0", "2210C9", "%", 0) { b -> u(b, 0, 1) }, + r("subaru.fuel_pump", "Fuel pump duty", PCM, "7E0", "2210B3", "%", 0) { b -> u(b, 0, 1)?.times(100)?.div(255) }, + r("subaru.alternator", "Alternator duty", PCM, "7E0", "221093", "%", 0) { b -> u(b, 0, 1) }, + r("subaru.battery_temp", "12 V battery temperature", PCM, "7E0", "22309A", "°C", 0) { b -> u(b, 0, 1)?.minus(40) }, + r("subaru.fan", "Radiator fan duty", PCM, "7E0", "2210E3", "%", 0) { b -> u(b, 0, 1) }, + ).map { it.copy(confirmed = false) } + /** * GM's own makes, Holden included, on CAN (about 2008 on): transmission fluid temperature, * which GM keeps under the same number on its older cars. Some cars give it from the @@ -163,6 +187,7 @@ object EnhancedReadings { if (m in setOf("ford", "lincoln", "mercury") || fordBuiltMazda) list += FORD if (m in setOf("toyota", "lexus", "scion")) list += TOYOTA if (m == "subaru") list += SUBARU + if (m == "subaru" && (mo == "ascent" || ((mo == "forester" || mo == "wrx / sti") && (year == null || year >= 2014)))) list += SUBARU_ENGINE if (m in setOf("chevrolet", "gmc", "holden", "buick", "cadillac", "pontiac", "saturn", "hummer")) list += GM if (m == "nissan" && mo == "leaf" && (year == null || year <= 2017)) list += LEAF if (m == "renault" && mo == "zoe" && (year == null || year <= 2019)) list += ZOE @@ -181,7 +206,7 @@ object EnhancedReadings { fun known(tried: List): Int = tried.distinctBy { it.id }.size /** Every reading, for tests. */ - val ALL: List get() = FORD + TOYOTA + SUBARU + GM + LEAF + ZOE + OPEL + val ALL: List get() = FORD + TOYOTA + SUBARU + SUBARU_ENGINE + GM + LEAF + ZOE + OPEL /** * Module information: the identifiers every UDS module is meant to answer (ISO 14229), so it diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4703b678f..1b2f4bc07 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -199,6 +199,8 @@ Fords and Mazdas put the cluster, body, climate, audio and door modules on a second, slower network (pins 3 and 11). Adapters that can switch to it, such as OBDLink MX+ and EX, can read those too. Takes about a minute, only reads, and never asks the airbag module. Enhanced diagnostics Readings your car\'s maker added beyond standard OBD2, like transmission temperature and oil life, live, plus each module\'s part numbers and software versions. + %1$s · unconfirmed + Readings marked unconfirmed have been seen in only one owner-made list and haven\'t been checked on a second car yet, so treat them as a rough guide. These readings come from owners testing them on their own cars, not from the maker, so check one against your car before relying on it. EV battery Hybrids and electric cars: the high-voltage battery\'s charge, plus how fast it\'s charging, with a graph. diff --git a/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt b/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt index 5781133cf..04c3ad7cb 100644 --- a/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt +++ b/app/src/test/java/com/obdreader/app/obd/EnhancedReadingsTest.kt @@ -68,6 +68,31 @@ class EnhancedReadingsTest { assertEquals("2,000 rpm", at("subaru.primary_pulley", "221146").format(2000.0)) } + @Test + fun subaruEngineReadingsAreUnconfirmedAndOnlyOnTheirModels() { + fun engine(model: String, year: Int?) = EnhancedReadings.forCar("Subaru", model, year).filter { it.header == "7E0" } + assertEquals(14, engine("Forester", 2016).size) + assertEquals(14, engine("WRX / STI", 2018).size) + assertEquals(14, engine("Ascent", 2020).size) + assertTrue(engine("Forester", 2012).isEmpty()) + assertTrue(engine("Outback", 2016).isEmpty()) + assertTrue(engine("Crosstrek / XV", 2016).isEmpty()) + assertTrue(engine("Forester", 2016).none { it.confirmed }) + // Everything else stays confirmed. + assertTrue(EnhancedReadings.ALL.filter { !it.id.startsWith("subaru.") || it.header != "7E0" }.all { it.confirmed }) + // Oil temperature: the Forester/WRX number first, then the Ascent's; it counts once. + val tried = EnhancedReadings.forCar("Subaru", "Ascent", 2020) + assertEquals(listOf("2210AF", "229D5C"), tried.filter { it.id == "subaru.oil_temp" }.map { it.request }) + assertEquals(21, EnhancedReadings.known(tried)) + fun at(id: String) = tried.first { it.id == id } + assertEquals(90.0, at("subaru.oil_temp").decode(intArrayOf(130))!!, 1e-9) + assertEquals(-2.5, at("subaru.knock").decode(intArrayOf(118))!!, 1e-9) + assertEquals(17.5, at("subaru.cam_right").decode(intArrayOf(35))!!, 1e-9) + assertEquals(40.0, at("subaru.fuel_pump").decode(intArrayOf(102))!!, 1e-9) + assertEquals(3.0, at("subaru.roughness2").decode(intArrayOf(3))!!, 1e-9) + assertEquals("-2.50 °", at("subaru.knock").format(-2.5)) + } + @Test fun gmTransmissionTemperature() { listOf("Chevrolet" to "Silverado 1500", "Holden" to "Commodore", "GMC" to "Sierra 1500", "Cadillac" to "Escalade").forEach { (make, model) -> @@ -104,7 +129,7 @@ class EnhancedReadingsTest { @Test fun aReadingUnderSeveralNumbersShowsOnce() { - val tried = EnhancedReadings.forCar("Subaru", "Forester", 2018) + val tried = EnhancedReadings.forCar("Subaru", "Outback", 2018) assertEquals(8, EnhancedReadings.known(tried)) // The car answers the temperature under two numbers and the ratio under one: two readings, the first number's value. val first = tried.first { it.id == "subaru.trans_temp" } From b637483c592aff6f1b98abb15a905f8a385cee86 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 05:29:52 +0000 Subject: [PATCH 05/10] 2.5.23: changelog date Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iBpQoZ1YYqwwUyfcpJpti --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5a14207f..7e0cffea4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ Every change to OBD2 Reader, newest first. Each GitHub release shows the entry for its version. -## 2.5.23 (29 November 2026) +## 2.5.23 (30 November 2026) - **More Subaru CVT and all-wheel-drive readings.** Enhanced diagnostics now reads, from Subaru's transmission computer, the CVT ratio, the primary and secondary pulley speeds, the torque converter's turbine speed and lock-up duty, and the all-wheel-drive clutch duty, along with the transmission fluid temperature. - **Subaru transmission temperature on more cars.** It was only asked for where the 2023 and later Outback keeps it, so many 2013–2022 CVT Subarus may not have shown it. Owners have found these readings under different numbers on different Subarus, so the app now tries each number known and shows the first your car answers. Like the other manufacturer readings, they come from owners testing them on their own cars rather than from Subaru, and the app says so. - **Subaru engine readings, marked unconfirmed.** On the 2014 and later Forester and WRX and the Ascent, Enhanced diagnostics also tries engine oil temperature, a roughness (misfire) monitor for each cylinder, knock correction, cam timing advance on each bank, turbo wastegate, fuel pump and alternator duty, 12 V battery temperature and radiator fan duty. They've only been seen in one owner-made list so far, so the app marks them unconfirmed until they're checked on more cars. Target boost and injector pulse width were left out because their scaling didn't add up. From 126003b026171d0c48c487c825515c92a65a6dec Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 05:33:30 +0000 Subject: [PATCH 06/10] 2.5.23: keep the odometer out of shared adapter logs Unless Hide VIN shows it in full, scrubLog now replaces replies to odometer requests (standard PID A6 alone or in a batch, and the makers' 22DD01, 2128, 222006, B903) and masks the plain-English mileage lines. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iBpQoZ1YYqwwUyfcpJpti --- CHANGELOG.md | 1 + .../java/com/obdreader/app/obd/VinPrivacy.kt | 31 +++++++++++++++---- .../com/obdreader/app/obd/VinPrivacyTest.kt | 29 +++++++++++++++++ 3 files changed, 55 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e0cffea4..1fd40eb1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Every change to OBD2 Reader, newest first. Each GitHub release shows the entry f - **Subaru engine readings, marked unconfirmed.** On the 2014 and later Forester and WRX and the Ascent, Enhanced diagnostics also tries engine oil temperature, a roughness (misfire) monitor for each cylinder, knock correction, cam timing advance on each bank, turbo wastegate, fuel pump and alternator duty, 12 V battery temperature and radiator fan duty. They've only been seen in one owner-made list so far, so the app marks them unconfirmed until they're checked on more cars. Target boost and injector pulse width were left out because their scaling didn't add up. - **Transmission temperature for GM and Holden.** Enhanced diagnostics now shows the transmission fluid temperature on Chevrolet, GMC, Holden, Buick, Cadillac, Pontiac, Saturn and Hummer cars that give it, from the transmission computer or the engine computer, whichever answers. GM and Holden cars had no manufacturer readings before. - **Transmission temperature for Toyota, Lexus and older Fords.** Toyota and Lexus automatics now show the transmission fluid temperature, and the torque converter's where the car gives it. Fords that don't answer the transmission temperature the app already asked for, such as the 2002–2010 Explorer, are now asked under the number they use. +- **The odometer stays out of shared adapter logs.** Unless Hide VIN is set to show it in full, an adapter log you share or save, and the crash report, now leave out the odometer reading as well as the VIN, from the standard request and from Ford's, Toyota's, Renault's and older Volvos' own. ## 2.5.22 (29 November 2026) - **More standard readings.** 24 more readings from the OBD2 standard, shown on cars that report them, to graph or put on the Dashboard: absolute engine load, the mixture the engine computer is aiming for, relative and secondary throttle positions, accelerator pedal positions, the commanded throttle, fuel injection timing, engine friction torque, cylinder fuel rate, the gear ratio the gearbox is in, the odometer (in km or miles), AdBlue dosing, and the current of wide-band oxygen sensors that report one. Readings whose scaling isn't published openly, such as turbo speed, boost control, the diesel particulate filter and the NOx sensor, are still left out rather than guessed. diff --git a/app/src/main/java/com/obdreader/app/obd/VinPrivacy.kt b/app/src/main/java/com/obdreader/app/obd/VinPrivacy.kt index cc3f7f7e7..d08090436 100644 --- a/app/src/main/java/com/obdreader/app/obd/VinPrivacy.kt +++ b/app/src/main/java/com/obdreader/app/obd/VinPrivacy.kt @@ -12,8 +12,8 @@ object VinPrivacy { enum class Mode(val key: String, val label: String, val help: String) { FULL("full", "Show it in full", "The whole VIN, on screen and in what you share."), - PARTIAL("partial", "Hide the last 6 characters", "The last 6, your car's serial number, are hidden. The rest still says the maker, model year and factory. Tap the VIN to see all of it on screen."), - HIDDEN("hidden", "Hide it completely", "No VIN in anything you share, and on screen only when you tap it."), + PARTIAL("partial", "Hide the last 6 characters", "The last 6, your car's serial number, are hidden. The rest still says the maker, model year and factory. Tap the VIN to see all of it on screen. Adapter logs you share leave out the odometer too."), + HIDDEN("hidden", "Hide it completely", "No VIN in anything you share, and on screen only when you tap it. Adapter logs you share leave out the odometer too."), } /** Hidden unless the user chooses otherwise (George, 2026-11-12), so nothing on screen or shared identifies the car. */ @@ -67,25 +67,44 @@ object VinPrivacy { /** * The adapter log with the VIN taken out: the raw replies to VIN requests (they spell it out in - * hex) are replaced, and the VIN in any other line is masked. + * hex) are replaced, and the VIN in any other line is masked. The odometer goes too (George, + * 2026-11-30): a VIN and a mileage together say a lot about one car, so replies to odometer + * requests are replaced and the plain-English mileage lines say "hidden". */ fun scrubLog(lines: List, mode: Mode, known: Collection = emptyList()): List { if (mode == Mode.FULL) return lines return lines.map { line -> if (isVinRequest(line)) return@map scrub(line.substringBefore(REPLY), mode, known) + REPLY + "(reply hidden: it holds the VIN)" + if (isOdometerRequest(line)) return@map scrub(line.substringBefore(REPLY), mode, known) + REPLY + "(reply hidden: it holds the odometer)" val at = line.indexOf(REPLY) if (line.startsWith(">") && at >= 0) scrub(line.substring(0, at), mode, known) + REPLY + scrub(line.substring(at + REPLY.length), mode, known, hexVins = false) - else scrub(line, mode, known) + else MILEAGE.replace(scrub(line, mode, known)) { "${it.groupValues[1]}: hidden" } } } + /** The plain-English lines that give the mileage: "Odometer: 84,213 km", "Instrument cluster mileage: 84213 km". */ + private val MILEAGE = Regex("(Odometer|Instrument cluster mileage): [0-9][0-9,.]*(?: ?(?:km|mi|miles))?") + + /** The makers' odometer requests the app sends: Ford (22 DD01), Toyota (21 28), Renault (22 2006) and Volvo's cluster (B9 03). */ + private val ODOMETER_REQUESTS = setOf("22DD01", "2128", "222006", VolvoD3B0.READ_MILEAGE, VolvoD3B0.READ_MILEAGE_PADDED) + + /** A logged exchange that asks for the odometer: one of [ODOMETER_REQUESTS], or a standard request that includes PID A6, alone or with others. */ + private fun isOdometerRequest(line: String): Boolean { + val cmd = command(line) ?: return false + if (cmd in ODOMETER_REQUESTS) return true + return cmd.startsWith("01") && cmd.length >= 4 && cmd.length % 2 == 0 && "A6" in cmd.drop(2).chunked(2) + } + + /** The command of a logged exchange ("> 01 A6 < ..." gives "01A6"), or null for any other line. */ + private fun command(line: String): String? = + if (!line.startsWith(">")) null else line.removePrefix(">").substringBefore("<").replace(" ", "").uppercase(java.util.Locale.US) + /** Where a logged request ends and the car's reply starts. */ private const val REPLY = " < " /** A logged exchange that asks for a VIN: the engine computer's (09 02), or a module's (UDS 22 F190, KWP2000 1A 90). */ private fun isVinRequest(line: String): Boolean { - if (!line.startsWith(">")) return false - val cmd = line.removePrefix(">").substringBefore("<").replace(" ", "").uppercase(java.util.Locale.US) + val cmd = command(line) ?: return false return cmd == "0902" || cmd == "22F190" || cmd == "1A90" } } diff --git a/app/src/test/java/com/obdreader/app/obd/VinPrivacyTest.kt b/app/src/test/java/com/obdreader/app/obd/VinPrivacyTest.kt index 2ae126310..7249f409e 100644 --- a/app/src/test/java/com/obdreader/app/obd/VinPrivacyTest.kt +++ b/app/src/test/java/com/obdreader/app/obd/VinPrivacyTest.kt @@ -81,4 +81,33 @@ class VinPrivacyTest { assertFalse(out.any { demoVin in it }) assertFalse(out.any { demoVin.takeLast(6) in it }) } + + @Test fun adapterLogLosesTheOdometer() { + val log = listOf( + "> 01A6 < 41A60032D0A4", + "= Odometer: 333,343 km", + "> 010C0DA6 < 0: 41 0C 1A F8 0D | 1: 3C A6 00 32 D0 A4", + "= Engine RPM: 1,726 rpm, Vehicle speed: 60 km/h, Odometer: 333,343.6 km", + "> 22DD01 < 62DD01051615", + "> 2128 < 612805161500", + "> B903 < 7 B9 03 12 34", + "= Instrument cluster mileage: 84213 km", + "> 010C < 410C1AF8", + "> 22A6 < 7F2231", + ) + val out = VinPrivacy.scrubLog(log, VinPrivacy.Mode.PARTIAL) + assertEquals("> 01A6 < (reply hidden: it holds the odometer)", out[0]) + assertEquals("= Odometer: hidden", out[1]) + assertEquals("> 010C0DA6 < (reply hidden: it holds the odometer)", out[2]) + assertEquals("= Engine RPM: 1,726 rpm, Vehicle speed: 60 km/h, Odometer: hidden", out[3]) + assertEquals("> 22DD01 < (reply hidden: it holds the odometer)", out[4]) + assertEquals("> 2128 < (reply hidden: it holds the odometer)", out[5]) + assertEquals("> B903 < (reply hidden: it holds the odometer)", out[6]) + assertEquals("= Instrument cluster mileage: hidden", out[7]) + // Other readings, and A6 bytes that aren't the standard odometer request, stay as they are. + assertEquals(log[8], out[8]) + assertEquals(log[9], out[9]) + assertEquals(VinPrivacy.scrubLog(log, VinPrivacy.Mode.HIDDEN)[0], out[0]) + assertTrue(VinPrivacy.scrubLog(log, VinPrivacy.Mode.FULL) == log) + } } From 7a1405b5a81fcd9917fe7580aa1d8b63ded1c619 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 05:39:26 +0000 Subject: [PATCH 07/10] 2.5.23 review fixes: odometer out of reply recordings, wording, tour shots of unconfirmed readings - ReplyRecording hides replies to odometer requests unless Hide VIN is full (VinPrivacy.isOdometerCommand shared with scrubLog); replay answers NO DATA. - Wording: 12-volt, 'Misfire (roughness), cylinder N', shorter unconfirmed note, Hide VIN help mentions crash reports. - TCM constant moved next to PCM. - Debug-only demo_car extra and demo answers for a Subaru, so the tour shoots Enhanced diagnostics with unconfirmed readings in Pit lane and Asphalt. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iBpQoZ1YYqwwUyfcpJpti --- .github/scripts/install-test.sh | 34 +++++++++++++++++++ CHANGELOG.md | 2 +- .../java/com/obdreader/app/MainActivity.kt | 2 +- .../main/java/com/obdreader/app/MainCar.kt | 16 +++++++++ .../com/obdreader/app/obd/DemoTransport.kt | 5 +++ .../com/obdreader/app/obd/EnhancedReadings.kt | 18 +++++----- .../com/obdreader/app/obd/ReplyRecording.kt | 9 +++-- .../java/com/obdreader/app/obd/VinPrivacy.kt | 13 ++++--- app/src/main/res/values/strings.xml | 2 +- .../obdreader/app/obd/ReplyRecordingTest.kt | 22 ++++++++++++ 10 files changed, 104 insertions(+), 19 deletions(-) diff --git a/.github/scripts/install-test.sh b/.github/scripts/install-test.sh index d025dee68..335b0ec43 100755 --- a/.github/scripts/install-test.sh +++ b/.github/scripts/install-test.sh @@ -678,6 +678,40 @@ if adb shell dumpsys package $PKG 2>/dev/null | grep -m1 "pkgFlags=" | grep -q D crash_window "Pit lane"; crash_window "Asphalt" connect_demo || log "connected after crash window: FAILED (no Demo car)" fi +# Unconfirmed readings in Enhanced diagnostics, for the design check: debug builds can be given a +# car without the car sheet (demo_car). A 2018 Forester gets the unconfirmed engine readings, and +# the demo answers its CVT temperature (confirmed) and its oil temperature and knock (unconfirmed). +enhanced_unconfirmed() { # $1 style + local slug; slug=$(echo "$1" | tr ' A-Z' '-a-z') + app_front; disconnect_app; close_trip || true + if tap_text "Style"; then sleep 1; for i in 1 2 3 4 5 6; do tap_text "$1" && break; adb shell input swipe 540 1800 540 700 300; sleep 1; done; sleep 3; fi + adb shell am force-stop $PKG; sleep 2 + timeout 60 adb shell am start -W -n $PKG/.HomeActivity --es demo_car "Subaru|2018|Forester" > /dev/null 2>&1; sleep 4 + connect_demo || { log "enhanced unconfirmed ($1): FAILED (no Demo car)"; FAIL=1; return; } + local ok=0 + diag_top + adb logcat -c + if tap_scrolled "Enhanced diagnostics"; then + for i in $(seq 1 15); do + adb logcat -d -s OBD2Deep:I > "$OUT/deep-unconfirmed-$slug.txt" 2>/dev/null + grep -Eq "enhanced: .*Engine oil temperature=90 °C.*Knock correction=" "$OUT/deep-unconfirmed-$slug.txt" && { ok=1; break; }; sleep 2 + done + sleep 2; shot "13-enhanced-unconfirmed-$slug" + adb shell uiautomator dump /sdcard/ui.xml > /dev/null 2>&1; adb shell cat /sdcard/ui.xml > "$OUT/ui-unconfirmed-$slug.xml" 2>/dev/null + adb shell input swipe 540 1800 540 900 300; sleep 1; shot "13-enhanced-unconfirmed-$slug-2" + adb shell input keyevent KEYCODE_BACK; sleep 2 + fi + if [ $ok = 1 ] && grep -q "unconfirmed" "$OUT/ui-unconfirmed-$slug.xml"; then log "enhanced unconfirmed ($1): shown" + else log "enhanced unconfirmed ($1): FAILED ($(tail -1 "$OUT/deep-unconfirmed-$slug.txt" 2>/dev/null | cut -c1-120))"; FAIL=1; fi +} +if adb shell dumpsys package $PKG 2>/dev/null | grep -m1 "pkgFlags=" | grep -q DEBUGGABLE; then + enhanced_unconfirmed "Pit lane"; enhanced_unconfirmed "Asphalt" + # Back to no car chosen, as the rest of the tour expects. + app_front; disconnect_app; close_trip || true + adb shell am force-stop $PKG; sleep 2 + timeout 60 adb shell am start -W -n $PKG/.HomeActivity --es demo_car "" > /dev/null 2>&1; sleep 4 + connect_demo || log "connected after unconfirmed readings: FAILED (no Demo car)" +fi adb shell am start -n $PKG/.HomeActivity --ei demo_speed 0 > /dev/null 2>&1; sleep 2 # back to normal driving # A longer drive, then Disconnect: the trip summary should sum it up. sleep 35 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fd40eb1f..796cc82bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ Every change to OBD2 Reader, newest first. Each GitHub release shows the entry f - **Subaru engine readings, marked unconfirmed.** On the 2014 and later Forester and WRX and the Ascent, Enhanced diagnostics also tries engine oil temperature, a roughness (misfire) monitor for each cylinder, knock correction, cam timing advance on each bank, turbo wastegate, fuel pump and alternator duty, 12 V battery temperature and radiator fan duty. They've only been seen in one owner-made list so far, so the app marks them unconfirmed until they're checked on more cars. Target boost and injector pulse width were left out because their scaling didn't add up. - **Transmission temperature for GM and Holden.** Enhanced diagnostics now shows the transmission fluid temperature on Chevrolet, GMC, Holden, Buick, Cadillac, Pontiac, Saturn and Hummer cars that give it, from the transmission computer or the engine computer, whichever answers. GM and Holden cars had no manufacturer readings before. - **Transmission temperature for Toyota, Lexus and older Fords.** Toyota and Lexus automatics now show the transmission fluid temperature, and the torque converter's where the car gives it. Fords that don't answer the transmission temperature the app already asked for, such as the 2002–2010 Explorer, are now asked under the number they use. -- **The odometer stays out of shared adapter logs.** Unless Hide VIN is set to show it in full, an adapter log you share or save, and the crash report, now leave out the odometer reading as well as the VIN, from the standard request and from Ford's, Toyota's, Renault's and older Volvos' own. +- **The odometer stays out of shared adapter logs.** Unless Hide VIN is set to show it in full, an adapter log or reply recording you share or save, and the crash report, now leave out the odometer reading as well as the VIN, from the standard request and from Ford's, Toyota's, Renault's and older Volvos' own. ## 2.5.22 (29 November 2026) - **More standard readings.** 24 more readings from the OBD2 standard, shown on cars that report them, to graph or put on the Dashboard: absolute engine load, the mixture the engine computer is aiming for, relative and secondary throttle positions, accelerator pedal positions, the commanded throttle, fuel injection timing, engine friction torque, cylinder fuel rate, the gear ratio the gearbox is in, the odometer (in km or miles), AdBlue dosing, and the current of wide-band oxygen sensors that report one. Readings whose scaling isn't published openly, such as turbo speed, boost control, the diesel particulate filter and the NOx sensor, are still left out rather than guessed. diff --git a/app/src/main/java/com/obdreader/app/MainActivity.kt b/app/src/main/java/com/obdreader/app/MainActivity.kt index 16cf3bf0a..50bb4637c 100644 --- a/app/src/main/java/com/obdreader/app/MainActivity.kt +++ b/app/src/main/java/com/obdreader/app/MainActivity.kt @@ -511,7 +511,7 @@ open class MainActivity : AppCompatActivity() { if (savedInstanceState == null) Exports.cleanUp(this) // shared reports and logs are temporary copies com.obdreader.app.session.CrashCatcher.install(this) // The app closed unexpectedly last time: offer the report (after the clean-up above, which would delete its copy). - if (savedInstanceState == null) { crashReportDemoIfAsked(intent); offerCrashReport() } + if (savedInstanceState == null) { demoCarIfAsked(intent); crashReportDemoIfAsked(intent); offerCrashReport() } bottomNav.setOnItemSelectedListener { item -> showPage(item.itemId) diff --git a/app/src/main/java/com/obdreader/app/MainCar.kt b/app/src/main/java/com/obdreader/app/MainCar.kt index 978fd41e1..14672a08f 100644 --- a/app/src/main/java/com/obdreader/app/MainCar.kt +++ b/app/src/main/java/com/obdreader/app/MainCar.kt @@ -73,6 +73,22 @@ internal fun MainActivity.updateCarSetting() { carSetting.text = car?.label ?: getString(R.string.car_not_set) findViewById(R.id.carExpect).visibility = if (car != null && CarSupport.expectations(car).isNotEmpty()) View.VISIBLE else View.GONE } +/** + * Debug builds: the test tour chooses a car without the car sheet ("Subaru|2018|Forester"), so it + * can check readings only some cars get, or clears it again (""). Release builds ignore it. + */ +internal fun MainActivity.demoCarIfAsked(intent: android.content.Intent?) { + if ((applicationInfo.flags and android.content.pm.ApplicationInfo.FLAG_DEBUGGABLE) == 0 || intent?.hasExtra("demo_car") != true) return + val parts = intent.getStringExtra("demo_car").orEmpty().split("|") + intent.removeExtra("demo_car") + val year = parts.getOrNull(1)?.toIntOrNull() + val edit = prefs.edit().remove(PREF_LAST_PROTOCOL).remove(PREF_CAR_ENGINE) + if (parts[0].isNotBlank() && year != null) edit.putString(PREF_CAR_MAKE, parts[0]).putInt(PREF_CAR_YEAR, year).putString(PREF_CAR_MODEL, parts.getOrNull(2)) + else edit.remove(PREF_CAR_MAKE).remove(PREF_CAR_YEAR).remove(PREF_CAR_MODEL) + edit.apply() + updateCarSetting() + applyRedline() +} /** No car chosen yet, and the user hasn't said theirs isn't listed. */ internal fun MainActivity.needsCar(): Boolean = savedCar() == null && !prefs.getBoolean(PREF_CAR_ASKED, false) internal fun MainActivity.showCarPicker(firstRun: Boolean = false, prefill: VehicleCatalog.Car? = null, onDone: (() -> Unit)? = null) { diff --git a/app/src/main/java/com/obdreader/app/obd/DemoTransport.kt b/app/src/main/java/com/obdreader/app/obd/DemoTransport.kt index 9954ed00c..7cfda71b6 100644 --- a/app/src/main/java/com/obdreader/app/obd/DemoTransport.kt +++ b/app/src/main/java/com/obdreader/app/obd/DemoTransport.kt @@ -236,6 +236,11 @@ class DemoTransport( return when { engine && did == "1E1C" -> two(((70 + min(12.0, seconds() / 20)) * 16).toInt()) engine && did == "054B" -> "41" + // A Subaru (the tour's unconfirmed-readings check): CVT fluid 85 °C on the transmission + // computer, and two of the unconfirmed engine readings, oil 90 °C and knock -1.5°. + h == "7E1" && did == "10D2" -> "87" + engine && did == "10AF" -> "82" + engine && did == "3018" -> "7A" h == "726" && did == "DD01" -> "01E240" h == "726" && did == "4028" -> "55" h == "726" && did == "4029" -> "41" diff --git a/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt b/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt index 4ecea74c1..2c884806f 100644 --- a/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt +++ b/app/src/main/java/com/obdreader/app/obd/EnhancedReadings.kt @@ -57,6 +57,7 @@ object EnhancedReadings { private fun replyFor(h: String): String = String.format(Locale.US, "%03X", h.toInt(16) + 8) private const val PCM = "Engine computer" + private const val TCM = "Transmission" /** Ford's (and the Ford-built Mazdas') engine computer and body module. */ private val FORD = listOf( @@ -71,8 +72,8 @@ object EnhancedReadings { r("ford.fuel_pump", "Fuel pump duty", PCM, "7E0", "220307", "%", 0) { b -> u(b, 0, 1)?.times(100)?.div(255) }, r("ford.wastegate", "Turbo wastegate", PCM, "7E0", "220462", "%", 0) { b -> u(b, 0, 1)?.times(100)?.div(128) }, r("ford.odometer", "Odometer", "Body module", "726", "22DD01", "km", 0) { b -> u(b, 0, 3) }, - r("ford.batt_charge", "12 V battery charge", "Body module", "726", "224028", "%", 0) { b -> u(b, 0, 1) }, - r("ford.batt_temp", "12 V battery temperature", "Body module", "726", "224029", "°C", 0) { b -> u(b, 0, 1)?.minus(40) }, + r("ford.batt_charge", "12-volt battery charge", "Body module", "726", "224028", "%", 0) { b -> u(b, 0, 1) }, + r("ford.batt_temp", "12-volt battery temperature", "Body module", "726", "224029", "°C", 0) { b -> u(b, 0, 1)?.minus(40) }, ) private val TOYOTA = listOf( @@ -87,7 +88,6 @@ object EnhancedReadings { r("toyota.converter_temp", "Torque converter fluid temperature", PCM, "7E0", "2182", "°C", 0) { b -> u(b, 2, 2)?.let { it / 256 - 40 } }, ) - private const val TCM = "Transmission" /** * Subaru's CVT (Lineartronic) and all-wheel-drive readings. Owners have found them under different @@ -126,7 +126,7 @@ object EnhancedReadings { r("leaf.soc", "Battery charge (state of charge)", "Battery controller", "79B", "2101", "%", 1) { b -> u(b, 34, 3)?.div(10000) }, r("leaf.capacity", "Battery capacity", "Battery controller", "79B", "2101", "Ah", 1) { b -> u(b, 39, 3)?.div(10000) }, r("leaf.hv_volts", "Battery voltage", "Battery controller", "79B", "2101", "V", 1) { b -> u(b, 22, 2)?.div(100) }, - r("leaf.lv_volts", "12 V battery", "Battery controller", "79B", "2101", "V", 2) { b -> u(b, 24, 2)?.div(1000) }, + r("leaf.lv_volts", "12-volt battery", "Battery controller", "79B", "2101", "V", 2) { b -> u(b, 24, 2)?.div(1000) }, r("leaf.temp1", "Battery temperature", "Battery controller", "79B", "2104", "°C", 0) { b -> s(b, 3, 1) }, ).map { it.copy(reply = "7BB") } @@ -147,17 +147,17 @@ object EnhancedReadings { private val SUBARU_ENGINE = listOf( r("subaru.oil_temp", "Engine oil temperature", PCM, "7E0", "2210AF", "°C", 0) { b -> u(b, 0, 1)?.minus(40) }, r("subaru.oil_temp", "Engine oil temperature", PCM, "7E0", "229D5C", "°C", 0) { b -> u(b, 0, 1)?.minus(40) }, - r("subaru.roughness1", "Roughness monitor, cylinder 1", PCM, "7E0", "223062", "", 0) { b -> u(b, 0, 1) }, - r("subaru.roughness2", "Roughness monitor, cylinder 2", PCM, "7E0", "223048", "", 0) { b -> u(b, 0, 1) }, - r("subaru.roughness3", "Roughness monitor, cylinder 3", PCM, "7E0", "223068", "", 0) { b -> u(b, 0, 1) }, - r("subaru.roughness4", "Roughness monitor, cylinder 4", PCM, "7E0", "22304A", "", 0) { b -> u(b, 0, 1) }, + r("subaru.roughness1", "Misfire (roughness), cylinder 1", PCM, "7E0", "223062", "", 0) { b -> u(b, 0, 1) }, + r("subaru.roughness2", "Misfire (roughness), cylinder 2", PCM, "7E0", "223048", "", 0) { b -> u(b, 0, 1) }, + r("subaru.roughness3", "Misfire (roughness), cylinder 3", PCM, "7E0", "223068", "", 0) { b -> u(b, 0, 1) }, + r("subaru.roughness4", "Misfire (roughness), cylinder 4", PCM, "7E0", "22304A", "", 0) { b -> u(b, 0, 1) }, r("subaru.knock", "Knock correction", PCM, "7E0", "223018", "°", 2) { b -> u(b, 0, 1)?.let { it / 4 - 32 } }, r("subaru.cam_right", "Cam timing advance, right bank", PCM, "7E0", "221099", "°", 1) { b -> u(b, 0, 1)?.div(2) }, r("subaru.cam_left", "Cam timing advance, left bank", PCM, "7E0", "2210B9", "°", 1) { b -> u(b, 0, 1)?.div(2) }, r("subaru.wastegate", "Turbo wastegate duty", PCM, "7E0", "2210C9", "%", 0) { b -> u(b, 0, 1) }, r("subaru.fuel_pump", "Fuel pump duty", PCM, "7E0", "2210B3", "%", 0) { b -> u(b, 0, 1)?.times(100)?.div(255) }, r("subaru.alternator", "Alternator duty", PCM, "7E0", "221093", "%", 0) { b -> u(b, 0, 1) }, - r("subaru.battery_temp", "12 V battery temperature", PCM, "7E0", "22309A", "°C", 0) { b -> u(b, 0, 1)?.minus(40) }, + r("subaru.battery_temp", "12-volt battery temperature", PCM, "7E0", "22309A", "°C", 0) { b -> u(b, 0, 1)?.minus(40) }, r("subaru.fan", "Radiator fan duty", PCM, "7E0", "2210E3", "%", 0) { b -> u(b, 0, 1) }, ).map { it.copy(confirmed = false) } diff --git a/app/src/main/java/com/obdreader/app/obd/ReplyRecording.kt b/app/src/main/java/com/obdreader/app/obd/ReplyRecording.kt index 58a18c0c8..6ac9299e2 100644 --- a/app/src/main/java/com/obdreader/app/obd/ReplyRecording.kt +++ b/app/src/main/java/com/obdreader/app/obd/ReplyRecording.kt @@ -28,7 +28,8 @@ import java.util.Locale * * Each request starts with "> ", each line of its reply with "< ", and "! no reply" marks a request * the adapter didn't answer in time. Replies that hold the VIN are replaced with "(VIN hidden)", - * and modules' serial numbers with "(serial number hidden)", unless Hide VIN is set to show it in full. + * modules' serial numbers with "(serial number hidden)" and the odometer with "(odometer hidden)", + * unless Hide VIN is set to show it in full. */ object ReplyRecording { @@ -69,6 +70,9 @@ object ReplyRecording { private val SERIAL_REQUESTS = setOf("22F18C", "1A8C") const val SERIAL_HIDDEN = "(serial number hidden)" + /** Replies to odometer requests ([VinPrivacy.isOdometerCommand]): hidden like the VIN, so replay gets no answer for them. */ + const val ODOMETER_HIDDEN = "(odometer hidden)" + fun normalize(command: String): String = command.replace(" ", "").uppercase(Locale.US) /** True when this reply has to be hidden: it answers a VIN request, or its bytes spell a VIN. */ @@ -121,6 +125,7 @@ object ReplyRecording { lines == null -> appendLine(NO_REPLY) !showVin && holdsVin(x.command, lines, known) -> appendLine("< $VIN_HIDDEN") !showVin && normalize(x.command) in SERIAL_REQUESTS -> appendLine("< $SERIAL_HIDDEN") + !showVin && VinPrivacy.isOdometerCommand(x.command) -> appendLine("< $ODOMETER_HIDDEN") else -> lines.take(MAX_REPLY_LINES).forEach { appendLine("< ${clean(it, MAX_LINE)}") } } } @@ -322,7 +327,7 @@ class ReplayTransport(val recording: ReplyRecording.Recording, val label: String val list = replies[k] val lines: List? = if (!list.isNullOrEmpty()) take(k, list) else combined(c) ?: fallback(c) if (lines == null) throw AdapterTimeoutException("No reply to '$c' in the recording") - val shown = lines.map { if (it == ReplyRecording.VIN_HIDDEN || it == ReplyRecording.SERIAL_HIDDEN) "NO DATA" else it } + val shown = lines.map { if (it == ReplyRecording.VIN_HIDDEN || it == ReplyRecording.SERIAL_HIDDEN || it == ReplyRecording.ODOMETER_HIDDEN) "NO DATA" else it } return shown.joinToString("\r") + "\r\r" } diff --git a/app/src/main/java/com/obdreader/app/obd/VinPrivacy.kt b/app/src/main/java/com/obdreader/app/obd/VinPrivacy.kt index d08090436..f3f21da84 100644 --- a/app/src/main/java/com/obdreader/app/obd/VinPrivacy.kt +++ b/app/src/main/java/com/obdreader/app/obd/VinPrivacy.kt @@ -12,8 +12,8 @@ object VinPrivacy { enum class Mode(val key: String, val label: String, val help: String) { FULL("full", "Show it in full", "The whole VIN, on screen and in what you share."), - PARTIAL("partial", "Hide the last 6 characters", "The last 6, your car's serial number, are hidden. The rest still says the maker, model year and factory. Tap the VIN to see all of it on screen. Adapter logs you share leave out the odometer too."), - HIDDEN("hidden", "Hide it completely", "No VIN in anything you share, and on screen only when you tap it. Adapter logs you share leave out the odometer too."), + PARTIAL("partial", "Hide the last 6 characters", "The last 6, your car's serial number, are hidden. The rest still says the maker, model year and factory. Tap the VIN to see all of it on screen. Adapter logs and crash reports you share leave out the odometer too."), + HIDDEN("hidden", "Hide it completely", "No VIN in anything you share, and on screen only when you tap it. Adapter logs and crash reports you share leave out the odometer too."), } /** Hidden unless the user chooses otherwise (George, 2026-11-12), so nothing on screen or shared identifies the car. */ @@ -88,13 +88,16 @@ object VinPrivacy { /** The makers' odometer requests the app sends: Ford (22 DD01), Toyota (21 28), Renault (22 2006) and Volvo's cluster (B9 03). */ private val ODOMETER_REQUESTS = setOf("22DD01", "2128", "222006", VolvoD3B0.READ_MILEAGE, VolvoD3B0.READ_MILEAGE_PADDED) - /** A logged exchange that asks for the odometer: one of [ODOMETER_REQUESTS], or a standard request that includes PID A6, alone or with others. */ - private fun isOdometerRequest(line: String): Boolean { - val cmd = command(line) ?: return false + /** A request ("01A6", "010C0DA6", "22DD01") that asks for the odometer: one of [ODOMETER_REQUESTS], or a standard request that includes PID A6, alone or with others. */ + fun isOdometerCommand(command: String): Boolean { + val cmd = command.replace(" ", "").uppercase(java.util.Locale.US) if (cmd in ODOMETER_REQUESTS) return true return cmd.startsWith("01") && cmd.length >= 4 && cmd.length % 2 == 0 && "A6" in cmd.drop(2).chunked(2) } + /** A logged exchange that asks for the odometer. */ + private fun isOdometerRequest(line: String): Boolean = command(line)?.let(::isOdometerCommand) ?: false + /** The command of a logged exchange ("> 01 A6 < ..." gives "01A6"), or null for any other line. */ private fun command(line: String): String? = if (!line.startsWith(">")) null else line.removePrefix(">").substringBefore("<").replace(" ", "").uppercase(java.util.Locale.US) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1b2f4bc07..7e1d8f037 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -200,7 +200,7 @@ Enhanced diagnostics Readings your car\'s maker added beyond standard OBD2, like transmission temperature and oil life, live, plus each module\'s part numbers and software versions. %1$s · unconfirmed - Readings marked unconfirmed have been seen in only one owner-made list and haven\'t been checked on a second car yet, so treat them as a rough guide. + Readings marked unconfirmed come from one owner\'s list and haven\'t been checked on a second car yet, so treat them as a rough guide. These readings come from owners testing them on their own cars, not from the maker, so check one against your car before relying on it. EV battery Hybrids and electric cars: the high-voltage battery\'s charge, plus how fast it\'s charging, with a graph. diff --git a/app/src/test/java/com/obdreader/app/obd/ReplyRecordingTest.kt b/app/src/test/java/com/obdreader/app/obd/ReplyRecordingTest.kt index abc0ba73a..18e23775f 100644 --- a/app/src/test/java/com/obdreader/app/obd/ReplyRecordingTest.kt +++ b/app/src/test/java/com/obdreader/app/obd/ReplyRecordingTest.kt @@ -101,6 +101,28 @@ class ReplyRecordingTest { assertEquals(listOf("NO DATA"), ElmParser.cleanLines(r.exchange("22F18C", 1000), "22F18C")) } + @Test + fun odometerRepliesAreHidden() { + val rec = ReplyRecording.Recording(null, null, null, listOf( + ReplyRecording.Exchange("ATSH7E0", listOf("OK")), + ReplyRecording.Exchange("01A6", listOf("41A60032D0A4")), + ReplyRecording.Exchange("010CA6", listOf("410C1AF8A60032D0A4")), + ReplyRecording.Exchange("2128", listOf("612805161500")), + ReplyRecording.Exchange("010C", listOf("410C1AF8")), + )) + val hidden = ReplyRecording.encode(rec, showVin = false) + assertTrue(hidden.contains("> 01A6\n< ${ReplyRecording.ODOMETER_HIDDEN}\n")) + assertTrue(hidden.contains("> 010CA6\n< ${ReplyRecording.ODOMETER_HIDDEN}\n")) + assertTrue(hidden.contains("> 2128\n< ${ReplyRecording.ODOMETER_HIDDEN}\n")) + assertTrue(hidden.contains("< 410C1AF8\n")) + assertFalse(hidden.contains("32D0A4")) + assertTrue(ReplyRecording.encode(rec, showVin = true).contains("< 41A60032D0A4")) + val r = ReplayTransport(ReplyRecording.parse(hidden), "test") + r.open() + r.exchange("ATSH7E0", 1000) + assertEquals(listOf("NO DATA"), ElmParser.cleanLines(r.exchange("01A6", 1000), "01A6")) + } + @Test fun aMillionEmptyLinesIsJustEmpty() { parseFails(ReplyRecording.HEADER + "\n".repeat(ReplyRecording.MAX_BYTES - ReplyRecording.HEADER.length - 1), "empty") From 2db0c3288088eebeeae83a30dabb627e259319d7 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 14:49:20 +0000 Subject: [PATCH 08/10] Tour: pass the demo car with commas, not |, which adb's shell treated as a pipe Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iBpQoZ1YYqwwUyfcpJpti --- .github/scripts/install-test.sh | 4 ++-- app/src/main/java/com/obdreader/app/MainCar.kt | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/scripts/install-test.sh b/.github/scripts/install-test.sh index 335b0ec43..aad9b944c 100755 --- a/.github/scripts/install-test.sh +++ b/.github/scripts/install-test.sh @@ -686,7 +686,7 @@ enhanced_unconfirmed() { # $1 style app_front; disconnect_app; close_trip || true if tap_text "Style"; then sleep 1; for i in 1 2 3 4 5 6; do tap_text "$1" && break; adb shell input swipe 540 1800 540 700 300; sleep 1; done; sleep 3; fi adb shell am force-stop $PKG; sleep 2 - timeout 60 adb shell am start -W -n $PKG/.HomeActivity --es demo_car "Subaru|2018|Forester" > /dev/null 2>&1; sleep 4 + timeout 60 adb shell am start -W -n $PKG/.HomeActivity --es demo_car Subaru,2018,Forester > /dev/null 2>&1; sleep 4 connect_demo || { log "enhanced unconfirmed ($1): FAILED (no Demo car)"; FAIL=1; return; } local ok=0 diag_top @@ -709,7 +709,7 @@ if adb shell dumpsys package $PKG 2>/dev/null | grep -m1 "pkgFlags=" | grep -q D # Back to no car chosen, as the rest of the tour expects. app_front; disconnect_app; close_trip || true adb shell am force-stop $PKG; sleep 2 - timeout 60 adb shell am start -W -n $PKG/.HomeActivity --es demo_car "" > /dev/null 2>&1; sleep 4 + timeout 60 adb shell am start -W -n $PKG/.HomeActivity --es demo_car none > /dev/null 2>&1; sleep 4 connect_demo || log "connected after unconfirmed readings: FAILED (no Demo car)" fi adb shell am start -n $PKG/.HomeActivity --ei demo_speed 0 > /dev/null 2>&1; sleep 2 # back to normal driving diff --git a/app/src/main/java/com/obdreader/app/MainCar.kt b/app/src/main/java/com/obdreader/app/MainCar.kt index 14672a08f..10654cb15 100644 --- a/app/src/main/java/com/obdreader/app/MainCar.kt +++ b/app/src/main/java/com/obdreader/app/MainCar.kt @@ -74,12 +74,13 @@ internal fun MainActivity.updateCarSetting() { findViewById(R.id.carExpect).visibility = if (car != null && CarSupport.expectations(car).isNotEmpty()) View.VISIBLE else View.GONE } /** - * Debug builds: the test tour chooses a car without the car sheet ("Subaru|2018|Forester"), so it - * can check readings only some cars get, or clears it again (""). Release builds ignore it. + * Debug builds: the test tour chooses a car without the car sheet ("Subaru,2018,Forester"), so it + * can check readings only some cars get, or clears it again ("none"). Commas, because adb passes the + * extra through a shell, where "|" would split the command. Release builds ignore it. */ internal fun MainActivity.demoCarIfAsked(intent: android.content.Intent?) { if ((applicationInfo.flags and android.content.pm.ApplicationInfo.FLAG_DEBUGGABLE) == 0 || intent?.hasExtra("demo_car") != true) return - val parts = intent.getStringExtra("demo_car").orEmpty().split("|") + val parts = intent.getStringExtra("demo_car").orEmpty().split(",").map { it.trim() } intent.removeExtra("demo_car") val year = parts.getOrNull(1)?.toIntOrNull() val edit = prefs.edit().remove(PREF_LAST_PROTOCOL).remove(PREF_CAR_ENGINE) From b0281756eb0fe2f0eac55e1624c9798d63c43173 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 18:57:21 +0000 Subject: [PATCH 09/10] Tour: reopen Car and connection on Diagnostics when it's closed Choosing a car closes that section on the next start, so the Record and replay row couldn't be found after the unconfirmed readings check. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iBpQoZ1YYqwwUyfcpJpti --- .github/scripts/install-test.sh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/scripts/install-test.sh b/.github/scripts/install-test.sh index aad9b944c..3cba422c7 100755 --- a/.github/scripts/install-test.sh +++ b/.github/scripts/install-test.sh @@ -401,7 +401,29 @@ PY # Scrolls down from where the page is, a little at a time, until a button with this label is on # screen, then taps it (labels come from the view's text or its spoken description). # Diagnostics, scrolled to the very top, so tap_scrolled can work down to any row. -diag_top() { tap_tab Diagnostics; sleep 2; for k in 1 2 3 4 5 6 7 8; do adb shell input swipe 540 700 540 2000 120; done; sleep 1; [ -n "${GROUPS_OPEN:-}" ] || open_groups; } +diag_top() { tap_tab Diagnostics; sleep 2; for k in 1 2 3 4 5 6 7 8; do adb shell input swipe 540 700 540 2000 120; done; sleep 1; [ -n "${GROUPS_OPEN:-}" ] || open_groups; open_car_group; } +# Car and connection starts open only while no car is chosen, so choosing one (or restarting with +# one chosen) can close it again: at the top of Diagnostics, open it if it's closed. +open_car_group() { + local i b moved=0 + for i in 1 2 3 4 5; do + adb shell rm -f /sdcard/ui.xml; adb shell uiautomator dump /sdcard/ui.xml > /dev/null 2>&1; adb shell cat /sdcard/ui.xml > "$OUT/ui-cargroup.xml" 2>/dev/null + grep -q 'Car and connection, expanded' "$OUT/ui-cargroup.xml" && break + b=$(python3 - "$OUT/ui-cargroup.xml" <<'PY' +import re, sys +xml = open(sys.argv[1], encoding='utf-8', errors='ignore').read() +for n in re.findall(r']*>', xml): + if 'content-desc="Car and connection, collapsed"' in n: + x1, y1, x2, y2 = map(int, re.search(r'bounds="\[(\d+),(\d+)\]\[(\d+),(\d+)\]"', n).groups()) + print((x1 + x2) // 2, (y1 + y2) // 2); break +PY +) + [ -n "$b" ] && { adb shell input tap $b; sleep 1; break; } + adb shell input swipe 540 1500 540 1000 300; sleep 1; moved=1 + done + [ $moved = 1 ] && { for k in 1 2 3 4 5 6; do adb shell input swipe 540 700 540 2000 120; done; sleep 1; } + return 0 +} # Diagnostics keeps its settings and checks in sections that start closed. Open every one once # (the app remembers), so later steps find their rows by scrolling, then go back to the top. open_groups() { From da71853c49467fd23056467de0879703bdcbaae3 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 21:20:35 +0000 Subject: [PATCH 10/10] Tour: restart once more with no car after the unconfirmed readings check The debug extra clears the car after Diagnostics has laid out its sections, so Car and connection stayed closed and Record and replay couldn't be found. Drops the per-visit section check added before, which slowed every step. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iBpQoZ1YYqwwUyfcpJpti --- .github/scripts/install-test.sh | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/.github/scripts/install-test.sh b/.github/scripts/install-test.sh index 3cba422c7..0c0ddf423 100755 --- a/.github/scripts/install-test.sh +++ b/.github/scripts/install-test.sh @@ -401,29 +401,7 @@ PY # Scrolls down from where the page is, a little at a time, until a button with this label is on # screen, then taps it (labels come from the view's text or its spoken description). # Diagnostics, scrolled to the very top, so tap_scrolled can work down to any row. -diag_top() { tap_tab Diagnostics; sleep 2; for k in 1 2 3 4 5 6 7 8; do adb shell input swipe 540 700 540 2000 120; done; sleep 1; [ -n "${GROUPS_OPEN:-}" ] || open_groups; open_car_group; } -# Car and connection starts open only while no car is chosen, so choosing one (or restarting with -# one chosen) can close it again: at the top of Diagnostics, open it if it's closed. -open_car_group() { - local i b moved=0 - for i in 1 2 3 4 5; do - adb shell rm -f /sdcard/ui.xml; adb shell uiautomator dump /sdcard/ui.xml > /dev/null 2>&1; adb shell cat /sdcard/ui.xml > "$OUT/ui-cargroup.xml" 2>/dev/null - grep -q 'Car and connection, expanded' "$OUT/ui-cargroup.xml" && break - b=$(python3 - "$OUT/ui-cargroup.xml" <<'PY' -import re, sys -xml = open(sys.argv[1], encoding='utf-8', errors='ignore').read() -for n in re.findall(r']*>', xml): - if 'content-desc="Car and connection, collapsed"' in n: - x1, y1, x2, y2 = map(int, re.search(r'bounds="\[(\d+),(\d+)\]\[(\d+),(\d+)\]"', n).groups()) - print((x1 + x2) // 2, (y1 + y2) // 2); break -PY -) - [ -n "$b" ] && { adb shell input tap $b; sleep 1; break; } - adb shell input swipe 540 1500 540 1000 300; sleep 1; moved=1 - done - [ $moved = 1 ] && { for k in 1 2 3 4 5 6; do adb shell input swipe 540 700 540 2000 120; done; sleep 1; } - return 0 -} +diag_top() { tap_tab Diagnostics; sleep 2; for k in 1 2 3 4 5 6 7 8; do adb shell input swipe 540 700 540 2000 120; done; sleep 1; [ -n "${GROUPS_OPEN:-}" ] || open_groups; } # Diagnostics keeps its settings and checks in sections that start closed. Open every one once # (the app remembers), so later steps find their rows by scrolling, then go back to the top. open_groups() { @@ -732,6 +710,10 @@ if adb shell dumpsys package $PKG 2>/dev/null | grep -m1 "pkgFlags=" | grep -q D app_front; disconnect_app; close_trip || true adb shell am force-stop $PKG; sleep 2 timeout 60 adb shell am start -W -n $PKG/.HomeActivity --es demo_car none > /dev/null 2>&1; sleep 4 + # Diagnostics lays out its sections before that extra clears the car, so Car and connection + # (open while no car is chosen) started closed: open the app once more with no car chosen. + adb shell am force-stop $PKG; sleep 2 + timeout 60 adb shell am start -W -n $PKG/.HomeActivity > /dev/null 2>&1; sleep 4 connect_demo || log "connected after unconfirmed readings: FAILED (no Demo car)" fi adb shell am start -n $PKG/.HomeActivity --ei demo_speed 0 > /dev/null 2>&1; sleep 2 # back to normal driving