@echo off REM ============================================================ REM ORION Note10 — Ein-Klick ADB-Verbindung REM ============================================================ REM Ports: REM 8022 SSH (Termux) REM 5001 DDGK-Agent (Flask) REM 8001 Sensor-Server REM ============================================================ echo. echo ============================================ echo ORION Note10 — ADB Verbindung echo ============================================ echo. REM --- 1. ADB verfuegbarkeit pruefen --- where adb >nul 2>&1 if %ERRORLEVEL% neq 0 ( echo [FEHLER] ADB nicht gefunden. Installiere mit: echo winget install Google.PlatformTools echo. pause exit /b 1 ) echo [OK] ADB gefunden. echo. REM --- 2. Geraete-Liste --- echo --- Verbundene Geraete --- adb devices echo. REM --- 3. Geraet vorhanden? --- adb devices | findstr /R "[0-9a-zA-Z].*device$" >nul 2>&1 if %ERRORLEVEL% neq 0 ( echo [FEHLER] Kein Note10 verbunden. echo 1. USB-Kabel anschliessen echo 2. Auf dem Handy "USB-Debugging zulassen" tippen echo 3. Dieses Script erneut ausfuehren echo. echo Alternativ — Wireless ADB (einmalig USB noetig): echo adb tcpip 5555 echo adb connect ^:5555 echo. pause exit /b 1 ) echo [OK] Note10 erkannt. echo. REM --- 4. Alte Forwards loeschen (sauberer Start) --- echo --- Alte Forwards loeschen ... --- for /f "tokens=2" %%a in ('adb forward --list 2^>nul ^| findstr "tcp:"') do ( for /f "tokens=1" %%p in ("%%a") do ( for /f "tokens=3" %%f in ("%%a") do ( adb forward --remove %%p >nul 2>&1 ) ) ) REM --- 5. Port Forwards setzen --- echo --- Setze Port Forwards --- adb forward tcp:8022 tcp:8022 if %ERRORLEVEL% equ 0 (echo [OK] 8022 - SSH/Termux) else (echo [!!] 8022 - FEHLER) adb forward tcp:5001 tcp:5001 if %ERRORLEVEL% equ 0 (echo [OK] 5001 - DDGK-Agent) else (echo [!!] 5001 - FEHLER) adb forward tcp:8001 tcp:8001 if %ERRORLEVEL% equ 0 (echo [OK] 8001 - Sensor-Server) else (echo [!!] 8001 - FEHLER) echo. REM --- 6. Forward-Liste bestaetigen --- echo --- Aktive Forwards --- adb forward --list echo. REM --- 7. Health-Checks --- echo --- Health-Checks (3s Timeout) --- curl -s -m 3 http://localhost:5001/health >nul 2>&1 if %ERRORLEVEL% equ 0 ( echo [OK] DDGK-Agent (Port 5001) antwortet ) else ( echo [!!] DDGK-Agent (Port 5001) — nicht erreichbar echo Starte auf dem Note10: python ddgk_note10_agent.py ) curl -s -m 3 http://localhost:8001/ping >nul 2>&1 if %ERRORLEVEL% equ 0 ( echo [OK] Sensor-Server (Port 8001) antwortet ) else ( echo [!!] Sensor-Server (Port 8001) — nicht erreichbar echo Starte auf dem Note10: python note10_start_sensor.py ) curl -s -m 3 -o nul -w "%%{http_code}" http://localhost:8022 2>nul | findstr "200" >nul 2>&1 if %ERRORLEVEL% equ 0 ( echo [OK] SSH/Termux (Port 8022) antwortet ) else ( echo [~~] SSH/Termux (Port 8022) — SSH antwortet nicht auf HTTP (erwartet) ) echo. echo ============================================ echo Verbindung hergestellt. echo SSH: ssh -p 8022 u0_a322@localhost echo DDGK: http://localhost:5001/health echo Sensor: http://localhost:8001/ping echo ============================================ echo. pause