Enhance switch_mode.py with menu
This commit is contained in:
@@ -2,13 +2,20 @@ import serial
|
||||
import time
|
||||
import glob
|
||||
import binascii
|
||||
import sys
|
||||
|
||||
# Gridseed Befehle (Hex Strings)
|
||||
# Scrypt Reset: 55AA1F2816000000 + 55AA1F2817000000
|
||||
# SHA256 Reset (Vermutung/Standard): 55AA1F2800000000
|
||||
# Init: 55AAC000C0C0C0C00500000001000000
|
||||
|
||||
CMD_SHA_RESET = "55AA1F2800000000"
|
||||
CMDS = {
|
||||
"1": ("SHA256 Force (00)", "55AA1F2800000000"),
|
||||
"2": ("Scrypt Force (16)", "55AA1F2816000000"),
|
||||
"3": ("Dual/Unkown (04)", "55AA1F2804000000"),
|
||||
"4": ("Reset Chip", "55AAC000808080800000000001000000"),
|
||||
"5": ("Full Init", "55AAC000C0C0C0C00500000001000000")
|
||||
}
|
||||
|
||||
def send_command(port, hex_cmd):
|
||||
try:
|
||||
@@ -24,21 +31,29 @@ def send_command(port, hex_cmd):
|
||||
return False
|
||||
|
||||
def main():
|
||||
print("=== Gridseed Mode Switcher (SHA256) ===")
|
||||
print("=== Gridseed Mode Switcher ===")
|
||||
print("Miner MUSS gestoppt sein!")
|
||||
|
||||
# Suche Gridseeds (meist ttyACM*)
|
||||
ports = glob.glob('/dev/ttyACM*')
|
||||
if not ports:
|
||||
print("Keine Gridseeds gefunden (/dev/ttyACM*)")
|
||||
return
|
||||
|
||||
print(f"Gefundene Geräte: {ports}")
|
||||
|
||||
for port in ports:
|
||||
# Sende SHA Reset
|
||||
send_command(port, CMD_SHA_RESET)
|
||||
|
||||
print("\nWähle Befehl:")
|
||||
for k, v in CMDS.items():
|
||||
print(f"{k}: {v[0]}")
|
||||
|
||||
print("Fertig. Starte Miner neu und prüfe Hashrate.")
|
||||
choice = input("Auswahl (1-5): ")
|
||||
|
||||
if choice in CMDS:
|
||||
desc, cmd = CMDS[choice]
|
||||
print(f"Sende {desc}...")
|
||||
for port in ports:
|
||||
send_command(port, cmd)
|
||||
else:
|
||||
print("Ungültige Auswahl")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
Reference in New Issue
Block a user