bug: fix some issues with antminers on stock.
This commit is contained in:
@@ -549,15 +549,19 @@ class MinerConfig:
|
|||||||
cfg = {
|
cfg = {
|
||||||
"pools": self.pool_groups[0].as_x19(user_suffix=user_suffix),
|
"pools": self.pool_groups[0].as_x19(user_suffix=user_suffix),
|
||||||
"bitmain-fan-ctrl": False,
|
"bitmain-fan-ctrl": False,
|
||||||
"bitmain-fan-pwn": 100,
|
"bitmain-fan-pwn": "100",
|
||||||
"miner-mode": self.miner_mode.value,
|
"miner-mode": str(self.miner_mode.value),
|
||||||
|
"freq-level": "100"
|
||||||
}
|
}
|
||||||
|
|
||||||
if not self.temp_mode == "auto":
|
if not self.temp_mode == "auto":
|
||||||
cfg["bitmain-fan-ctrl"] = True
|
cfg["bitmain-fan-ctrl"] = True
|
||||||
|
|
||||||
if self.fan_speed:
|
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
|
return cfg
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,11 @@ class AntminerModern(BMMiner):
|
|||||||
async def send_config(self, config: MinerConfig, user_suffix: str = None) -> None:
|
async def send_config(self, config: MinerConfig, user_suffix: str = None) -> None:
|
||||||
self.config = config
|
self.config = config
|
||||||
conf = config.as_x19(user_suffix=user_suffix)
|
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):
|
for i in range(7):
|
||||||
data = await self.get_config()
|
data = await self.get_config()
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class AntminerModernWebAPI(BaseWebAPI):
|
|||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
if parameters:
|
if parameters:
|
||||||
data = await client.post(
|
data = await client.post(
|
||||||
url, data=json.dumps(parameters), auth=auth # noqa
|
url, data=json.dumps(parameters), auth=auth, timeout=15 # noqa
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
data = await client.get(url, auth=auth)
|
data = await client.get(url, auth=auth)
|
||||||
@@ -138,7 +138,7 @@ class AntminerOldWebAPI(BaseWebAPI):
|
|||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
if parameters:
|
if parameters:
|
||||||
data = await client.post(url, data=parameters, auth=auth)
|
data = await client.post(url, data=parameters, auth=auth, timeout=15)
|
||||||
else:
|
else:
|
||||||
data = await client.get(url, auth=auth)
|
data = await client.get(url, auth=auth)
|
||||||
except httpx.HTTPError:
|
except httpx.HTTPError:
|
||||||
|
|||||||
Reference in New Issue
Block a user