asic-rs telemetry T3-fan: miner-level fan duty cycle (fan speed %)
build-test-release / release (push) Successful in 15m16s

Round 19 #10 / #8 telemetry extension. Adds the fan duty cycle as a miner-level
percentage -- the normalized fan-load indicator the GUI wanted alongside per-fan
RPMs. No firmware exposes a maximum fan RPM, so a true actual/maximum pair is not
possible; the duty cycle is the closest normalized signal.

Core (asic-rs-core):
- New DataField::FanSpeedPercent; MinerData gains fan_speed_percent (Option<f64>).
- Modeled as a top-level miner-level value (most firmwares report a single duty),
  so FanData is untouched -- no Eq removal / literal churn across its 17 crates.
- Rides the existing GetFans trait via a defaulted parse_fan_speed_percent method
  (no supertrait blast radius); parse_data wires it in.

Backends (read already-fetched commands, no extra round-trips):
- ePIC: summary /Fans/Fans Speed (single %).
- LuxOS: max of FANS[].Speed.
- Braiins v25_07 + v26_04: max of cooling fans[].target_speed_ratio x 100.
- Antminer (pwm via config) and VNish (fan_duty) have no data fixtures -> left for a
  live-verified pass; WhatsMiner is firmware-locked -> None.

GUI: new "Fan %" column (right-aligned, Cooling category, auto-hidden when empty).
MinerRow gains fan_speed_percent; to_row reads it. ALL_COLUMNS 67 -> 68.

Fixture tests: epic, luxminer, braiins v26_04 assert the parsed percentage. Patch 0027.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
This commit is contained in:
2026-09-23 16:28:14 -06:00
co-authored by Claude Opus 4.8
parent 16245311d1
commit 673af176ab
14 changed files with 397 additions and 6 deletions
+17 -2
View File
@@ -566,6 +566,9 @@ pub struct MinerRow {
/// Individual cooling-fan RPMs (empty if unknown). PSU fan is tracked
/// separately below since it is not part of the cooling-fan set.
pub fan_rpms: Vec<f64>,
/// Miner-level fan duty cycle as a percentage (round 19 #10, T3); `None` when
/// the firmware does not report it (no firmware exposes a maximum RPM).
pub fan_speed_percent: Option<f64>,
pub psu_fan_rpm: f64,
pub fan_count: Option<u32>,
pub expected_fans: Option<u32>,
@@ -1078,6 +1081,10 @@ pub enum Column {
Fan2,
Fan3,
Fan4,
/// Miner-level fan duty cycle % (round 19 #10, T3). No firmware exposes a
/// maximum RPM, so this normalized duty cycle is the fan-load indicator.
/// Populated on ePIC, LuxOS, and Braiins; others leave it empty (auto-hidden).
FanSpeedPercent,
Firmware,
FwVersion,
Worker,
@@ -1160,7 +1167,7 @@ pub enum Column {
/// Every column, in registry order. Ip first, then the default-visible set
/// (UI-SPEC order), then all remaining metrics.
pub const ALL_COLUMNS: [Column; 67] = [
pub const ALL_COLUMNS: [Column; 68] = [
Column::Ip,
Column::Hashrate,
Column::Hashrate1m,
@@ -1174,6 +1181,7 @@ pub const ALL_COLUMNS: [Column; 67] = [
Column::Fan2,
Column::Fan3,
Column::Fan4,
Column::FanSpeedPercent,
Column::Firmware,
Column::FwVersion,
// Pool account (the part before the dot) before Worker (the rig part after
@@ -1265,6 +1273,7 @@ impl Column {
Column::Fan2 => "Fan 2 (RPM)",
Column::Fan3 => "Fan 3 (RPM)",
Column::Fan4 => "Fan 4 (RPM)",
Column::FanSpeedPercent => "Fan %",
Column::Target => "Target",
Column::Accepted => "Accepted",
Column::Rejected => "Rejected",
@@ -1339,6 +1348,7 @@ impl Column {
Column::Power => 90,
Column::ChipTemp | Column::FluidTemp | Column::EnvTemp | Column::OutletTemp => 95,
Column::Fan1 | Column::Fan2 | Column::Fan3 | Column::Fan4 | Column::PsuFan => 90,
Column::FanSpeedPercent => 80,
Column::Target => 110,
Column::Accepted | Column::Rejected => 100,
Column::RejectRatio => 90,
@@ -1403,6 +1413,7 @@ impl Column {
| Column::Fan2
| Column::Fan3
| Column::Fan4
| Column::FanSpeedPercent
| Column::Accepted
| Column::Rejected
| Column::RejectRatio
@@ -1489,6 +1500,7 @@ impl Column {
Column::Fan2 => SortKey::Num(r.fan_rpms.get(1).copied().unwrap_or(none)),
Column::Fan3 => SortKey::Num(r.fan_rpms.get(2).copied().unwrap_or(none)),
Column::Fan4 => SortKey::Num(r.fan_rpms.get(3).copied().unwrap_or(none)),
Column::FanSpeedPercent => SortKey::Num(r.fan_speed_percent.unwrap_or(none)),
Column::Accepted => SortKey::Num(r.accepted_shares.map(|v| v as f64).unwrap_or(none)),
Column::Rejected => SortKey::Num(r.rejected_shares.map(|v| v as f64).unwrap_or(none)),
Column::RejectRatio => SortKey::Num(r.reject_ratio().unwrap_or(none)),
@@ -1590,6 +1602,9 @@ impl Column {
Column::Fan2 => r.fan_rpms.get(1).map(|&v| format_fan_rpm(v)).unwrap_or_default(),
Column::Fan3 => r.fan_rpms.get(2).map(|&v| format_fan_rpm(v)).unwrap_or_default(),
Column::Fan4 => r.fan_rpms.get(3).map(|&v| format_fan_rpm(v)).unwrap_or_default(),
Column::FanSpeedPercent => {
r.fan_speed_percent.map(|v| format!("{v:.0}%")).unwrap_or_default()
}
Column::Target => r.tuning_target_label.clone().unwrap_or_default(),
Column::Accepted => r.accepted_shares.map(|v| v.to_string()).unwrap_or_default(),
Column::Rejected => r.rejected_shares.map(|v| v.to_string()).unwrap_or_default(),
@@ -1705,7 +1720,7 @@ impl Column {
(4, "Temperature")
}
Column::Fan1 | Column::Fan2 | Column::Fan3 | Column::Fan4 | Column::PsuFan
| Column::FanCount | Column::ExpectedFans => (5, "Cooling"),
| Column::FanCount | Column::ExpectedFans | Column::FanSpeedPercent => (5, "Cooling"),
Column::TotalChips | Column::PsuVersion | Column::PsuSerial | Column::PsuVMin
| Column::PsuVMax => (6, "Hardware"),
Column::Worker | Column::PoolAccount | Column::PoolUrl | Column::Pool1Url
+1
View File
@@ -1152,6 +1152,7 @@ async fn to_row(miner: &dyn Miner) -> MinerRow {
env_temp_c,
outlet_temp_c,
fan_rpms,
fan_speed_percent: data.fan_speed_percent,
psu_fan_rpm,
fan_count: (!data.fans.is_empty()).then_some(data.fans.len() as u32),
expected_fans: data.expected_fans.map(|v| v as u32),