Compare commits

..

4 Commits

Author SHA1 Message Date
UpstreamData
0fbb05d62d version: bump version number. 2023-02-23 15:05:29 -07:00
UpstreamData
01fc2591ad bug: fix a missed check for missing pool info. 2023-02-23 15:03:54 -07:00
UpstreamData
c08d7fa5cd version: bump version number. 2023-02-23 14:47:30 -07:00
UpstreamData
91c0e1c125 feature: add low power mode ability for X19 possibly. 2023-02-23 14:44:43 -07:00
5 changed files with 16 additions and 2 deletions

View File

@@ -326,6 +326,8 @@ class MinerConfig:
if data[key]: if data[key]:
if data[key] == 1: if data[key] == 1:
self.autotuning_wattage = 0 self.autotuning_wattage = 0
if data[key] == 2:
self.autotuning_wattage = 1200
elif key == "fan_control": elif key == "fan_control":
for _key in data[key].keys(): for _key in data[key].keys():
if _key == "min_fans": if _key == "min_fans":
@@ -462,6 +464,9 @@ class MinerConfig:
if self.autotuning_wattage == 0: if self.autotuning_wattage == 0:
cfg["miner-mode"] = 1 # Sleep Mode cfg["miner-mode"] = 1 # Sleep Mode
if self.autotuning_wattage < 1800:
cfg["miner-mode"] = 2 # LPM?
if not self.temp_mode == "auto": if not self.temp_mode == "auto":
cfg["bitmain-fan-ctrl"] = True cfg["bitmain-fan-ctrl"] = True

View File

@@ -24,6 +24,8 @@ class APIError(Exception):
def __str__(self): def __str__(self):
if self.message: if self.message:
if self.message == "can't access write cmd":
return f"{self.message}, please make sure your miner has been unlocked."
return f"{self.message}" return f"{self.message}"
else: else:
return "Incorrect API parameters." return "Incorrect API parameters."

View File

@@ -107,7 +107,7 @@ class X19(BMMiner):
async def resume_mining(self) -> bool: async def resume_mining(self) -> bool:
cfg = await self.get_config() cfg = await self.get_config()
cfg.autotuning_wattage = 1 cfg.autotuning_wattage = 3600
await self.send_config(cfg) await self.send_config(cfg)
return True return True

View File

@@ -16,6 +16,7 @@
import ipaddress import ipaddress
import logging import logging
import warnings
from collections import namedtuple from collections import namedtuple
from typing import List, Optional, Tuple, Union from typing import List, Optional, Tuple, Union
@@ -151,6 +152,12 @@ class BTMiner(BaseMiner):
summary = data["summary"][0] summary = data["summary"][0]
except APIError as e: except APIError as e:
logging.warning(e) logging.warning(e)
except LookupError:
# somethings wrong with the miner
warnings.warn(
f"Failed to gather pool config for miner: {self}, miner did not return pool information."
)
pass
if pools: if pools:
if "POOLS" in pools: if "POOLS" in pools:

View File

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