fix(antminer): read power draw from the web stats endpoint - #325
Open
cryptographicturk wants to merge 1 commit into
Open
fix(antminer): read power draw from the web stats endpoint#325cryptographicturk wants to merge 1 commit into
cryptographicturk wants to merge 1 commit into
Conversation
DataField::Wattage was sourced only from the RPC stats payload, which carries no power reading on newer stock firmware. Those generations report draw as a `watt` field on the web stats endpoint instead, so parse_wattage found nothing and wattage was always None. Adds the web stats endpoint as a second source for the field and accepts the `watt` key alongside the existing `power` / `Power` / `chain_power`. Measured against live hardware: L11 3765 W, L9 3333 W, both previously None. An idle L11 correctly reports 0 W rather than falling back to absent.
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.
wattageis alwaysNoneon AntMiner stock firmware86.48-2.0.0, becauseDataField::Wattageis sourced only from the RPC stats payload and that payload carries no power reading on this generation.Where the reading actually lives
The RPC
statsresponse has no power field at all. The web stats endpoint reports it:The change
DataField::Wattage.wattkey alongside the existingpower/Power/chain_power.The RPC source is kept and tried first, so firmware generations that do report power there are unaffected.
Applied to both
v2020andv2023_07.Measured
Against live hardware:
An idle L11 correctly reports
0 Wrather than falling back to absent, so a genuine zero stays distinguishable from a missing reading.Verification
cargo fmt --all -- --check— cleancargo check --workspace— clean