-
Notifications
You must be signed in to change notification settings - Fork 85
Description
Discussed in #21
Originally posted by JustinHowes01 November 1, 2022
I'm trying to write a script that will collect miner data over time on Whatsminer M30s machines, but when I try to print the error codes, they don't show up. I've tested this with miners that I have confirmed have errors such as 300, 530, 410 (missing a hashboard) and so on, and they still don't show. I've checked the Whatsminer.py file in the library and it includes all the errors I've tested.
Here is my code:
import pyasic
import asyncio
import pyperclip
import time
async def gather_miner_data():
miner = await pyasic.MinerFactory().get_miner(miner_ip)
miner_data = await miner.get_data()
return miner_data.hashrate, miner_data.wattage, miner_data.errors, miner_data.env_temp
miner_ip = pyperclip.paste()
while True:
hashrate, wattage, errors, temp = asyncio.run(gather_miner_data())
print('Hashrate: %s\nWattage: %s\nErrors: %s\nTemperature: %s\n' % (hashrate, wattage, errors, temp))
time.sleep(1)
The script uses the IP address copied to the clipboard to scan a miner, since we have very many machines running.
After running the script, it will give continous readings from the miner that look like this:
Hashrate: 72.79
Wattage: 3211
Errors: []
Temperature: 58.5
This miner in particular has a 275 power overheat error, and yet the error is not reported here.