Unofficial python api for MicroBT Whatsminer ASICs

Overview

whatsminer-api

Unofficial python api for MicroBT Whatsminer ASICs

Code adapted from a python file found in the Whatsminer Telegram group that is credited to @passby

Installation

Python 3.x is required.

pip install whatsminer

Basic Usage

Instantiate a WhatsminerAccessToken for each ASIC that you want to access. Then make read-only or writeable API calls through WhatsminerAPI

Read-only information can be retrieved with just the ASIC's ip address:

from whatsminer import WhatsminerAccessToken, WhatsminerAPI

token = WhatsminerAccessToken(ip_address="192.168.1.100")
summary_json = WhatsminerAPI.get_read_only_info(access_token=token,
                                                cmd="summary")

The writeable API commands can be executed by providing the ASIC's admin password:

# The token from above can be enabled for writeable access:
token.enable_write_access(admin_password="the_admin_password")

# Or you can directly instantiate a writeable one:
token = WhatsminerAccessToken(ip_address="192.168.1.100",
                              admin_password="the_admin_passwd")

json_response = WhatsminerAPI.exec_command(access_token=token, 
                                           cmd="power_off",
                                           additional_params={"respbefore": "true"})

Writeable WhatsminerAccessToken objs will renew themselves if they go past the API's 30min expiration.

Managing multiple ASICs

You could define a whole server farm's worth of Whatsminer ASICs and manage them all in one script:

asics = [
    ('192.168.1.100', 'some_admin_pass'),
    ('192.168.1.101', 'some_admin_pass'),
    ('192.168.1.102', 'some_admin_pass'),
    ('192.168.1.103', 'some_admin_pass'),
    ('192.168.1.104', 'some_admin_pass'),
    ('192.168.1.105', 'some_admin_pass'),
]
tokens = []
for asic_info in asics:
    tokens.append(WhatsminerAccessToken(ip_address=asic_info[0], admin_password=asic_info[1]))

# Find machines running too hot
for token in tokens:
    json_summary = WhatsminerAPI.get_read_only_info(access_token=token, cmd="summary")
    if json_summary['SUMMARY'][0]['Temperature'] > 78.0:
        # stop mining on this ASIC
        WhatsminerAPI.exec_command(access_token=token, cmd="power_off", additional_params={"respbefore": "true"})

API Documentation

It's very difficult to find any information about the Whatsminer API. This PDF documentation is slightly out of date but is the best source found so far:

WhatsminerAPIV1.3.8.pdf

Package distribution notes

