From b932467595dd9383c15a7c6798bacd838ee2b554 Mon Sep 17 00:00:00 2001 From: Gemini Bot Date: Wed, 21 Jan 2026 15:05:30 +0000 Subject: [PATCH] Enhance switch_mode.py with menu --- switch_mode.py | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/switch_mode.py b/switch_mode.py index fdb16c2..b7fafab 100644 --- a/switch_mode.py +++ b/switch_mode.py @@ -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() \ No newline at end of file