Repository navigation
Conversation
The summary block was asked on every poll, so power came back once the controller answered. The device count, the serial slots, the phase block and the energy counters went through a guard that left a block alone until restart after three misses. A controller that was off, restarting or held by another Modbus client at start-up used up every try, and the driver then sent no serial, no phase values and no energy counters until FTW restarted it. With no device count it also stopped dividing a summed phase voltage or frequency. A miss now counts only in a poll where another read answered, and a block that misses three times on a controller that does answer is asked again every five minutes. The summary counts as an answer. The device count is read once the summary has answered, before the phase block it scales, and the serial slots are read last. test_saj-emanager_wakes.py fails on 0.1.2 (8 of 9 cases; the ninth checks fields left out, which 0.1.2 already did) and passes on 0.1.3. 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
saj-emanager 0.1.2 asked the summary block (0x848A) on every poll, so power came back once the controller answered. The device count (0x4A00), the serial slots (0x4A01), the phase block (0x849E) and the energy counters (0x8500) went through
probe_read, which leaves a block alone until restart after three misses. The device count and the serial were also read first in every poll.A controller that was off, restarting or held by another Modbus client when FTW started used up every try on those blocks while answering nothing. Once it answered, the driver sent PV, battery and grid power but no serial, no phase values and no energy counters until FTW restarted it. With no device count,
apply_phasesno longer divided a summed phase voltage or frequency, so a three-inverter plant that sums them could report 150 Hz for the whole run.Change
driver_cleanupresets the new poll state.Test evidence
test_saj-emanager_wakes.py, nine tests with a three-inverter fixture (saj-emanager_wakes_fixture.lua). Eight fail on 0.1.2 and all pass on 0.1.3:test_wakes_after_silence.lua(shared with the other PRs in this series): silent from start-up, silent mid-session, each block refused six times;test_saj-emanager.pypasses unchanged (20 tests).make test-driver ID=saj-emanager: 68 passed, 15 skipped.make absent-register-report ID=saj-emanager: 0x4A00, 0x849E and 0x8500 settle; the summary 0x848A emits nothing.make invented-number-report ID=saj-emanager: none. The driver was not in the baseline.make check: 5583 passed, 927 skipped.Not yet verified
test_int32_sentinel_is_not_a_powerasserts this for the meter); the owner may want such a stream left out.CHANGELOG.mdanddrivers/tests/lua_harness/test_wakes_after_silence.luaare shared with the other PRs in this series; whichever merges later needs a rebase there.drivers/BUNDLED_SOURCE.jsonhas to move.🤖 Generated with Claude Code