Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7329aeace2 | ||
|
|
e8c3953106 | ||
|
|
a1a7562bdb |
16
docs/miners/avalonminer/Q.md
Normal file
16
docs/miners/avalonminer/Q.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# pyasic
|
||||||
|
## Q Models
|
||||||
|
|
||||||
|
## Avalon Q Home (Stock)
|
||||||
|
|
||||||
|
- [ ] Shutdowns
|
||||||
|
- [ ] Power Modes
|
||||||
|
- [ ] Setpoints
|
||||||
|
- [ ] Presets
|
||||||
|
|
||||||
|
::: pyasic.miners.avalonminer.cgminer.Q.Q.CGMinerAvalonQHome
|
||||||
|
handler: python
|
||||||
|
options:
|
||||||
|
show_root_heading: false
|
||||||
|
heading_level: 0
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# pyasic
|
# pyasic
|
||||||
## Byte Models
|
## byte Models
|
||||||
|
|
||||||
## Byte (Stock)
|
## Byte (Stock)
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
- [ ] Setpoints
|
- [ ] Setpoints
|
||||||
- [ ] Presets
|
- [ ] Presets
|
||||||
|
|
||||||
::: pyasic.miners.goldshell.bfgminer.Byte.Byte.GoldshellByte
|
::: pyasic.miners.goldshell.bfgminer.byte.byte.GoldshellByte
|
||||||
handler: python
|
handler: python
|
||||||
options:
|
options:
|
||||||
show_root_heading: false
|
show_root_heading: false
|
||||||
|
|||||||
16
docs/miners/goldshell/mini_doge.md
Normal file
16
docs/miners/goldshell/mini_doge.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# pyasic
|
||||||
|
## mini_doge Models
|
||||||
|
|
||||||
|
## Mini Doge (Stock)
|
||||||
|
|
||||||
|
- [ ] Shutdowns
|
||||||
|
- [ ] Power Modes
|
||||||
|
- [ ] Setpoints
|
||||||
|
- [ ] Presets
|
||||||
|
|
||||||
|
::: pyasic.miners.goldshell.bfgminer.mini_doge.mini_doge.GoldshellMiniDoge
|
||||||
|
handler: python
|
||||||
|
options:
|
||||||
|
show_root_heading: false
|
||||||
|
heading_level: 0
|
||||||
|
|
||||||
16
docs/miners/iceriver/ALX.md
Normal file
16
docs/miners/iceriver/ALX.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# pyasic
|
||||||
|
## ALX Models
|
||||||
|
|
||||||
|
## AL3 (Stock)
|
||||||
|
|
||||||
|
- [ ] Shutdowns
|
||||||
|
- [ ] Power Modes
|
||||||
|
- [ ] Setpoints
|
||||||
|
- [ ] Presets
|
||||||
|
|
||||||
|
::: pyasic.miners.iceriver.iceminer.ALX.AL3.IceRiverAL3
|
||||||
|
handler: python
|
||||||
|
options:
|
||||||
|
show_root_heading: false
|
||||||
|
heading_level: 0
|
||||||
|
|
||||||
@@ -603,12 +603,6 @@ details {
|
|||||||
<details>
|
<details>
|
||||||
<summary>Stock Firmware Goldshells:</summary>
|
<summary>Stock Firmware Goldshells:</summary>
|
||||||
<ul>
|
<ul>
|
||||||
<details>
|
|
||||||
<summary>Mini Doge Series:</summary>
|
|
||||||
<ul>
|
|
||||||
<li><a href="../goldshell/MiniDoge#mini-doge-stock">Mini Doge (Stock)</a></li>
|
|
||||||
</ul>
|
|
||||||
</details>
|
|
||||||
<details>
|
<details>
|
||||||
<summary>X5 Series:</summary>
|
<summary>X5 Series:</summary>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -631,9 +625,15 @@ details {
|
|||||||
</ul>
|
</ul>
|
||||||
</details>
|
</details>
|
||||||
<details>
|
<details>
|
||||||
<summary>Byte Series:</summary>
|
<summary>byte Series:</summary>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="../goldshell/Byte#byte-stock">Byte (Stock)</a></li>
|
<li><a href="../goldshell/byte#byte-stock">Byte (Stock)</a></li>
|
||||||
|
</ul>
|
||||||
|
</details>
|
||||||
|
<details>
|
||||||
|
<summary>mini_doge Series:</summary>
|
||||||
|
<ul>
|
||||||
|
<li><a href="../goldshell/mini_doge#mini-doge-stock">Mini Doge (Stock)</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</details>
|
</details>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -253,10 +253,10 @@ If you are sure you want to use this command please use API.send_command("{comma
|
|||||||
# some json from the API returns with a null byte (\x00) on the end
|
# some json from the API returns with a null byte (\x00) on the end
|
||||||
if data.endswith(b"\x00"):
|
if data.endswith(b"\x00"):
|
||||||
# handle the null byte
|
# handle the null byte
|
||||||
str_data = data.decode("utf-8")[:-1]
|
str_data = data.decode("utf-8", errors="replace")[:-1]
|
||||||
else:
|
else:
|
||||||
# no null byte
|
# no null byte
|
||||||
str_data = data.decode("utf-8")
|
str_data = data.decode("utf-8", errors="replace")
|
||||||
# fix an error with a btminer return having an extra comma that breaks json.loads()
|
# fix an error with a btminer return having an extra comma that breaks json.loads()
|
||||||
str_data = str_data.replace(",}", "}")
|
str_data = str_data.replace(",}", "}")
|
||||||
# fix an error with a btminer return having a newline that breaks json.loads()
|
# fix an error with a btminer return having a newline that breaks json.loads()
|
||||||
|
|||||||
@@ -252,13 +252,13 @@ class BTMinerRPCAPI(BaseMinerRPCAPI):
|
|||||||
except APIError as e:
|
except APIError as e:
|
||||||
if not e.message == "can't access write cmd":
|
if not e.message == "can't access write cmd":
|
||||||
raise
|
raise
|
||||||
try:
|
# try:
|
||||||
await self.open_api()
|
# await self.open_api()
|
||||||
except Exception as e:
|
# except Exception as e:
|
||||||
raise APIError("Failed to open whatsminer API.") from e
|
# raise APIError("Failed to open whatsminer API.") from e
|
||||||
return await self._send_privileged_command(
|
# return await self._send_privileged_command(
|
||||||
command=command, ignore_errors=ignore_errors, timeout=timeout, **kwargs
|
# command=command, ignore_errors=ignore_errors, timeout=timeout, **kwargs
|
||||||
)
|
# )
|
||||||
|
|
||||||
async def _send_privileged_command(
|
async def _send_privileged_command(
|
||||||
self,
|
self,
|
||||||
@@ -293,6 +293,7 @@ class BTMinerRPCAPI(BaseMinerRPCAPI):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
data = parse_btminer_priviledge_data(self.token, data)
|
data = parse_btminer_priviledge_data(self.token, data)
|
||||||
|
print(data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.info(f"{str(self.ip)}: {e}")
|
logging.info(f"{str(self.ip)}: {e}")
|
||||||
|
|
||||||
@@ -1109,6 +1110,7 @@ class BTMinerV3RPCAPI(BaseMinerRPCAPI):
|
|||||||
super().__init__(ip, port, api_ver=api_ver)
|
super().__init__(ip, port, api_ver=api_ver)
|
||||||
|
|
||||||
self.salt = None
|
self.salt = None
|
||||||
|
self.pwd = "super"
|
||||||
|
|
||||||
async def multicommand(self, *commands: str, allow_warning: bool = True) -> dict:
|
async def multicommand(self, *commands: str, allow_warning: bool = True) -> dict:
|
||||||
"""Creates and sends multiple commands as one command to the miner.
|
"""Creates and sends multiple commands as one command to the miner.
|
||||||
@@ -1141,9 +1143,11 @@ class BTMinerV3RPCAPI(BaseMinerRPCAPI):
|
|||||||
token_hashed = bytearray(
|
token_hashed = bytearray(
|
||||||
base64.b64encode(hashlib.sha256(token_str.encode("utf-8")).digest())
|
base64.b64encode(hashlib.sha256(token_str.encode("utf-8")).digest())
|
||||||
)
|
)
|
||||||
token_hashed[8] = 0
|
b_arr = bytearray(token_hashed)
|
||||||
|
b_arr[8] = 0
|
||||||
|
str_token = b_arr.split(b"\x00")[0].decode("utf-8")
|
||||||
cmd["account"] = "super"
|
cmd["account"] = "super"
|
||||||
cmd["token"] = token_hashed.decode("ascii")
|
cmd["token"] = str_token
|
||||||
|
|
||||||
# send the command
|
# send the command
|
||||||
ser = json.dumps(cmd).encode("utf-8")
|
ser = json.dumps(cmd).encode("utf-8")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "pyasic"
|
name = "pyasic"
|
||||||
version = "0.76.6"
|
version = "0.76.7"
|
||||||
|
|
||||||
description = "A simplified and standardized interface for Bitcoin ASICs."
|
description = "A simplified and standardized interface for Bitcoin ASICs."
|
||||||
authors = [{name = "UpstreamData", email = "brett@upstreamdata.ca"}]
|
authors = [{name = "UpstreamData", email = "brett@upstreamdata.ca"}]
|
||||||
|
|||||||
Reference in New Issue
Block a user