There are just notes to self for updating the pypi distribution

  • Update the release number in setup.py and commit to repo.
  • Draft a new release in github using the same release number.
  • Run python setup.py sdist
  • Publish the distribution to pypi: twine upload dist/*
You might also like...
TeslaPy - A Python implementation based on unofficial documentation of the client side interface to the Tesla Motors Owner API
TeslaPy - A Python implementation based on unofficial documentation of the client side interface to the Tesla Motors Owner API

TeslaPy - A Python implementation based on unofficial documentation of the client side interface to the Tesla Motors Owner API, which provides functiona

Unofficial instagram API, give you access to ALL instagram features (like, follow, upload photo and video and etc)! Write on python.

Instagram-API-python Unofficial Instagram API to give you access to ALL Instagram features (like, follow, upload photo and video, etc)! Written in Pyt

An unofficial Python wrapper for the 'Binance exchange REST API'

Welcome to binex_f v0.1.0 many interfaces are heavily used by myself in product environment, the websocket is reliable (re)connected. Latest version:

✖️ Unofficial API of 1337x.to
✖️ Unofficial API of 1337x.to

✖️ Unofficial Python API Wrapper of 1337x This is the unofficial API of 1337x. It supports all proxies of 1337x and almost all functions of 1337x. You

This is a simple unofficial async Api-wrapper for tio.run

Async-Tio This is a simple unofficial async Api-wrapper for tio.run

Unofficial API wrapper for seedr.cc

Seedr API Unofficial API wrapper for seedr.cc Inspired by theabbie's seedr-api Powered by @harp_tech (Telegram) How to use You can install lib via git

Easy Google Translate: Unofficial Google Translate API

easygoogletranslate Unofficial Google Translate API. This library does not need an api key or something else to use, it's free and simple. You can eit

Clash of Clans developer unofficial api Wrapper to generate ip based token

Clash of Clans developer unofficial api Wrapper to generate ip based token

An Unofficial API for 1337x, Piratebay, Nyaasi, Torlock, Torrent Galaxy, Zooqle, Kickass, Bitsearch, and MagnetDL

An Unofficial API for 1337x, Piratebay, Nyaasi, Torlock, Torrent Galaxy, Zooqle, Kickass, Bitsearch, and MagnetDL

Releases(0.1.2)
Owner
Satoshi Anonymoto
no, not that Satoshi you idiots.
Satoshi Anonymoto
Discord Token Checker

Discord-Token-Checker Optimizations Asynchronous Fast & Efficient Multi Tasked Proxy support (socks4/socks5/http) Usage Put tasks depending on your PC

scripted 6 May 05, 2022
🚀 A fast, flexible and lightweight Discord API wrapper for Python.

Krema A fast, flexible and lightweight Discord API wrapper for Python. Installation Unikorn unikorn add kremayard krema -no-confirmation Pip pip insta

Krema 20 Sep 04, 2022
⚡ PoC: Hide a c&c botnet in the discord client. (Proof Of Concept)

👨‍💻 Discord Self Bot 👨‍💻 A Discord Self-Bot in Python by natrix Installation Run: selfbot.bat Python: version : 3.8 Modules

0хVιcнy#1337 37 Oct 21, 2022
A way to export your saved reddit posts to a Notion table.

reddit-saved-to-notion A way to export your saved reddit posts and comments to a Notion table.Uses notion-sdk-py and praw for interacting with Notion

19 Sep 12, 2022
🤖 Telegram UserBot Untuk Memutar Lagu Dan Video Di Obrolan Suara Telegram.

🤖 Telegram UserBot Untuk Memutar Lagu Dan Video Di Obrolan Suara Telegram.

Fariz 2 Nov 13, 2021
Visualização de dados do TaxiGov.

Visualização de dados do TaxiGov Este repositório apresenta uma visualização das corridas de táxi do programa TaxiGov do governo federal, realizadas n

Ministério da Economia do Brasil 5 Dec 20, 2022
Simple VK API wrapper for Python

VK Admier: documentation VK Admier is simple VK API wrapper for community bot development. Authorization You should create bot object from Client clas

Egor Light 2 Nov 10, 2022
Discord-shell - Reverse shell accessible via discord.py bot

Discord-shell reverse shell on discord bot. (STILL IN DEVELOPMENT) Installation

Skultz 6 Oct 21, 2022
An advanced Twitter scraping & OSINT tool written in Python that doesn't use Twitter's API, allowing you to scrape a user's followers, following, Tweets and more while evading most API limitations.

TWINT - Twitter Intelligence Tool No authentication. No API. No limits. Twint is an advanced Twitter scraping tool written in Python that allows for s

TWINT Project 14.2k Jan 03, 2023
Tracks twitter spaces and sends it to a discord webhook.

Tracks twitter spaces and sends it to a discord webhook. Uses the twitter api to find twitter spaces and then the m3u8 url for the space is found using selenium and will have it posted using a discor

Sam Phung 20 Dec 17, 2022
Telegram File to Link Fastest Bot , also used for movies streaming

Telegram File Stream Bot ! A Telegram bot to stream files to web. Report a Bug | Request Feature About This Bot This bot will give you stream links fo

Avishkar Patil 194 Jan 07, 2023
Python3 library that can retrieve Chrome-based browser's saved login info.

Passax EDUCATIONAL PURPOSES ONLY Python3 library that can retrieve Chrome-based browser's saved login info. Requirements secretstorage~=3.3.1 pywin32=

Auax 1 Jan 25, 2022
Telegram bot to provide links of different types of files you send

File To Link Bot - IDN-C-X Telegram bot to provide links of different types of files you send. WHAT CAN THIS BOT DO Is it a nuisance to send huge file

IDNCoderX 3 Oct 26, 2021
❤️A next gen powerful telegram group manager bot for manage your groups and have fun with other cool modules

Natsuki Based on Python Telegram Bot Contributors Video Tutorial: Complete guide on deploying @TheNatsukiBot's clone on Heroku. ☆ Video by Sadew Jayas

Pawan Theekshana 8 Oct 06, 2022
This is a simple bot that can be used to upload images to a third-party cloud (image hosting). Currently, only the imgbb.com website supports the bot. I Will do future updates

TGImageHosting This is a simple bot that can be used to upload images to a third party cloud (image hosting). Currently, only the imgbb.com website su

Abhijith N T 0 Dec 26, 2021
Discondelete, is a Discord self-bot to delete dm's or purge all messages from a guild.

Discondelete Discondelete, is a Discord self-bot to delete dm's or purge all messages from a guild. Report Bug · Request Feature Table of Contents Abo

core 4 Feb 28, 2022
EpikCord.py - This is an API Wrapper for Discord's API for Python

EpikCord.py - This is an API Wrapper for Discord's API for Python! We've decided not to fork discord.py and start completely from scratch for a new, better structuring system!

EpikHost 28 Oct 10, 2022
Instadev - Crack Instagram IqbalDev

Crack Instagram IqbalDev ⇨ Install Script Di Termux $ pkg update && upgrade $

Dicky Wahyudi 1 Feb 27, 2022
Busty - A bot for the Busty Discord server

Busty Discord bot used for the Busty server. Install You'll need at least Python

Andrew Morgan 7 Dec 05, 2022
This is a script to export logs from AWS CloudTrail to a local file.

cloudtrail-export-logs This is a script to export logs from AWS CloudTrail to a local file. Getting Started Prerequisites python 3 boto3 pip Installin

Claick Assunção de Oliveira 2 Jan 02, 2022