Skip to content

fix(etrel): read the charger again after a silent start (1.1.2) - #305

Open
frahlg wants to merge 2 commits into
mainfrom
fix/etrel-wake
Open

frahlg wants to merge 2 commits into
mainfrom
fix/etrel-wake

Conversation

@frahlg

@frahlg frahlg commented Dec 4, 2026

Copy link
Copy Markdown
Member

Problem

etrel 1.1.1 read its measurement block (input 0, 32 registers), the identity block and the device limit through probe_read, which leaves a register alone until restart after three misses. A charger that was off when FTW started, or held by another Modbus client, used up every try while answering nothing. The driver's own comment counted on Core reloading it once nothing is left to read, but Core does that only if an earlier read had succeeded. So after a silent start the driver sent nothing until FTW restarted it, and the serial Core keys the device on was never read.

Change

  • The measurement block is asked on every poll and never given up. While it is silent the driver sends nothing, as before, and logs once when it stops and once when it answers again.
  • The device limit and the identity block are asked only in a poll where the measurement block answered. The identity is read last, so a timeout there cannot make the host skip the poll's other reads.
  • A register that misses three times on a charger that does answer is asked again every five minutes, not never.
  • The control path, registers and decoding are unchanged.

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 by test_etrel_wakes.py: silent from start-up, silent mid-session, each register refused six times. 1.1.1 fails: asleep at start-up: no ev emitted after the device answered.
  • make test-driver ID=etrel: 42 passed, 14 skipped (the control tests included).
  • make absent-register-report ID=etrel: every address settles except the measurement block, which emits nothing while it fails (allowed).
  • make invented-number-report ID=etrel: none.
  • make check: 5575 passed, 927 skipped.

Not yet verified

  • No hardware run. The case needs an Etrel INCH that is off or held by another client when FTW starts.
  • After merge, FTW's pin in drivers/BUNDLED_SOURCE.json has to move.

🤖 Generated with Claude Code

frahlg and others added 2 commits December 4, 2026 19:27
The measurement block, the identity block and the device limit all went
through a guard that left a register alone until restart after three
misses. A charger that was off at start-up, or held by another Modbus
client, used up every try while answering nothing. Core reloads a driver
with nothing left to read only if an earlier read had succeeded, so the
driver then sent nothing until FTW restarted it, and never read the
serial number Core keys the device on.

The measurement block is now asked on every poll and never given up.
The device limit and the identity block are asked only in a poll where
it answered, the identity last. A register that misses three times on a
charger that does answer is asked again every five minutes.

test_wakes_after_silence.lua fails on 1.1.1 ("asleep at start-up: no ev
emitted after the device answered") and passes on 1.1.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T18:29:24.509550Z a076f81 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@miravoss26 miravoss26 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stops etrel 1.1.1 from going permanently silent when the charger doesn't answer at start-up: the measurement block is asked every poll, limit and identity only once it answers, and given-up registers are retried every 5 min. Version, hashes and catalog entries bumped to 1.1.2.

  • blocker for merge: GitHub reports the branch as conflicting with base. Rebase needed, then re-check size/sha256 in index.yaml and manifests/etrel.yaml.
  • minor, question: read_identity() now runs at the end of driver_poll, so the first emit after wake-up goes out before the serial is set (drivers/lua/etrel.lua). Is Core fine with that for device keying?
  • note: no hardware run, as the description says.
  • Security screen: no secrets, new dependencies, new network destinations or authz changes seen. Control path unchanged.

Logic reads fine to me. Not safe to merge as is only because of the conflict. I read the diff and CI results; I did not run the tests myself.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants