bug: fix some issues with antminers on stock.

This commit is contained in:
Upstream Data
2023-05-01 20:21:49 -06:00
parent ae835dbdb2
commit ac9905717d
3 changed files with 14 additions and 6 deletions

View File

@@ -549,15 +549,19 @@ class MinerConfig:
cfg = {
"pools": self.pool_groups[0].as_x19(user_suffix=user_suffix),
"bitmain-fan-ctrl": False,
"bitmain-fan-pwn": 100,
"miner-mode": self.miner_mode.value,
"bitmain-fan-pwn": "100",
"miner-mode": str(self.miner_mode.value),
"freq-level": "100"
}
if not self.temp_mode == "auto":
cfg["bitmain-fan-ctrl"] = True
if self.fan_speed:
cfg["bitmain-fan-ctrl"] = str(self.fan_speed)
cfg["bitmain-fan-pwn"] = str(self.fan_speed)
if self.miner_mode == X19PowerMode.Sleep:
cfg["freq-level"] = "0"
return cfg

View File

@@ -69,7 +69,11 @@ class AntminerModern(BMMiner):
async def send_config(self, config: MinerConfig, user_suffix: str = None) -> None:
self.config = config
conf = config.as_x19(user_suffix=user_suffix)
await self.web.set_miner_conf(conf)
data = await self.web.set_miner_conf(conf)
if data:
if data.get("code") == "M000":
return
for i in range(7):
data = await self.get_config()

View File

@@ -40,7 +40,7 @@ class AntminerModernWebAPI(BaseWebAPI):
async with httpx.AsyncClient() as client:
if parameters:
data = await client.post(
url, data=json.dumps(parameters), auth=auth # noqa
url, data=json.dumps(parameters), auth=auth, timeout=15 # noqa
)
else:
data = await client.get(url, auth=auth)
@@ -138,7 +138,7 @@ class AntminerOldWebAPI(BaseWebAPI):
try:
async with httpx.AsyncClient() as client:
if parameters:
data = await client.post(url, data=parameters, auth=auth)
data = await client.post(url, data=parameters, auth=auth, timeout=15)
else:
data = await client.get(url, auth=auth)
except httpx.HTTPError: