Skip to content

fix(antminer): read power draw from the web stats endpoint - #325

Open
cryptographicturk wants to merge 1 commit into
256foundation:masterfrom
dmgblockchain:pr/antminer-wattage
Open

fix(antminer): read power draw from the web stats endpoint#325
cryptographicturk wants to merge 1 commit into
256foundation:masterfrom
dmgblockchain:pr/antminer-wattage

Conversation

@cryptographicturk

Copy link
Copy Markdown
Contributor

wattage is always None on AntMiner stock firmware 86.48-2.0.0, because DataField::Wattage is sourced only from the RPC stats payload and that payload carries no power reading on this generation.

Where the reading actually lives

The RPC stats response has no power field at all. The web stats endpoint reports it:

"watt": 3848,
"voltage": 1266,
"temp_ctrlboard": 28

The change

  • Adds the web stats endpoint as a second source for DataField::Wattage.
  • Accepts the watt key alongside the existing power / Power / chain_power.

The RPC source is kept and tried first, so firmware generations that do report power there are unaffected.

Applied to both v2020 and v2023_07.

Measured

Against live hardware:

L11:  wattage None -> 3765 W
L9:   wattage None -> 3333 W

An idle L11 correctly reports 0 W rather than falling back to absent, so a genuine zero stays distinguishable from a missing reading.

Verification

  • cargo fmt --all -- --check — clean
  • cargo check --workspace — clean
  • Live check against multiple L9 and L11 units on a production farm

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant