Compare commits

...

7 Commits

Author SHA1 Message Date
UpstreamData
8e430b149b version: bump version number. 2023-05-02 10:18:09 -06:00
UpstreamData
031dc534c7 bug: add chip count for M50VH80 2023-05-02 10:17:11 -06:00
Upstream Data
ac9905717d bug: fix some issues with antminers on stock. 2023-05-01 20:21:49 -06:00
Upstream Data
ae835dbdb2 version: bump version number. 2023-04-27 18:24:31 -06:00
Upstream Data
d59f29b582 bug: add kwargs to send_command. 2023-04-27 18:23:58 -06:00
UpstreamData
c7d6f6cd9f version: bump version number. 2023-04-27 10:02:14 -06:00
UpstreamData
bf19232ad9 bug: add chip counts for M30S++ VH100 2023-04-27 10:01:43 -06:00
7 changed files with 19 additions and 16 deletions

View File

@@ -46,6 +46,7 @@ class BaseMinerAPI:
parameters: Union[str, int, bool] = None,
ignore_errors: bool = False,
allow_warning: bool = True,
**kwargs
) -> dict:
"""Send an API command to the miner and return the result.
@@ -65,7 +66,7 @@ class BaseMinerAPI:
else ""
)
# create the command
cmd = {"command": command}
cmd = {"command": command, **kwargs}
if parameters:
cmd["parameter"] = parameters

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

@@ -225,10 +225,7 @@ class M30SPlusPlusVH100(WhatsMiner): # noqa - ignore ABC method implementation
super().__init__(ip, api_ver)
self.ip = ip
self.model = "M30S++ VH100"
self.nominal_chips = 0
warnings.warn(
"Unknown chip count for miner type M30S++ VH100, please open an issue on GitHub (https://github.com/UpstreamData/pyasic)."
)
self.nominal_chips = 82
self.fan_count = 2

View File

@@ -111,10 +111,7 @@ class M50VH80(WhatsMiner): # noqa - ignore ABC method implementation
super().__init__(ip, api_ver)
self.ip = ip
self.model = "M50 VH80"
self.nominal_chips = 0
warnings.warn(
"Unknown chip count for miner type M50 VH80, please open an issue on GitHub (https://github.com/UpstreamData/pyasic)."
)
self.nominal_chips = 111
self.fan_count = 2

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:

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyasic"
version = "0.33.6"
version = "0.33.9"
description = "A set of modules for interfacing with many common types of ASIC bitcoin miners, using both their API and SSH."
authors = ["UpstreamData <brett@upstreamdata.ca>"]
repository = "https://github.com/UpstreamData/pyasic"