HEMS Pro: also probe I2C bus 0 for RTC - #33639
Merged
Merged
Conversation
Merge the duplicate/broken checkHemsPro functions left over from the previous commit into one, keeping the string return signature expected by auth.go while probing I2C bus 1 then bus 0. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N94JCMESPj2NP6qxc4rbE7
# Conflicts: # util/sponsor/hemspro_linux.go
Member
|
Isn't the HEMS Pro always on Raspi? |
Contributor
Author
|
No, due to supply shortages of the Raspberry, the HEMS PRO should be also shipped with the banana pi. |
Leftover from merge conflict resolution, tripped gofmt/gci in CI. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017QKb7RRCCTvcawHqiiy86k
sourcery-ai
Bot
dismissed
their stale review
September 11, 2026 15:51
Sourcery withdrew this approval because the latest commits introduced blocking findings.
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
checkHemsPro()opens the DS1307 RTC at a hardcoded I2C bus number (bus 1). This works on every Raspberry Pi, since I2C1 is the general-purpose header bus by RPi convention — but other SBCs number their I2C controllers differently, with no such guarantee.Reproduced on a Banana Pi BPI-M2 Zero: the RTC is wired and responds correctly, but on bus 0, not bus 1 (bus 1 there is the SoC's internal HDMI DDC bus). As a result
checkHemsPro()always returns"", andHEMSPRO=1hardware auto-authorization never succeeds on that board.Fix
Try bus 1 first, so Raspberry Pi behavior is unchanged (succeeds on the first attempt). Only if that fails, fall back to bus 0.
🤖 Generated with Claude Code
https://claude.ai/code/session_01N94JCMESPj2NP6qxc4rbE7