fix(obd): the Accent TCU reply is complete at four bytes, not truncated

Both earlier explanations for the missing gear sensors were wrong, and the
response latencies in the logs rule them out.

The 21 A0 reply is 61A0FFFF0000 in all 115 logged responses, and it is a
finished reply rather than a first frame with the rest missing. Median
round-trip is 92ms, against 79ms for the single-frame 010C and 76ms for
21 01, which returns 41 bytes across multiple frames. A stalled multi-frame
would have to sit through the adapter's wait for the frames that never come
before it prints a prompt, so it would be far slower, not the same speed.
Multi-frame on 7E0 also completes normally in the very same session, so flow
control is not implicated either. The ATFCSH7E1 setup added in the previous
two commits was speculation and is removed.

The 1.0.9 idle-wait change is not responsible either: sendCommand blocks on
the prompt and the poll loop awaits it, so a later command cannot be written
into the middle of a reply. The idle wait only covers gaps when no command is
outstanding.

So the ECU really does return four data bytes here, and awesomeit's byte 13,
20 and 21 cannot be reached from it. Whether that is because the profile
describes a different specification, or because this TCU only fills the block
under conditions not present while parked, is still open — every log so far
was captured in park with the engine idling.

Replace the three sensors with probes exposing bytes 0 through 3 directly, so
shifting through P/R/N/D shows whether any of them move. If they do, that
byte carries the gear; if FF FF 00 00 never changes, this TCU does not serve
the block and the sensors should go for good.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
eiggerandClaude Opus 5 committed 2026-08-01 22:45:54 +09:00
1 parent 407800d0cd
commit 59a8a45c15
1 file changed
+35 -60
+35 -60
View File
@@ -322,76 +322,51 @@ templates:
# 7F 22 22로 거부하므로 다른 DID를 더 뒤져볼 이유가 약하고, 표준 01A6은
# mode 01 지원 목록에 없어 예상대로였다. 위 offset_value 보정을 계속 쓴다.
# ── 변속기(TCU) 21 A0 @ 7E1 ───────────────────────────────────────
# 바이트 위치·모드·헤더 전부 awesomeit 엑센트RB 2013 D 1.6 TCI-U2 프로필 그대로다.
# N(byte 13) 미션오일온도, U(byte 20) 기어위치, V(byte 21) 기어단수
# ── 변속기(TCU) 21 A0 @ 7E1 — 응답이 4바이트뿐이다 ────────────────
# 실측: 요청 116건, 응답 115건이 전부 61A0FFFF0000.
# 에코(61 A0)를 뺀 데이터는 FF FF 00 00 — 4바이트가 전부다.
#
# 값이 안 나오던 원인은 흐름제어였다. 실측 응답이 115건 전부 61A0FFFF0000 —
# 정확히 6바이트인데, 이건 ISO-TP First Frame 이 담는 데이터 크기와 같다
# (FF = PCI 2바이트 + 데이터 6바이트, 나머지는 CF 로 이어진다).
# 즉 ECU 는 전체 블록을 보내려 FF 를 띄웠는데 CF 가 한 개도 오지 않은,
# 잘린 응답이었다. 단순히 짧은 Single Frame 이 아니다.
# 잘린 멀티프레임이 아니라 완결된 응답이다. 응답 지연 중앙값이 92ms 로,
# 단일프레임 010C(79ms)·멀티프레임 2101(41바이트, 76ms)과 같은 수준이다.
# First Frame 만 오고 CF 가 끊긴 것이라면 ELM327 이 CF 를 기다리다
# 내부 타임아웃을 먹어야 하므로 지연이 훨씬 커진다. 그런 흔적이 없다.
# 흐름제어(ATFCSH) 문제도 아니다 — 같은 세션에서 7E0 멀티프레임은 정상이다.
#
# 방증 둘:
# - 7E0 의 멀티프레임은 잘 받는다 (2103 63바이트, 2101 41바이트).
# 7E1 만 FF 에서 잘리는 건 ELM327 자동 흐름제어가 기본 주소 밖에서
# 동작하지 않는 전형적인 증상이다.
# - 카니발 YP 진단 로그도 7E1 조회 전에 ATFCSH7E1 을 명시적으로 설정한다.
# 그 응답 6201A0FFFF84… 는 엑센트의 61A0FFFF0000 과 FF FF 접두까지 같다.
# 따라서 awesomeit 프로필의 byte 13(미션오일온도)·20(기어위치)·21(기어단수)은
# 이 응답으로는 절대 닿지 않는다. 프로필이 다른 사양 기준이거나,
# 이 TCU 가 특정 조건에서만 전체 블록을 준다는 뜻이다.
#
# 그래서 헤더 지정만으로는 부족하고 흐름제어를 함께 설정해야 한다.
- key: trans_oil_temp
# 아래는 실제로 오는 4바이트를 그대로 노출하는 프로브다.
# 주차(P)·엔진공회전 상태에서만 로그를 떴으므로, 주행 중이나 기어를 바꿀 때
# 값이 달라지는지 봐야 한다. 값이 움직이면 그 바이트가 기어 정보이고,
# FF FF 00 00 이 계속 고정이면 이 차 TCU 는 이 블록을 안 채우는 것이다.
- key: tcu_byte0
mode: "21"
pid: "A0"
pre_commands: ["ATSH7E1", "ATFCSH7E1", "ATFCSD300000", "ATFCSM1"]
decode: { offset: 13, length: 1, type: uint8, offset_value: -40 }
unit: "°C"
device_class: temperature
state_class: measurement
accuracy_decimals: 1
icon: mdi:oil-temperature
pre_commands: ["ATSH7E1"]
decode: { offset: 0, length: 1, type: uint8 }
entity_category: diagnostic
update_interval: 20s
- key: gear_position
mode: "21"
pid: "A0"
pre_commands: ["ATSH7E1", "ATFCSH7E1", "ATFCSD300000", "ATFCSM1"]
platform: text_sensor
icon: mdi:car-shift-pattern
entity_category: diagnostic
decode:
offset: 20
length: 1
type: uint8
map:
"8": "D"
"9": "N"
"10": "R"
"11": "P"
"12": "Sport"
"16": "E Mode"
update_interval: 2s
- key: gear
- key: tcu_byte1
mode: "21"
pid: "A0"
pre_commands: ["ATSH7E1", "ATFCSH7E1", "ATFCSD300000", "ATFCSM1"]
platform: text_sensor
icon: mdi:numeric
pre_commands: ["ATSH7E1"]
decode: { offset: 1, length: 1, type: uint8 }
entity_category: diagnostic
update_interval: 2s
- key: tcu_byte2
mode: "21"
pid: "A0"
pre_commands: ["ATSH7E1"]
decode: { offset: 2, length: 1, type: uint8 }
entity_category: diagnostic
update_interval: 2s
- key: tcu_byte3
mode: "21"
pid: "A0"
pre_commands: ["ATSH7E1"]
decode: { offset: 3, length: 1, type: uint8 }
entity_category: diagnostic
decode:
offset: 21
length: 1
type: uint8
map:
"0": "P/N"
"1": "1"
"2": "2"
"3": "3"
"4": "4"
"5": "5"
"6": "6"
"7": "7"
"8": "8"
update_interval: 2s
- id: gatt_meter_relay