Subject: [PATCH 0028] telemetry: board temperature thresholds (critical / shutdown) Round 19 #10 telemetry extension, tier 3. Exposes the board temperature safety thresholds ("board dangerous temp" from item #10). - New DataField::TemperatureLimits; MinerData gains temp_critical and temp_shutdown (Celsius). Rides the EXISTING GetFluidTemperature trait via a defaulted parse_temperature_limits method returning (critical, shutdown), so no new supertrait bound; only backends that expose the thresholds override it. - ePIC: summary /Misc Critical Temp + Shutdown Temp (already-fetched summary). Antminer/WhatsMiner do not expose thresholds; LuxOS needs an unwired tempctrl command (no fixture) and VNish/Braiins need live verification -> left for a live-verified pass, all inherit (None, None). Fixture test for epic asserts the parsed thresholds. diff --git a/vendor/asic-rs-core/src/data/collector.rs b/vendor/asic-rs-core/src/data/collector.rs index 07d9d571..1e6e7e9d 100644 --- a/vendor/asic-rs-core/src/data/collector.rs +++ b/vendor/asic-rs-core/src/data/collector.rs @@ -65,6 +65,9 @@ pub enum DataField { /// Miner-level fan duty cycle as a percentage (0-100). #[cfg_attr(feature = "python", pydantic(value = "FanSpeedPercent"))] FanSpeedPercent, + /// Board temperature safety thresholds (critical / shutdown), in Celsius. + #[cfg_attr(feature = "python", pydantic(value = "TemperatureLimits"))] + TemperatureLimits, /// PSU fan speed or configuration. #[cfg_attr(feature = "python", pydantic(value = "PsuFans"))] PsuFans, diff --git a/vendor/asic-rs-core/src/data/miner.rs b/vendor/asic-rs-core/src/data/miner.rs index 6dc73d26..08782856 100644 --- a/vendor/asic-rs-core/src/data/miner.rs +++ b/vendor/asic-rs-core/src/data/miner.rs @@ -181,6 +181,10 @@ pub struct MinerData { /// Miner-level fan duty cycle as a percentage (0-100), when reported. Firmware /// exposes no maximum RPM, so this duty cycle is the normalized fan indicator. pub fan_speed_percent: Option, + /// Board critical temperature threshold in Celsius, when reported (round 19 #10). + pub temp_critical: Option, + /// Board shutdown temperature threshold in Celsius, when reported (round 19 #10). + pub temp_shutdown: Option, /// The current PDU fan information for the miner pub psu_fans: Vec, /// The average temperature across all chips in the miner diff --git a/vendor/asic-rs-core/src/traits/miner.rs b/vendor/asic-rs-core/src/traits/miner.rs index baac9387..9de51761 100644 --- a/vendor/asic-rs-core/src/traits/miner.rs +++ b/vendor/asic-rs-core/src/traits/miner.rs @@ -282,6 +282,7 @@ impl< let tuning_capabilities = self.parse_tuning_capabilities(&data); let fluid_temperature = self.parse_fluid_temperature(&data); let outlet_fluid_temperature = self.parse_outlet_fluid_temperature(&data); + let (temp_critical, temp_shutdown) = self.parse_temperature_limits(&data); let fans = self.parse_fans(&data); let fan_speed_percent = self.parse_fan_speed_percent(&data); let psu_fans = self.parse_psu_fans(&data); @@ -368,6 +369,8 @@ impl< expected_fans: device_info.hardware.fans, fans, fan_speed_percent, + temp_critical, + temp_shutdown, psu_fans, average_temperature, fluid_temperature, @@ -741,6 +744,15 @@ pub trait GetFluidTemperature: CollectData { ) -> Option { None } + /// Board temperature safety thresholds as (critical, shutdown) in Celsius. + /// Backends that expose them override this; others return (None, None). + #[allow(unused_variables)] + fn parse_temperature_limits( + &self, + data: &HashMap, + ) -> (Option, Option) { + (None, None) + } } // Wattage diff --git a/vendor/asic-rs-firmwares-epic/src/backends/v1/mod.rs b/vendor/asic-rs-firmwares-epic/src/backends/v1/mod.rs index 16c7872b..0c9a851b 100644 --- a/vendor/asic-rs-firmwares-epic/src/backends/v1/mod.rs +++ b/vendor/asic-rs-firmwares-epic/src/backends/v1/mod.rs @@ -482,6 +482,16 @@ impl GetDataLocations for PowerPlayV1 { tag: None, }, )], + // Board temperature thresholds (round 19 #10, T3); summary /Misc carries + // Critical Temp and Shutdown Temp. Already fetched. + DataField::TemperatureLimits => vec![( + WEB_SUMMARY, + DataExtractor { + func: get_by_pointer, + key: Some("/Misc"), + tag: None, + }, + )], DataField::Hashboards => vec![ ( WEB_TEMPS, @@ -1139,7 +1149,21 @@ impl GetFans for PowerPlayV1 { impl GetPsuFans for PowerPlayV1 {} impl GetTuningCapabilities for PowerPlayV1 {} -impl GetFluidTemperature for PowerPlayV1 {} +impl GetFluidTemperature for PowerPlayV1 { + fn parse_temperature_limits( + &self, + data: &HashMap, + ) -> (Option, Option) { + // ePIC summary /Misc: Critical Temp + Shutdown Temp (round 19 #10, T3). + let d = data.get(&DataField::TemperatureLimits); + let f = |k: &str| { + d.and_then(|v| v.pointer(k)) + .and_then(|v| v.as_f64()) + .filter(|v| v.is_finite() && *v > 0.0) + }; + (f("/Critical Temp"), f("/Shutdown Temp")) + } +} impl GetWattage for PowerPlayV1 { fn parse_wattage(&self, data: &HashMap) -> Option { @@ -2205,6 +2229,9 @@ mod tests { assert_eq!(miner_data.wattage, Some(Power::from_watts(2166.6174))); // Miner-level fan duty cycle from summary /Fans/Fans Speed (round 19 #10, T3). assert_eq!(miner_data.fan_speed_percent, Some(100.0)); + // Board temp thresholds from summary /Misc (round 19 #10, T3). + assert_eq!(miner_data.temp_critical, Some(100.0)); + assert_eq!(miner_data.temp_shutdown, Some(85.0)); assert_eq!(miner_data.hashboards.len(), 3); assert_eq!(miner_data.hashboards[0].active, Some(false)); assert_eq!(miner_data.hashboards[1].chips.len(), 110);