@echo off title eInk Dashboard Server cd /d "D:\D Desktop\Projects\eInk_dashboard" echo ============================================ echo eInk Morning Dashboard - Starting... echo ============================================ echo. :: Kill any existing dashboard refresh loop and python server on port 8080 first powershell -NoProfile -Command "Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like '*dashboard_loop.ps1*' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }" powershell -NoProfile -Command "Get-NetTCPConnection -LocalPort 8080 -ErrorAction SilentlyContinue | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force -ErrorAction SilentlyContinue }" :: Generate the first dashboard immediately, then refresh hourly in the background echo [1/3] Generating dashboard... python "%CD%\generate_dashboard.py" echo [2/3] Starting hourly dashboard refresh... start "eInk-Refresh" /min powershell -NoProfile -ExecutionPolicy Bypass -File "%CD%\dashboard_loop.ps1" :: Start Python HTTP server in minimized background window echo [3/3] Starting file server on port 8080... start "eInk-HTTP" /min python -m http.server 8080 :: Wait for server to come up ping -n 3 127.0.0.1 >nul :: Verify it's running powershell -NoProfile -Command "if (Get-NetTCPConnection -LocalPort 8080 -ErrorAction SilentlyContinue) { exit 0 } else { exit 1 }" if %errorlevel% == 0 ( echo [3/3] File server running at http://localhost:8080 ) else ( echo [ERROR] Python server failed to start. Is Python installed? pause exit /b 1 ) echo. echo Enabling Tailscale Funnel on port 8080... tailscale funnel --bg 8080 echo. echo ============================================ echo DASHBOARD IS LIVE echo ============================================ echo. echo Your morning.md is publicly accessible at: echo. tailscale funnel status 2>&1 | findstr "https://" echo. echo Copy the URL above + "/morning.md" into: echo SD card: .crosspoint\dashboard\settings.json echo. echo ============================================ echo morning.md refreshes automatically every hour. echo Run stop.bat when done. echo ============================================ echo. pause