Conversation
Member
|
Has been fixed on master already. |
# Conflicts: # charger/daheimladen.go
Member
Author
|
This fixes the master. |
2 tasks
VolkerK62
added a commit
to VolkerK62/evcc
that referenced
this pull request
Aug 19, 2026
fix evcc-io#32907 ## Daheimladen: fix misleading sponsorship error on station id communication failure ### Problem `checkStation()` calls `wb.conn.ReadHoldingRegisters(...)` to read the station id and decide whether the connected DaheimLaden model requires a sponsor token. Any error from this read - including plain network/Modbus communication failures such as `connection refused`, `i/o timeout`, or `EOF` when the wallbox is temporarily unreachable at evcc startup - was unconditionally mapped to `api.ErrSponsorRequired`. This produces a misleading `sponsorship required` error whenever the wallbox simply isn't reachable yet (e.g. still booting, brief network hiccup), even though all DaheimLaden models are sponsor-free. Users have reported that once this happens, restarting evcc does not resolve it - only an external Modbus request to the wallbox (from another tool) appears to reset the connection into a state where evcc's own check succeeds again. Related history: evcc-io#31956 attempted a fix for this, but was reverted (834c062). evcc-io#32079 addressed a related hardware-check issue. The underlying error-masking in `checkStation()` itself was not changed by either. ### Fix Distinguish between: - a **communication error** while reading the station id block (timeout, connection refused, EOF, decode error) -> now returned as a wrapped `station id: %w` error, exposing the real cause instead of `sponsorship required` - a **successfully read but empty/invalid/blocked station id** -> still correctly returns `api.ErrSponsorRequired`, unchanged behavior No other logic changes. The sponsorship determination for genuinely unsupported/rebranded hardware (empty id, non-printable characters, "heidelbridge" marker) is untouched. ### Testing - [ ] Verified that a wallbox unreachable at startup now surfaces `cannot create charger ...: station id: dial tcp ...: connect: connection refused` instead of `sponsorship required` - [ ] Verified that a reachable wallbox still initializes without a sponsor token (as all DaheimLaden models are sponsor-free) ### Note⚠️ This does not necessarily fix the reported "stuck until an external Modbus request is sent" behavior, which may be caused by a separate issue in connection handling further down in `util/modbus` (`TcpSettings.Connection(ctx)`). This PR only fixes the error message being wrong/misleading. Created with the help of Claude AI
2 tasks
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.
Fixes BorisBrock/HeidelBridge#70
Fixes 552e8a9