Repository navigation
Conversation
…t start (0.3.5, 0.3.5, 0.3.4) All three drivers sent every poll read, the telemetry block included, through one guard that gave a register three tries and then left it alone until restart. A charger that was off at start-up, or held by another Modbus client, used up every try while answering nothing. The driver then sent 0 W, 0 A and 0 V for the rest of the process and never read the serial number FTW Core keys the device on. The telemetry block is now asked on every poll and never given up; while it is silent the driver sends nothing rather than zeros. The control block and the serial are asked only in a poll where the charger answered (for ctek_hybrid, over MQTT em or Modbus), the serial last. A register that misses three times on a charger that does answer is asked again every five minutes instead of never. All three leave invented-number-baseline.json. test_wakes_after_silence.lua runs each driver silent from start-up, silent mid-session, and with each register refused six times. The old drivers fail it; the new ones pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbad9372d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| host.emit_metric("ev_mqtt_em_age_ms", em_age_ms < 0 and 0 or em_age_ms) | ||
| host.emit_metric("ev_mqtt_em_fresh", em_fresh and 1 or 0) | ||
|
|
||
| if modbus_answered then read_serial() end |
There was a problem hiding this comment.
Allow serial discovery when MQTT telemetry is fresh
When MQTT em telemetry stays fresh but the control-block read is refused, modbus_answered never becomes true, so the serial register is never attempted—even if it answers normally. In the Lua harness, refusing only 0x1200 while delivering fresh MQTT telemetry produces 130 EV frames with no serial read; the parent revision discovers the serial immediately. This prevents Core from obtaining the hardware identity and also blocks serial-dependent MQTT subscriptions. Permit the serial probe after fresh MQTT telemetry as well, retaining its bounded retry behavior. This also violates AGENTS.md's requirement to report stable hardware identity early.
AGENTS.md reference: AGENTS.md:L84-L84
Useful? React with 👍 / 👎.
miravoss26
left a comment
There was a problem hiding this comment.
ctek, ctek_v2, ctek_hybrid: the telemetry block is never given up, a silent charger now sends nothing instead of zeros, and other refused registers are retried every five minutes.
- Medium,
drivers/lua/ctek_hybrid.lua(driver_poll): I agree with the open Codex finding. With MQTTemfresh,modbus_answeredis only set by a successful control-block read, so if 0x1200 (REG_CHARGE_LIMIT) is refused,read_serial()is never called, even if the serial would answer. The old driver asked for the serial first. It also blocks the subscriptions that need the serial. Letting a fresh-empoll try the serial too (still bounded byprobe_read) would fix it. ctekandctek_v2: no findings.- Security: no secrets, new dependencies, new network destinations or write-path changes in the driver diff.
Needs a fix or a human decision on the hybrid serial case before merge. I read the driver diff; I did not run the tests myself.
Problem
ctek, ctek_v2 and ctek_hybrid sent every poll read through one guard (
probe_read,GIVE_UP_AFTER = 3) that left a register alone until restart after three misses. That included the telemetry block (0x1100 / 0x2100), the control block and the serial. A charger that was off when FTW started, or held by another Modbus client, used up all of them while answering nothing. From then on the driver:w = 0,l1_a = 0…l3_v = 0andlifetime_wh = 0on every poll, which Core takes as a live charger drawing nothing;Only a restart brought it back. Core reloads a driver with nothing left to read only if an earlier read had succeeded, so this did not heal on its own.
Change
emor the Modbus telemetry for ctek_hybrid. The serial is read last, so a timeout there cannot make the host skip the poll's other reads.invented-number-baseline.json(9 fields each before).Test evidence
test_wakes_after_silence.lua(shared with fix(saj): read the serial and battery again after the inverter wakes (1.3.1) #301), run bytest_ctek_wakes.py,test_ctek_v2_wakes.py,test_ctek_hybrid_wakes.py: silent fromdriver_initfor eight polls then answering; silent for eight polls mid-session; each register refused six times while the rest answer, which must be asked again within five minutes. The old drivers fail:asleep at start-up: register 4099 not read after the device answered(8195 for ctek_v2).make test-driver: ctek 126 passed, ctek_v2 42 passed, ctek_hybrid 42 passed.make absent-register-report: every address settles except the telemetry block, which emits nothing while it fails (allowed).make invented-number-report: 0 invented fields for all three.make check: 5577 passed, 927 skipped.Not yet verified
emfresh and Modbus dead still gives up the control block after three misses and asks every five minutes, as before plus the retry.drivers/BUNDLED_SOURCE.jsonhas to move.🤖 Generated with Claude Code