Repository navigation
Conversation
Every read went through a guard that left a register alone until restart after three misses. An inverter asleep at start-up, or held by another Modbus client, used up every try while answering nothing, and the driver then sent nothing until FTW restarted it. A register that did not answer was sent as zero, and a scale factor that did not answer as 10^0, so its value went out unscaled. A miss now counts only in a poll where another read answered, and a register that misses three times on an inverter that does answer is asked again every five minutes. A value needs both its register and its scale factor, and a factor of -32768 (not implemented) gives no value. PV, battery and meter go out only when their power answered. The serial is read last, once the inverter has answered in that poll. test_kostal_wakes.py: nine of its ten tests fail on 2.2.1 (the tenth is a healthy poll) and all pass on 2.2.2. 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. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
kostal 2.2.1 read every register through
probe_read, which leaves a register alone until restart after three misses. An inverter asleep when FTW started, or held by another Modbus client, used up every try while answering nothing. The driver then sent nothing; Core reloads a driver with nothing left to read only if an earlier read had succeeded, so it stayed silent until FTW restarted it.A register that did not answer was sent as zero (21 counts in the invented-number baseline). A scale factor that did not answer read as 0, so its value went out unscaled: an MPPT voltage of raw 3500 with a missing
DCV_SFwent out as 3500 V.Change
kostalleavesinvented-number-baseline.json.Test evidence
test_kostal_wakes.py, ten tests; nine fail on 2.2.1 and all pass on 2.2.2 (the tenth is a healthy poll that passes on both):test_wakes_after_silence.lua(shared with fix(saj): read the serial and battery again after the inverter wakes (1.3.1) #301): silent from start-up, silent mid-session, each register refused six times. 2.2.1 fails:asleep at start-up: register 40083 not read after the device answered;test_kostal_battery_now.py: unchanged, passes.make test-driver ID=kostal: 72 passed, 5 skipped.make absent-register-report ID=kostal: every address settles.make invented-number-report ID=kostal: none.make check: 5584 passed, 927 skipped.Not yet verified
battery_present == false(register 588 = 0) is still sent when 40138 answers; that was so before and is left for its own change.invented-number-baseline.jsonandCHANGELOG.mdare touched by the other driver PRs in this series; whichever merges later needs a rebase there.drivers/BUNDLED_SOURCE.jsonhas to move.🤖 Generated with Claude Code