fix: map AxeOS VR temp to board, chip temp to chain#315
Conversation
c531ffe to
9432ec5
Compare
b-rowan
left a comment
There was a problem hiding this comment.
Concept ACK, but I think this should be limited to fixes specifically on the relevant miner types, and not touch the core data structures (other than the small documentation changed mentioned if you feel it's required).
9432ec5 to
261e1c5
Compare
|
That's my bad. Changing core types wasn't my intention - was going a bit too fast with Grok. |
261e1c5 to
8679ba7
Compare
|
Still a couple core changes, just revert them fully. Making average be chip OR board is even more confusing... |
AxeOS exposes distinct sensors on /api/system/info: `temp` (ASIC chip) and `vrTemp` (voltage regulator / board). Bitaxe and Nerdaxe backends copied `vrTemp` into inlet/outlet chip temperatures and often left `chips[].temperature` empty by reading `temp` from the config-only /api/system/asic payload. Map `vrTemp` to board_temperature and `temp` to inlet/outlet plus chips[0].temperature, preferring live system/info over the ASIC config endpoint.
8679ba7 to
2904f28
Compare
b-rowan
left a comment
There was a problem hiding this comment.
One more small thing I noticed, other than that this should be good.
| // Always emit a chip row when we have live telemetry; temperature comes | ||
| // from system/info `temp`, not the config-only ASIC endpoint. | ||
| board.chips = vec![ChipData { | ||
| position: 0, | ||
| temperature: chip_temp, | ||
| voltage: board.voltage, | ||
| frequency: board.frequency, | ||
| tuned: Some(true), | ||
| working: Some(true), | ||
| hashrate: board.hashrate.clone(), | ||
| }]; |
There was a problem hiding this comment.
I believe the reason the check for chip data was here is for guarding for DataField::Chips, since having that check will skip adding the chips if it is excluded by the user.
| // Always emit a chip row when we have live telemetry; temperature comes | |
| // from system/info `temp`, not the config-only ASIC endpoint. | |
| board.chips = vec![ChipData { | |
| position: 0, | |
| temperature: chip_temp, | |
| voltage: board.voltage, | |
| frequency: board.frequency, | |
| tuned: Some(true), | |
| working: Some(true), | |
| hashrate: board.hashrate.clone(), | |
| }]; | |
| if let Some(chip_data) = chip_data { | |
| board.chips = vec![ChipData { | |
| position: 0, | |
| temperature: chip_temp, | |
| voltage: board.voltage, | |
| frequency: board.frequency, | |
| tuned: Some(true), | |
| working: Some(true), | |
| hashrate: board.hashrate.clone(), | |
| }]; | |
| } |
| assert_eq!(hashboards_without_chips[0].chips.len(), 1); | ||
| assert_eq!(hashboards_without_chips[0].working_chips, Some(1)); | ||
| assert_eq!( | ||
| hashboards_without_chips[0].chips[0] | ||
| .temperature | ||
| .map(|t| t.as_celsius()), | ||
| Some(59.875) | ||
| ); | ||
| assert_eq!( | ||
| hashboards_without_chips[0] | ||
| .board_temperature | ||
| .map(|t| t.as_celsius()), | ||
| Some(78.0) | ||
| ); | ||
| assert_eq!( | ||
| hashboards_without_chips[0] | ||
| .inlet_chip_temperature | ||
| .map(|t| t.as_celsius()), | ||
| Some(59.875) | ||
| ); | ||
| assert_eq!( | ||
| hashboards_without_chips[0] | ||
| .outlet_chip_temperature | ||
| .map(|t| t.as_celsius()), | ||
| Some(59.875) | ||
| ); | ||
| // Guard against the old bug that copied VR into chip-chain fields. | ||
| assert_ne!( | ||
| hashboards_without_chips[0] | ||
| .board_temperature | ||
| .map(|t| t.as_celsius()), | ||
| hashboards_without_chips[0] | ||
| .inlet_chip_temperature | ||
| .map(|t| t.as_celsius()) | ||
| ); |
There was a problem hiding this comment.
Can revert these test changes with the fix above, these should have no chips since they should be explicitly excluded by the user.
| board.chips = vec![ChipData { | ||
| position: 0, | ||
| temperature: chip_temp, | ||
| voltage: board.voltage, | ||
| frequency: board.frequency, | ||
| tuned: Some(true), | ||
| working: Some(true), | ||
| hashrate: board.hashrate.clone(), | ||
| }]; |
There was a problem hiding this comment.
Save thing here, can re-add the check.
| board.chips = vec![ChipData { | |
| position: 0, | |
| temperature: chip_temp, | |
| voltage: board.voltage, | |
| frequency: board.frequency, | |
| tuned: Some(true), | |
| working: Some(true), | |
| hashrate: board.hashrate.clone(), | |
| }]; | |
| if let Some(chip_data) = chip_data { | |
| board.chips = vec![ChipData { | |
| position: 0, | |
| temperature: chip_temp, | |
| voltage: board.voltage, | |
| frequency: board.frequency, | |
| tuned: Some(true), | |
| working: Some(true), | |
| hashrate: board.hashrate.clone(), | |
| }]; | |
| } |
AxeOS exposes distinct sensors on /api/system/info:
temp(ASIC chip) andvrTemp(voltage regulator / board). Bitaxe and Nerdaxe backends copiedvrTempinto inlet/outlet chip temperatures and often leftchips[].temperatureempty by readingtempfrom the config-only /api/system/asic payload.Map
vrTempto board_temperature andtempto inlet/outlet plus chips[0].temperature, preferring live system/info over the ASIC config endpoint.