Schedule Bitmain Antminer

Published: 07 January 2023
on channel: Philip D'Ath
2,955
56

How do I schedule my #Bitmain #Antminer S19 to stop and start mining?
Perhaps you are like me and get different power rates at different times of the day.

The below Python script will allow you to change the power mode of a Bitmain Antminer S19 between sleep (which is stopped), normal (which is maximum performance) and low-power (which is maximum efficiency).

You can combine this with the task scheduling system on your computer to change modes whenever you want.


#!/usr/bin/env python3
# https://bitcointalk.org/index.php?top...
import sys,requests
from requests.auth import HTTPDigestAuth
import json
import argparse
from ipaddress import ip_address

text="""
antminer-mode.py allows you to set the power mode on the Bitmain Antminer
S19 series of BTC ASICs.
"""

parser = argparse.ArgumentParser(description = text)
parser.add_argument("-u","--username",required=True,help="Username for the Antminer")
parser.add_argument("-p","--password",required=True,help="Password for the Antminer")
parser.add_argument("-ip","--ip-address",required=True,type=ip_address,help="IP Address of Antminer")
parser.add_argument("-m","--mode",required=True,choices=['sleep','normal','low-power'],help="Which operating mode to put Antminer into")
args=parser.parse_args()

# Specific a default mode of "sleep"
minerMode="1"
if args.mode == "normal":
minerMode="0"
elif args.mode == "low-power":
minerMode="3"

confData = {}
confData['miner-mode'] = minerMode

confPayload = json.dumps(confData)
setConfAddr = '/cgi-bin/set_miner_conf.cgi'

print(f"Setting {args.ip_address} to {args.mode} mode.")

try:
r = requests.post('http://' + str(args.ip_address) + setConfAddr, auth=HTTPDigestAuth(args.username, args.password), data=confPayload)
except requests.exceptions.RequestException as e:
sys.exit("post ant miner configuration failed."+e)


Watch video Schedule Bitmain Antminer online without registration, duration hours minute second in high quality. This video was added by user Philip D'Ath 07 January 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,955 once and liked it 56 people.