UpstreamData / pyasic

A simplified and standardized interface for Bitcoin ASICs.
https://docs.pyasic.org
Apache License 2.0
100 stars 54 forks source link

Doesnt get Miner Modell BraiinsOS 24.04 Plus #140

Closed kamordi closed 6 months ago

kamordi commented 6 months ago

Describe the bug Since Upgrade BraiinsOS to 24.04 Plus, pyasic doenst receive the correct modell of the miner -> all other functions also doesnt work properly

To Reproduce Calling await miner.web.set_power_target(int(power)) I receive: AttributeError: 'BOSMinerWebAPI' object has no attribute 'set_power_target' After some testing I looked for await miner.get_data() And received: MinerData(ip='MinerIP', datetime=datetime.datetime(2024, 5, 10, 9, 15, 38, 140165, tzinfo=datetime.timezone(datetime.timedelta(seconds=7200), 'CEST')), uptime=2150, mac='MinerMAC', model='Unknown (BOS+)', make=None, api_ver='3.7', fw_ver='24.04', hostname='Antminer', ...

Desktop (please complete the following information):

Miner Information (If applicable):

I would asume pyasic doenst recognise the miner modell correct so it fails to use the prefered function. I will downgrade back to 24.03.01 due to my need for automatic power control. When it is necessary for testing, I would upgrade again.

b-rowan commented 6 months ago

Yeah seems like a model identification issue. Can you try calling pyasic.miner_factory. get_miner_model_braiins_os(ip) and sending the result of that? That should help me make sure I have the right model string.

b-rowan commented 6 months ago

Additionally, you should use miner.set_power_limit() instead of calling the web commands directly if possible, https://docs.pyasic.org/en/latest/miners/functions/#pyasic.miners.base.MinerProtocol.set_power_limit

kamordi commented 6 months ago

Thanks for the advice, I will try to use it as designed.

As result I get Antminer S19k Pro Not as in my origin attempt in https://github.com/UpstreamData/pyasic/issues/78#issuecomment-1858879228

b-rowan commented 6 months ago

Should be fixed with 0.55.4. I really wish they would just pick a naming scheme and stick to it, but whatever.