From 6fb73c97462dd3e31e646e1005cca719c0f1663f Mon Sep 17 00:00:00 2001 From: noah Date: Tue, 22 Sep 2026 14:15:43 -0600 Subject: [PATCH] firmware: detect + label Bixbit and Hiveon (own colours) Bixbit and Hiveon keep the stock Antminer web API, so asic-rs identifies them as "AntMiner Stock". Distinguish them at scan time from the cgminer `version` reply: Bixbit tags it with BixFirmware/BixMiner/BixAPIVersion (definitive; verified live on a Bixbit S19j Pro at 10.4.1.70); Hiveon carries a "hiveon" marker (best-effort -- no live Hiveon unit to confirm the exact signature yet). A real stock miner (no marker) stays "Stock". Firmware column colours: Bixbit -> pinkish-red (223,62,102, their logo); Hiveon -> darker logo orange (228,112,24), with "hiveon" added to the existing hive/hiveos alias. The probe is a short, timeout-bounded cgminer query run only for Antminer miners that first identified as stock. SELFTEST PASS. Hiveon detection to be re-verified once a Hiveon miner is available. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6 --- crates/alkane-gui/src/fixtures.rs | 4 ++-- crates/alkane-gui/src/scan.rs | 36 ++++++++++++++++++++++++++++++- crates/alkane-gui/src/ui.rs | 4 ++-- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/crates/alkane-gui/src/fixtures.rs b/crates/alkane-gui/src/fixtures.rs index c275682d..dc071d13 100644 --- a/crates/alkane-gui/src/fixtures.rs +++ b/crates/alkane-gui/src/fixtures.rs @@ -238,10 +238,10 @@ pub fn bench_fleet() -> Vec { Board { ip: "10.255.1.126", make: "Whatsminer", model_id: "M30SVE40", board: "H3", firmware: "Stock", fw_version: "H3.0.1", hashrate: 92.0, expected: 96.0, power: 3400.0, temp: 70.0, fan: 4800.0, worker: "blueflare.h3", mining: true, paused: false }, - Board { ip: "10.255.1.131", make: "Whatsminer", model_id: "M30SPlusVE40", board: "H616", firmware: "Hive", fw_version: "1.0", + Board { ip: "10.255.1.131", make: "Whatsminer", model_id: "M30SPlusVE40", board: "H616", firmware: "Hiveon", fw_version: "1.05", hashrate: 100.0, expected: 100.0, power: 3450.0, temp: 71.0, fan: 4900.0, worker: "blueflare.h616", mining: true, paused: false }, - Board { ip: "10.255.1.148", make: "Whatsminer", model_id: "M50VH50", board: "H6", firmware: "BixBit", fw_version: "2.1", + Board { ip: "10.255.1.148", make: "Whatsminer", model_id: "M50VH50", board: "H6", firmware: "Bixbit", fw_version: "0.9.9.4", hashrate: 118.0, expected: 122.0, power: 3300.0, temp: 66.0, fan: 4600.0, worker: "blueflare.m50", mining: true, paused: false }, // Rebucketed from idle/not-hashing to paused so the "paused" diff --git a/crates/alkane-gui/src/scan.rs b/crates/alkane-gui/src/scan.rs index 8bf97be0..4df3a306 100644 --- a/crates/alkane-gui/src/scan.rs +++ b/crates/alkane-gui/src/scan.rs @@ -539,6 +539,32 @@ fn infer_pic(model: &str) -> Option { None } +/// Bixbit and Hiveon are aftermarket firmwares that keep the stock Antminer web +/// API, so asic-rs identifies them as "AntMiner Stock". Distinguish them from real +/// stock via the cgminer `version` reply (port 4028): Bixbit tags it with +/// `BixFirmware`/`BixMiner`; Hiveon carries a "hiveon" marker. Returns the display +/// family to relabel with, or None (round 17). Best-effort + fast: a short probe +/// only run for Antminer miners that first identified as stock. +async fn detect_aftermarket_antminer(ip: std::net::IpAddr) -> Option<&'static str> { + use tokio::io::{AsyncReadExt, AsyncWriteExt}; + let connect = tokio::net::TcpStream::connect((ip, 4028)); + let mut stream = tokio::time::timeout(std::time::Duration::from_secs(3), connect) + .await + .ok()? + .ok()?; + stream.write_all(b"{\"command\":\"version\"}").await.ok()?; + let mut buf = Vec::new(); + let _ = tokio::time::timeout(std::time::Duration::from_secs(3), stream.read_to_end(&mut buf)).await; + let text = String::from_utf8_lossy(&buf); + if text.contains("BixFirmware") || text.contains("BixMiner") || text.contains("BixAPIVersion") { + Some("Bixbit") + } else if text.to_ascii_lowercase().contains("hiveon") { + Some("Hiveon") + } else { + None + } +} + async fn to_row(miner: &dyn Miner) -> MinerRow { let data = miner.get_data().await; let hashrate_ths = data @@ -625,7 +651,15 @@ async fn to_row(miner: &dyn Miner) -> MinerRow { // Firmware family (coloured column) and version go in separate columns. Strip // the vendor word asic-rs prepends on stock firmware ("AntMiner Stock" -> // "Stock") and carry it into the version instead (round 11 #6). - let (firmware, fw_vendor) = crate::naming::firmware_family(&data.device_info.firmware); + let (mut firmware, mut fw_vendor) = crate::naming::firmware_family(&data.device_info.firmware); + // Bixbit/Hiveon masquerade as stock; relabel them from their cgminer signature + // so they get their own family + colour instead of "Stock" (round 17). + if data.device_info.make.eq_ignore_ascii_case("antminer") && firmware.eq_ignore_ascii_case("stock") { + if let Some(fam) = detect_aftermarket_antminer(data.ip).await { + firmware = fam.to_string(); + fw_vendor = None; // the aftermarket version stands alone, no "AntMiner" prefix + } + } let raw_fw_version = data.firmware_version.clone().unwrap_or_default(); let fw_version = match (fw_vendor, raw_fw_version.is_empty()) { (Some(vendor), false) => format!("{vendor} {raw_fw_version}"), diff --git a/crates/alkane-gui/src/ui.rs b/crates/alkane-gui/src/ui.rs index a0ab29a1..37257522 100644 --- a/crates/alkane-gui/src/ui.rs +++ b/crates/alkane-gui/src/ui.rs @@ -215,9 +215,9 @@ fn firmware_color(family: &str) -> Option<(u8, u8, u8)> { "braiins" => (150, 90, 210), // purple "luxos" | "lux" => (185, 150, 20), // yellow/gold "vnish" => (40, 165, 70), // green - "bixbit" => (225, 105, 175), // pink + "bixbit" => (223, 62, 102), // pinkish-red (Bixbit logo) "epic" | "umc os" | "umcos" | "umc" => (70, 160, 225), // ePIC PowerPlay / UMC OS: light blue - "hive" | "hiveos" => (235, 140, 35), // orange + "hive" | "hiveos" | "hiveon" => (228, 112, 24), // Hiveon: darker logo orange "alkane" => (80, 100, 205), // navy _ => return None, // Stock / unknown -> theme default })