Open Combinator78 opened 3 days ago
Haven't touched hiveon stuff since T9, no idea how much theyve changed in the firmware, ill see what I can do. Are you able to send over a couple of the different RPC commands (and any web commands you find relevant)?
what is above is the result of execution
import asyncio # asyncio for handling the async part
import sys
sys.path.append('local_libs')
import pyasic
from pyasic import get_miner # handles miner creation
async def gather_miner_data():
miner = await get_miner("172.20.174.152")
if miner is not None:
miner_data = await miner.get_data()
print(miner_data) # all data from the dataclass
print(miner_data.hashrate) # hashrate of the miner in TH/s
if __name__ == "__main__":
asyncio.run(gather_miner_data())
I need the raw calls, ill get a list of commands, 1 sec.
import asyncio
import httpx
import pyasic
IP = "172.20.174.152"
async def main():
try:
print(await pyasic.miner_factory._socket_ping(IP, "version"))
except Exception as e:
print(f"Error getting RPC version: {e}")
print("-" * 40)
try:
print(await pyasic.miner_factory._socket_ping(IP, "devdetails"))
except Exception as e:
print(f"Error getting RPC devdetails: {e}")
print("-" * 40)
try:
async with httpx.AsyncClient(transport=pyasic.settings.transport()) as session:
print(await pyasic.miner_factory._web_ping(session, f"http://{IP}/"))
except Exception as e:
print(f"Error getting web http root: {e}")
print("-" * 40)
try:
async with httpx.AsyncClient(transport=pyasic.settings.transport()) as session:
print(await pyasic.miner_factory._web_ping(session, f"https://{IP}/"))
except Exception as e:
print(f"Error getting web https root: {e}")
print("-" * 40)
try:
print(await pyasic.miner_factory._socket_ping(IP, "stats"))
except Exception as e:
print(f"Error getting RPC stats: {e}")
print("-" * 40)
try:
print(await pyasic.miner_factory._socket_ping(IP, "summary"))
except Exception as e:
print(f"Error getting RPC summary: {e}")
if __name__ == "__main__":
asyncio.run(main())
{"STATUS":[{"STATUS":"S","When":1732827950,"Code":22,"Msg":"BMMiner versions","Description":"bmminer 1.0.0"}],"VERSION":[{"BMMiner":"4.11.1 rwglr","API":"3.1","Miner":"49.0.1.3","CompileTime":"Fri Apr 19 10:58:21 UTC 2024","Type":"Antminer S19JPRO Hiveon"}],"id":1}
----------------------------------------
{"STATUS":[{"STATUS":"E","When":1732827950,"Code":45,"Msg":"Access denied to 'devdetails' command","Description":"bmminer 1.0.0"}],"id":1}
----------------------------------------
('<?xml version="1.0" encoding="iso-8859-1"?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n <head>\n <title>401 Unauthorized</title>\n </head>\n <body>\n <h1>401 Unauthorized</h1>\n </body>\n</html>\n', <Response [401 Unauthorized]>)
----------------------------------------
(None, None)
----------------------------------------
{"STATUS":[{"STATUS":"S","When":1732827952,"Code":70,"Msg":"BMMiner stats","Description":"bmminer 1.0.0"}],"STATS":[{"BMMiner":"4.11.1 rwglr","Miner":"49.0.1.3","CompileTime":"Fri Apr 19 10:58:21 UTC 2024","Type":"Antminer S19JPRO Hiveon"},{"STATS":0,"ID":"BC50","Elapsed":25587,"Calls":0,"Wait":0.000000,"Max":0.000000,"Min":99999999.000000,"GHS 5s":109247.48,"GHS av":103914.85,"miner_count":3,"frequency":"","fan_num":4,"fan1":3960,"fan2":3840,"fan3":3960,"fan4":3960,"fan5":0,"fan6":0,"fan7":0,"fan8":0,"temp_num":3,"temp1":37,"temp2":38,"temp3":40,"temp4":0,"temp5":0,"temp6":0,"temp7":0,"temp8":0,"temp9":0,"temp10":0,"temp11":0,"temp12":0,"temp13":0,"temp14":0,"temp15":0,"temp16":0,"temp2_1":55,"temp2_2":57,"temp2_3":59,"temp2_4":0,"temp2_5":0,"temp2_6":0,"temp2_7":0,"temp2_8":0,"temp2_9":0,"temp2_10":0,"temp2_11":0,"temp2_12":0,"temp2_13":0,"temp2_14":0,"temp2_15":0,"temp2_16":0,"temp3_1":55,"temp3_2":57,"temp3_3":59,"temp3_4":0,"temp3_5":0,"temp3_6":0,"temp3_7":0,"temp3_8":0,"temp3_9":0,"temp3_10":0,"temp3_11":0,"temp3_12":0,"temp3_13":0,"temp3_14":0,"temp3_15":0,"temp3_16":0,"temp_pcb1":"37-37-37-37","temp_pcb2":"38-38-38-38","temp_pcb3":"40-40-40-40","temp_pcb4":"0-0-0-0","temp_pcb5":"0-0-0-0","temp_pcb6":"0-0-0-0","temp_pcb7":"0-0-0-0","temp_pcb8":"0-0-0-0","temp_pcb9":"0-0-0-0","temp_pcb10":"0-0-0-0","temp_pcb11":"0-0-0-0","temp_pcb12":"0-0-0-0","temp_pcb13":"0-0-0-0","temp_pcb14":"0-0-0-0","temp_pcb15":"0-0-0-0","temp_pcb16":"0-0-0-0","temp_chip1":"53-55-53-55","temp_chip2":"55-57-55-57","temp_chip3":"56-59-56-59","temp_chip4":"0-0-0-0","temp_chip5":"0-0-0-0","temp_chip6":"0-0-0-0","temp_chip7":"0-0-0-0","temp_chip8":"0-0-0-0","temp_chip9":"0-0-0-0","temp_chip10":"0-0-0-0","temp_chip11":"0-0-0-0","temp_chip12":"0-0-0-0","temp_chip13":"0-0-0-0","temp_chip14":"0-0-0-0","temp_chip15":"0-0-0-0","temp_chip16":"0-0-0-0","total_rateideal":103946.22,"total_freqavg":0.00,"total_acn":378,"total_rate":109247.47,"chain_rateideal1":34648.74,"chain_rateideal2":34648.74,"chain_rateideal3":34648.74,"chain_rateideal4":34648.74,"chain_rateideal5":34648.74,"chain_rateideal6":34648.74,"chain_rateideal7":34648.74,"chain_rateideal8":34648.74,"chain_rateideal9":34648.74,"chain_rateideal10":34648.74,"chain_rateideal11":34648.74,"chain_rateideal12":34648.74,"chain_rateideal13":34648.74,"chain_rateideal14":34648.74,"chain_rateideal15":34648.74,"chain_rateideal16":34648.74,"temp_max":40,"no_matching_work":655,"chain_acn1":126,"chain_acn2":126,"chain_acn3":126,"chain_acn4":0,"chain_acn5":0,"chain_acn6":0,"chain_acn7":0,"chain_acn8":0,"chain_acn9":0,"chain_acn10":0,"chain_acn11":0,"chain_acn12":0,"chain_acn13":0,"chain_acn14":0,"chain_acn15":0,"chain_acn16":0,"chain_acs1":" ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo","chain_acs2":" ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo","chain_acs3":" ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo ooo","chain_acs4":"","chain_acs5":"","chain_acs6":"","chain_acs7":"","chain_acs8":"","chain_acs9":"","chain_acs10":"","chain_acs11":"","chain_acs12":"","chain_acs13":"","chain_acs14":"","chain_acs15":"","chain_acs16":"","chain_hw1":296,"chain_hw2":165,"chain_hw3":194,"chain_hw4":0,"chain_hw5":0,"chain_hw6":0,"chain_hw7":0,"chain_hw8":0,"chain_hw9":0,"chain_hw10":0,"chain_hw11":0,"chain_hw12":0,"chain_hw13":0,"chain_hw14":0,"chain_hw15":0,"chain_hw16":0,"chain_rate1":36020.00,"chain_rate2":36921.60,"chain_rate3":36305.87,"chain_rate4":0.00,"chain_rate5":0.00,"chain_rate6":0.00,"chain_rate7":0.00,"chain_rate8":0.00,"chain_rate9":0.00,"chain_rate10":0.00,"chain_rate11":0.00,"chain_rate12":0.00,"chain_rate13":0.00,"chain_rate14":0.00,"chain_rate15":0.00,"chain_rate16":0.00,"chain_xtime1":"{}","chain_xtime2":"{}","chain_xtime3":"{}","chain_offside_1":"","chain_offside_2":"","chain_offside_3":"","chain_opencore_0":"1","chain_opencore_1":"1","chain_opencore_2":"1","freq1":535,"freq2":535,"freq3":535,"freq4":0,"freq5":0,"freq6":0,"freq7":0,"freq8":0,"freq9":0,"freq10":0,"freq11":0,"freq12":0,"freq13":0,"freq14":0,"freq15":0,"freq16":0,"chain_avgrate1":34663.82,"chain_avgrate2":34641.99,"chain_avgrate3":34605.72,"chain_avgrate4":0.00,"chain_avgrate5":0.00,"chain_avgrate6":0.00,"chain_avgrate7":0.00,"chain_avgrate8":0.00,"chain_avgrate9":0.00,"chain_avgrate10":0.00,"chain_avgrate11":0.00,"chain_avgrate12":0.00,"chain_avgrate13":0.00,"chain_avgrate14":0.00,"chain_avgrate15":0.00,"chain_avgrate16":0.00,"miner_version":"49.0.1.3","miner_id":"806c95064e10481c","chain_power1":1105,"chain_power2":1105,"chain_power3":1105,"total_power":3316,"chain_voltage1":13.70,"chain_voltage2":13.70,"chain_voltage3":13.70,"chain_voltage4":13.70,"chain_voltage5":13.70,"chain_voltage6":13.70,"chain_voltage7":13.70,"chain_voltage8":13.70,"chain_voltage9":13.70,"chain_voltage10":13.70,"chain_voltage11":13.70,"chain_voltage12":13.70,"chain_voltage13":13.70,"chain_voltage14":13.70,"chain_voltage15":13.70,"chain_voltage16":13.70,"fan_pwm":41,"bringup_temp":11,"has_pic":"1","tune_running":"0","psu_status":"PSU OK","downscale_mode":"0","has_hotel_fee":"0"}],"id":1}
----------------------------------------
{"STATUS":[{"STATUS":"S","When":1732827952,"Code":11,"Msg":"Summary","Description":"bmminer 1.0.0"}],"SUMMARY":[{"Elapsed":25587,"GHS 5s":109247.48,"GHS av":103914.85,"Found Blocks":0,"Getworks":7933,"Accepted":37014,"Rejected":9,"Hardware Errors":655,"Utility":86.80,"Discarded":14512,"Stale":0,"Get Failures":0,"Local Work":2434764,"Remote Failures":0,"Network Blocks":37,"Total MH":2658765290548.0000,"Work Utility":1471147.54,"Difficulty Accepted":626191219.00000000,"Difficulty Rejected":1179648.00000000,"Difficulty Stale":0.00000000,"Best Share":13826857318,"Device Hardware%":0.0001,"Device Rejected%":0.1880,"Pool Rejected%":0.1880,"Pool Stale%":0.0000,"Last getwork":1732827951}],"id":1}```
I don't see the mac address anywhere, this is critical for me. Is there any way to get it back?
I don't see the mac address anywhere, this is critical for me. Is there any way to get it back?
That's a good question, I have no idea actually if they will support that. Is SSH enabled on the miner? If so, try cat /sys/class/net/eth0/address
...
PS C:\agent> cat /sys/class/net/eth0/address 172.20.174.152 Get-Content : Не удается найти позиционный параметр, принимающий аргумент "172.20.174.152". строка:1 знак:1
+ CategoryInfo : InvalidArgument: (:) [Get-Content], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetContentCommand
PS C:\agent>
did I do something wrong?
PS C:\agent> cat /sys/class/net/eth0/address 172.20.174.152 Get-Content : Не удается найти позиционный параметр, принимающий аргумент "172.20.174.152". строка:1 знак:1
* cat /sys/class/net/eth0/address 172.20.174.152 * ``` + CategoryInfo : InvalidArgument: (:) [Get-Content], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetContentCommand ```
PS C:\agent>
did I do something wrong?
Need to ssh in first, ssh root@172.20.174.152 "cat /sys/class/net/eth0/address"
Can you try this? I think its returning a stock antminer header and I need to find a way to skip that...
import asyncio
import httpx
import pyasic
IP = "172.20.174.152"
async def main():
async with httpx.AsyncClient(transport=pyasic.settings.transport()) as session:
res = await pyasic.miner_factory._web_ping(session, f"https://{IP}/")
print(res.headers)
if __name__ == "__main__":
asyncio.run(main())
PS C:\agent> ssh root@172.20.174.152 ssh : Имя "ssh" не распознано как имя командлета, функции, файла сценария или выполняемой программы. Проверьте правильность написания имени, а также наличие и правильность пути, после чего повтори те попытку. строка:1 знак:1
+ CategoryInfo : ObjectNotFound: (ssh:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\agent> ssh root@172.20.174.152 ssh : Имя "ssh" не распознано как имя командлета, функции, файла сценария или выполняемой программы. Проверьте правильность написания имени, а также наличие и правильность пути, после чего повтори те попытку. строка:1 знак:1
* ssh root@172.20.174.152 * ``` + CategoryInfo : ObjectNotFound: (ssh:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException ```
Try in command prompt? Not sure familiar with powershell.
py test.py
Traceback (most recent call last):
File "C:\vekus\agent\test.py", line 19, in
Ack...
import asyncio
import httpx
import pyasic
IP = "172.20.174.152"
async def main():
async with httpx.AsyncClient(transport=pyasic.settings.transport()) as session:
res = await pyasic.miner_factory._web_ping(session, f"http://{IP}/")
print(res[1].headers)
if __name__ == "__main__":
asyncio.run(main())
ssh: connect to host 172.20.174.152 port 22: Connection refused
ssh: connect to host 172.20.174.152 port 22: Connection refused
Ok, no SSH then. Anything in any of the web endpoints about it?
PS C:\vekus\agent> py test.py
Traceback (most recent call last):
File "C:\vekus\agent\test.py", line 19, in
And I messed it up again...
import asyncio
import httpx
import pyasic
IP = "172.20.174.152"
async def main():
async with httpx.AsyncClient(transport=pyasic.settings.transport()) as session:
res = await pyasic.miner_factory._web_ping(session, f"http://{IP}/")
print(res[1].headers)
if __name__ == "__main__":
asyncio.run(main())
Headers({'www-authenticate': 'Digest realm="antMiner Configuration", charset="UTF-8", algorithm=MD5, nonce="6748e090:f6b60e5ecc67a489297170efe0734509", qop="auth"', 'content-type': 'text/html', 'content-length': '347', 'date': 'Thu, 28 Nov 2024 21:28:48 GMT', 'server': 'lighttpd/1.4.69'})
Try out v0.64.3. Still have no idea how to get the mac address, but at least it should pick it up properly now...
Traceback (most recent call last):
File "C:\vekus\agent2\test.py", line 4, in
Seems like stuff isnt getting installed properly, if you pip install pydantic
it will fix that, but make sure you update your packages if youre running it from git...
Headers({'www-authenticate': 'Digest realm="antMiner Configuration", charset="UTF-8", algorithm=MD5, nonce="6748e541:7a7cd1d3e33ff30b8b115ecafe94c612", qop="auth"', 'content-type': 'text/html', 'content-length': '347', 'date': 'Thu, 28 Nov 2024 21:48:49 GMT', 'server': 'lighttpd/1.4.69'}) Headers({'www-authenticate': 'Digest realm="antMiner Configuration", charset="UTF-8", algorithm=MD5, nonce="6748e541:7a7cd1d3e33ff30b8b115ecafe94c612", qop="auth"', 'content-type': 'text/html', 'content-length': '347', 'date': 'Thu, 28 Nov 2024 21:48:49 GMT', 'server': 'lighttpd/1.4.69'}) Traceback (most recent call last): File "C:\Users\Vekus\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyasic\miners\base.py", line 497, in _get_data miner_data[data_name] = await function(**args_to_send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Vekus\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyasic\miners\backends\bmminer.py", line 282, in _get_pools pool_url = PoolUrl.from_str(url) if url else None ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Vekus\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyasic\data\pools.py", line 40, in from_str return cls(scheme=scheme, host=host, port=port, pubkey=pubkey) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Vekus\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydantic\main.py", line 214, in init validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pydantic_core._pydantic_core.ValidationError: 2 validation errors for PoolUrl host Input should be a valid string [type=string_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.10/v/string_type port Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.10/v/int_type
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\vekus\agent2\test.py", line 18, in
Whats the result of miner.rpc.pools()
?
Tell me how to call this?
import asyncio
import httpx
import pyasic
IP = "172.20.174.152"
async def main():
miner = await pyasic.get_miner(IP)
print(await miner.rpc.pools())
if __name__ == "__main__":
asyncio.run(main())
PS C:\vekus\agent2> py test.py Headers({'www-authenticate': 'Digest realm="antMiner Configuration", charset="UTF-8", algorithm=MD5, nonce="6748e6e0:c3a41da32760842c0191b850bb78b4e4", qop="auth"', 'content-type': 'text/html', 'content-length': '347', 'date': 'Thu, 28 Nov 2024 21:55:44 GMT', 'server': 'lighttpd/1.4.69'}) Headers({'www-authenticate': 'Digest realm="antMiner Configuration", charset="UTF-8", algorithm=MD5, nonce="6748e6e0:c3a41da32760842c0191b850bb78b4e4", qop="auth"', 'content-type': 'text/html', 'content-length': '347', 'date': 'Thu, 28 Nov 2024 21:55:44 GMT', 'server': 'lighttpd/1.4.69'}) C:\vekus\agent2\local_libs\pyasic\miners\factory.py:876: UserWarning: Partially supported miner found: Antminer S19JPRO Hiveon, please open an issue with miner data and this model on GitHub (https://github.com/UpstreamData/pyasic/issues). warnings.warn( {'STATUS': [{'STATUS': 'S', 'When': 1732830944, 'Code': 7, 'Msg': '5 Pool(s)', 'Description': 'bmminer 1.0.0'}], 'POOLS': [{'POOL': 0, 'URL': 'stratum+tcp://btc.viabtc.io:3333', 'Status': 'Alive', 'Priority': 0, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 2155, 'Accepted': 5238, 'Rejected': 9, 'Discarded': 15676, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': 'Andreyns2017.S19jPro100x09', 'Last Share Time': '0:00:05', 'Diff': '131K', 'Diff1 Shares': 0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 679084032.0, 'Difficulty Rejected': 1179648.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 131072.0, 'Has Stratum': True, 'Stratum Active': True, 'Stratum URL': 'btc.viabtc.io', 'Has GBT': False, 'Best Share': 13826857318, 'Pool Rejected%': 0.1734, 'Pool Stale%': 0.0}, {'POOL': 1, 'URL': 'stratum+tcp://btc.viabtc.io:25', 'Status': 'Alive', 'Priority': 1, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 247, 'Accepted': 0, 'Rejected': 0, 'Discarded': 0, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': 'Andreyns2017.S19jPro100x09', 'Last Share Time': '0', 'Diff': '16.4K', 'Diff1 Shares': 0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 0.0, 'Difficulty Rejected': 0.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 0.0, 'Has Stratum': True, 'Stratum Active': False, 'Stratum URL': '', 'Has GBT': False, 'Best Share': 0, 'Pool Rejected%': 0.0, 'Pool Stale%': 0.0}, {'POOL': 2, 'URL': 'stratum+tcp://btc.viabtc.io:443', 'Status': 'Alive', 'Priority': 2, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 250, 'Accepted': 0, 'Rejected': 0, 'Discarded': 0, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': 'Andreyns2017.S19jPro100x09', 'Last Share Time': '0', 'Diff': '16.4K', 'Diff1 Shares': 0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 0.0, 'Difficulty Rejected': 0.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 0.0, 'Has Stratum': True, 'Stratum Active': False, 'Stratum URL': '', 'Has GBT': False, 'Best Share': 0, 'Pool Rejected%': 0.0, 'Pool Stale%': 0.0}, {'POOL': 3, 'URL': '', 'Status': 'Alive', 'Priority': 999, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 3109, 'Accepted': 16567, 'Rejected': 0, 'Discarded': 327, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': '', 'Last Share Time': '0:06:43', 'Diff': '22.9K', 'Diff1 Shares': 0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 10998409.0, 'Difficulty Rejected': 0.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 1942.0, 'Has Stratum': True, 'Stratum Active': True, 'Stratum URL': '*', 'Has GBT': False, 'Best Share': 70078551, 'Pool Rejected%': 0.0, 'Pool Stale%': 0.0}, {'POOL': 4, 'URL': '*', 'Status': 'Alive', 'Priority': 1000, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 3107, 'Accepted': 19539, 'Rejected': 0, 'Discarded': 206, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': '', 'Last Share Time': '0:13:39', 'Diff': '512', 'Diff1 Shares': 0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 10609928.0, 'Difficulty Rejected': 0.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 512.0, 'Has Stratum': True, 'Stratum Active': True, 'Stratum URL': '**', 'Has GBT': False, 'Best Share': 27027209, 'Pool Rejected%': 0.0, 'Pool Stale%': 0.0}], 'id': 1} PS C:\vekus\agent2>
in developer tools, it only responds with html pages http://172.20.174.152/cgi-bin/minerConfiguration.cgi http://172.20.174.152/cgi-bin/minerStatus.cgi http://172.20.174.152/network.html
Ok, fixed that in 0.64.4, the pools they are returning were super weird.
Headers({'www-authenticate': 'Digest realm="antMiner Configuration", charset="UTF-8", algorithm=MD5, nonce="6748ea8c:3804400e68194993828846ec980c3276", qop="auth"', 'content-type': 'text/html', 'content-length': '347', 'date': 'Thu, 28 Nov 2024 22:11:24 GMT', 'server': 'lighttpd/1.4.69'}) Headers({'www-authenticate': 'Digest realm="antMiner Configuration", charset="UTF-8", algorithm=MD5, nonce="6748ea8c:3804400e68194993828846ec980c3276", qop="auth"', 'content-type': 'text/html', 'content-length': '347', 'date': 'Thu, 28 Nov 2024 22:11:24 GMT', 'server': 'lighttpd/1.4.69'}) {'STATUS': [{'STATUS': 'S', 'When': 1732831884, 'Code': 7, 'Msg': '5 Pool(s)', 'Description': 'bmminer 1.0.0'}], 'POOLS': [{'POOL': 0, 'URL': 'stratum+tcp://btc.viabtc.io:3333', 'Status': 'Alive', 'Priority': 0, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 2218, 'Accepted': 5407, 'Rejected': 9, 'Discarded': 16195, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': 'Andreyns2017.S19jPro100x09', 'Last Share Time': '0:00:06', 'Diff': '131K', 'Diff1 Shares': 0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 701235200.0, 'Difficulty Rejected': 1179648.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 131072.0, 'Has Stratum': True, 'Stratum Active': True, 'Stratum URL': 'btc.viabtc.io', 'Has GBT': False, 'Best Share': 13826857318, 'Pool Rejected%': 0.1679, 'Pool Stale%': 0.0}, {'POOL': 1, 'URL': 'stratum+tcp://btc.viabtc.io:25', 'Status': 'Alive', 'Priority': 1, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 249, 'Accepted': 0, 'Rejected': 0, 'Discarded': 0, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': 'Andreyns2017.S19jPro100x09', 'Last Share Time': '0', 'Diff': '16.4K', 'Diff1 Shares': 0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 0.0, 'Difficulty Rejected': 0.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 0.0, 'Has Stratum': True, 'Stratum Active': False, 'Stratum URL': '', 'Has GBT': False, 'Best Share': 0, 'Pool Rejected%': 0.0, 'Pool Stale%': 0.0}, {'POOL': 2, 'URL': 'stratum+tcp://btc.viabtc.io:443', 'Status': 'Alive', 'Priority': 2, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 252, 'Accepted': 0, 'Rejected': 0, 'Discarded': 0, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': 'Andreyns2017.S19jPro100x09', 'Last Share Time': '0', 'Diff': '16.4K', 'Diff1 Shares': 0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 0.0, 'Difficulty Rejected': 0.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 0.0, 'Has Stratum': True, 'Stratum Active': False, 'Stratum URL': '', 'Has GBT': False, 'Best Share': 0, 'Pool Rejected%': 0.0, 'Pool Stale%': 0.0}, {'POOL': 3, 'URL': '', 'Status': 'Alive', 'Priority': 999, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 3199, 'Accepted': 16567, 'Rejected': 0, 'Discarded': 327, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': '', 'Last Share Time': '0:22:23', 'Diff': '512', 'Diff1 Shares': 0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 10998409.0, 'Difficulty Rejected': 0.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 1942.0, 'Has Stratum': True, 'Stratum Active': True, 'Stratum URL': '*', 'Has GBT': False, 'Best Share': 70078551, 'Pool Rejected%': 0.0, 'Pool Stale%': 0.0}, {'POOL': 4, 'URL': '*', 'Status': 'Alive', 'Priority': 1000, 'Quota': 1, 'Long Poll': 'N', 'Getworks': 3197, 'Accepted': 20169, 'Rejected': 0, 'Discarded': 212, 'Stale': 0, 'Get Failures': 0, 'Remote Failures': 0, 'User': '', 'Last Share Time': '0:08:18', 'Diff': '2.8K', 'Diff1 Shares': 0, 'Proxy Type': '', 'Proxy': '', 'Difficulty Accepted': 10932488.0, 'Difficulty Rejected': 0.0, 'Difficulty Stale': 0.0, 'Last Share Difficulty': 512.0, 'Has Stratum': True, 'Stratum Active': True, 'Stratum URL': '**', 'Has GBT': False, 'Best Share': 27027209, 'Pool Rejected%': 0.0, 'Pool Stale%': 0.0}], 'id': 1}
Headers({'www-authenticate': 'Digest realm="antMiner Configuration", charset="UTF-8", algorithm=MD5, nonce="6748eb4a:17b7cee6caa91bf390fe7b6046b54d68", qop="auth"', 'content-type': 'text/html', 'content-length': '347', 'date': 'Thu, 28 Nov 2024 22:14:34 GMT', 'server': 'lighttpd/1.4.69'}) Headers({'www-authenticate': 'Digest realm="antMiner Configuration", charset="UTF-8", algorithm=MD5, nonce="6748eb4a:17b7cee6caa91bf390fe7b6046b54d68", qop="auth"', 'content-type': 'text/html', 'content-length': '347', 'date': 'Thu, 28 Nov 2024 22:14:34 GMT', 'server': 'lighttpd/1.4.69'}) ip='172.20.174.152' device_info=DeviceInfo(make=<MinerMake.ANTMINER: 'AntMiner'>, model=<AntminerModels.S19jPro: 'S19j Pro'>, firmware=<MinerFirmware.STOCK: 'Stock'>, algo=<class 'pyasic.device.algorithm.sha256.SHA256Algo'>) mac=None api_ver='3.1' fw_ver='Fri Apr 19 10:58:21 UTC 2024' hostname=None expected_hashrate=103.94622 TH/s expected_hashboards=3 expected_chips=378 expected_fans=4 env_temp=None wattage=None voltage=None fans=[Fan(speed=3960), Fan(speed=3840), Fan(speed=3960), Fan(speed=3840)] fan_psu=None hashboards=[HashBoard(slot=0, hashrate=30.05332 TH/s, temp=55, chip_temp=37, chips=126, expected_chips=126, serial_number=None, missing=False, tuned=None, active=None, voltage=None), HashBoard(slot=1, hashrate=30.30987 TH/s, temp=57, chip_temp=38, chips=126, expected_chips=126, serial_number=None, missing=False, tuned=None, active=None, voltage=None), HashBoard(slot=2, hashrate=29.55854 TH/s, temp=59, chip_temp=40, chips=126, expected_chips=126, serial_number=None, missing=False, tuned=None, active=None, voltage=None)] config=MinerConfig(pools=PoolConfig(groups=[PoolGroup(pools=[Pool(url='stratum+tcp://btc.viabtc.io:3333', user='Andreyns2017.S19jPro100x09', password='x'), Pool(url='stratum+tcp://btc.viabtc.io:25', user='Andreyns2017.S19jPro100x09', password='x'), Pool(url='stratum+tcp://btc.viabtc.io:443', user='Andreyns2017.S19jPro100x09', password='x'), Pool(url='', user='', password='x'), Pool(url='*', user='', password='x')], quota=1, name=None)]), fan_mode=FanModeNormal(mode='normal', minimum_fans=1, minimum_speed=0), temperature=TemperatureConfig(target=None, hot=None, danger=None), mining_mode=MiningModeNormal(mode='normal')) fault_light=None errors=[] is_mining=True uptime=29710 pools=[PoolMetrics(url=PoolUrl(scheme=<Scheme.STRATUM_V1: 'stratum+tcp'>, host='btc.viabtc.io', port=3333, pubkey=None), accepted=5448, rejected=9, get_failures=0, remote_failures=0, active=True, alive=True, index=0, user='Andreyns2017.S19jPro100x09', pool_rejected_percent=0.16492578339747113, pool_stale_percent=0.0), PoolMetrics(url=PoolUrl(scheme=<Scheme.STRATUM_V1: 'stratum+tcp'>, host='btc.viabtc.io', port=25, pubkey=None), accepted=0, rejected=0, get_failures=0, remote_failures=0, active=False, alive=True, index=1, user='Andreyns2017.S19jPro100x09', pool_rejected_percent=0, pool_stale_percent=0), PoolMetrics(url=PoolUrl(scheme=<Scheme.STRATUM_V1: 'stratum+tcp'>, host='btc.viabtc.io', port=443, pubkey=None), accepted=0, rejected=0, get_failures=0, remote_failures=0, active=False, alive=True, index=2, user='Andreyns2017.S19jPro100x09', pool_rejected_percent=0, pool_stale_percent=0), PoolMetrics(url=None, accepted=16567, rejected=0, get_failures=0, remote_failures=0, active=True, alive=True, index=3, user='', pool_rejected_percent=0.0, pool_stale_percent=0.0), PoolMetrics(url=None, accepted=20169, rejected=0, get_failures=0, remote_failures=0, active=True, alive=True, index=4, user='', pool_rejected_percent=0.0, pool_stale_percent=0.0)] hashrate=89.92173 TH/s wattage_limit=None total_chips=378 nominal=True percent_expected_chips=100 percent_expected_hashrate=87 percent_expected_wattage=None temperature_avg=57 efficiency=None datetime='2024-11-29T01:14:38.797496+03:00' timestamp=1732832078 make='AntMiner' model='S19j Pro' firmware='Stock' algo='SHA256' unit=TH/s rate=89.92173
Still seems like its identifying wrong...
import asyncio
import httpx
import pyasic
IP = "172.20.174.152"
async def main():
miner = await pyasic.get_miner(IP)
print(await miner.web.get_system_info())
if __name__ == "__main__":
asyncio.run(main())
Headers({'www-authenticate': 'Digest realm="antMiner Configuration", charset="UTF-8", algorithm=MD5, nonce="6748ecd1:c148b494a0c557e8c2e687ae126e03cb", qop="auth"', 'content-type': 'text/html', 'content-length': '347', 'date': 'Thu, 28 Nov 2024 22:21:05 GMT', 'server': 'lighttpd/1.4.69'})
Headers({'www-authenticate': 'Digest realm="antMiner Configuration", charset="UTF-8", algorithm=MD5, nonce="6748ecd1:c148b494a0c557e8c2e687ae126e03cb", qop="auth"', 'content-type': 'text/html', 'content-length': '347', 'date': 'Thu, 28 Nov 2024 22:21:05 GMT', 'server': 'lighttpd/1.4.69'})
C:\vekus\agent2\local_libs\pyasic\miners\factory.py:876: UserWarning: Partially supported miner found: Antminer S19JPRO Hiveon, please open an issue with miner data and this model on GitHub (https://github.com/UpstreamData/pyasic/issues).
warnings.warn(
Traceback (most recent call last):
File "C:\vekus\agent2\test.py", line 20, in
Maybe should check the miner type each time, it seems inconsistent...
import asyncio
import httpx
import pyasic
IP = "172.20.174.152"
async def main():
miner = await pyasic.get_miner(IP)
print(miner)
print(await miner.web.get_system_info())
if __name__ == "__main__":
asyncio.run(main())
Headers({'www-authenticate': 'Digest realm="antMiner Configuration", charset="UTF-8", algorithm=MD5, nonce="6748ef98:9ddc862a6ac0cf5ca93a7df9fd99d150", qop="auth"', 'content-type': 'text/html', 'content-length': '347', 'date': 'Thu, 28 Nov 2024 22:32:56 GMT', 'server': 'lighttpd/1.4.69'})
Headers({'www-authenticate': 'Digest realm="antMiner Configuration", charset="UTF-8", algorithm=MD5, nonce="6748ef98:9ddc862a6ac0cf5ca93a7df9fd99d150", qop="auth"', 'content-type': 'text/html', 'content-length': '347', 'date': 'Thu, 28 Nov 2024 22:32:56 GMT', 'server': 'lighttpd/1.4.69'})
C:\vekus\agent2\local_libs\pyasic\miners\factory.py:876: UserWarning: Partially supported miner found: Antminer S19JPRO Hiveon, please open an issue with miner data and this model on GitHub (https://github.com/UpstreamData/pyasic/issues).
warnings.warn(
Unknown (Stock): 172.20.174.152
Traceback (most recent call last):
File "C:\vekus\agent2\test.py", line 24, in
Please add Hiveon support
pyasic\miners\factory.py:868: UserWarning: Partially supported miner found: Antminer S19JPRO Hiveon, please open an issue with miner data and this model on GitHub (https://github.com/UpstreamData/pyasic/issues). warnings.warn( MinerData(ip='172.20.174.152', datetime='2024-11-28T23:28:57.168605+03:00', timestamp=1732825737, device_info=DeviceInfo(make=None, model=None, firmware=<MinerFirmware.STOCK: 'Stock'>, algo=SHA256Algo), make=None, model=None, firmware='Stock', algo='SHA256', mac=None, api_ver='3.1', fw_ver='Fri Apr 19 10:58:21 UTC 2024', hostname=None, hashrate=106.54267999999999 TH/s, expected_hashrate=103.94622 TH/s, expected_hashboards=3, expected_chips=0, expected_fans=2, percent_expected_chips=0, percent_expected_hashrate=102, percent_expected_wattage=None, temperature_avg=57, env_temp=None, wattage=None, wattage_limit=None, voltage=None, fans=[Fan(speed=3840), Fan(speed=3840)], fan_psu=None, hashboards=[HashBoard(slot=0, hashrate=35.69015 TH/s, temp=55, chip_temp=37, chips=126, expected_chips=None, serial_number=None, missing=False, tuned=None, active=None, voltage=None), HashBoard(slot=1, hashrate=36.17393 TH/s, temp=58, chip_temp=38, chips=126, expected_chips=None, serial_number=None, missing=False, tuned=None, active=None, voltage=None), HashBoard(slot=2, hashrate=34.678599999999996 TH/s, temp=59, chip_temp=40, chips=126, expected_chips=None, serial_number=None, missing=False, tuned=None, active=None, voltage=None)], total_chips=378, nominal=False, config=MinerConfig(pools=PoolConfig(groups=[PoolGroup(pools=[Pool(url='stratum+tcp://btc.viabtc.io:3333', user='Andreyns2017.S19jPro100x09', password='x'), Pool(url='stratum+tcp://btc.viabtc.io:25', user='Andreyns2017.S19jPro100x09', password='x'), Pool(url='stratum+tcp://btc.viabtc.io:443', user='Andreyns2017.S19jPro100x09', password='x'), Pool(url='', user='', password='x'), Pool(url='*', user='', password='x')], quota=1, name='KFLAT9')]), fan_mode=FanModeNormal(mode='normal', minimum_fans=1, minimum_speed=0), temperature=TemperatureConfig(target=None, hot=None, danger=None), mining_mode=MiningModeNormal(mode='normal')), fault_light=None, errors=[], is_mining=True, uptime=23368, efficiency=None, pools=[PoolMetrics(url=PoolUrl(scheme=<Scheme.STRATUM_V1: 'stratum+tcp'>, host='btc.viabtc.io', port=3333, pubkey=None), accepted=4296, rejected=2, get_failures=0, remote_failures=0, active=True, alive=True, index=0, user='Andreyns2017.S19jPro100x09', pool_rejected_percent=0.04653327128897162, pool_stale_percent=0.0), PoolMetrics(url=PoolUrl(scheme=<Scheme.STRATUM_V1: 'stratum+tcp'>, host='btc.viabtc.io', port=25, pubkey=None), accepted=0, rejected=0, get_failures=0, remote_failures=0, active=False, alive=True, index=1, user='Andreyns2017.S19jPro100x09', pool_rejected_percent=0, pool_stale_percent=0), PoolMetrics(url=PoolUrl(scheme=<Scheme.STRATUM_V1: 'stratum+tcp'>, host='btc.viabtc.io', port=443, pubkey=None), accepted=0, rejected=0, get_failures=0, remote_failures=0, active=False, alive=True, index=2, user='Andreyns2017.S19jPro100x09', pool_rejected_percent=0, pool_stale_percent=0), PoolMetrics(url=PoolUrl(scheme=<Scheme.STRATUM_V1: 'stratum+tcp'>, host=None, port=None, pubkey=None), accepted=13242, rejected=0, get_failures=0, remote_failures=0, active=True, alive=True, index=3, user='', pool_rejected_percent=0.0, pool_stale_percent=0.0), PoolMetrics(url=PoolUrl(scheme=<Scheme.STRATUM_V1: 'stratum+tcp'>, host=None, port=None, pubkey=None), accepted=15984, rejected=0, get_failures=0, remote_failures=0, active=True, alive=True, index=4, user='', pool_rejected_percent=0.0, pool_stale_percent=0.0)]) 106.54267999999999 TH/s