Repository navigation
Forked goodwe with UDP late-response fixes, 5 inverter retries - #49
Merged
Merged
Conversation
A 5 min capture of the inverter link (632 requests) showed replies in 90-300 ms, a few after the 1 s timeout - always lost, because the library closed the socket on every retry - and 3.5% never answered, in bursts of a few seconds. Retries came every 1.0 s, 60 times, so a dead link stalled the 1 Hz loop for a minute per request. Pin goodwe to the piomar123/goodwe fork (0.4.10 + upstream PR #156 + late-response, growing retry timeout and stray-datagram fixes), and cut retries to 5: with the growing timeouts that gives up after ~14 s, still longer than the observed loss bursts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cepted Replies take 90-300 ms, so a lost packet now costs a 0.6 s pause in the 1 Hz loop instead of 1 s. Safe with the forked goodwe: a reply slower than the timeout still answers the retry. 5 retries now give up after ~8 s (0.6, 0.9, 1.35, then 1.8 s), still longer than the loss bursts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v0.4.10-piomar.1 points at the same commit (92a0eeb); a tag survives a rebase or deletion of the udp-late-replies branch. Co-Authored-By: Claude Code <noreply@anthropic.com>
1 task done
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.
Why
I captured 5 minutes of the live inverter link on the Pi (632 requests, tcpdump on the dongle interface):
What
requirements.txt:goodweis pinned to piomar123/goodwe@92a0eeb (branchudp-late-replies). That's 0.4.10 plus:/configand/ecopages read settings while the poll loop and control writes share the same inverter object.main.py:INVERTER_RETRIES = 5instead of 60. With the growing timeouts a request gives up after ~14 s, which still covers the observed loss bursts. With 60 retries a dead link would now stall for ~3 min.The ad-hoc scripts
_eco_mode.pyand_goodwe_reader.pykeepretries=60. They're only run by hand.Upgrading
Run
pip install -r requirements.txtafter pulling (noted inCHANGELOG.md).Test plan
tests/test_protocol_udp_retries.py). They cover:python -m unittest discover -s testspasses with the fork installed.🤖 Generated with Claude Code