45 Commits

Author SHA1 Message Date
f744e8ca26 feat: auto-install WinUSB driver for Kneron devices on Windows
Bundle WinUSB driver INF + co-installer DLLs in installer payload.
During USB driver setup step, extract driver files and run pnputil to
install the WinUSB driver for all Kneron devices (KL520 VID_3231&PID_0100,
KL720 VID_3231&PID_0200, KL720v2 VID_3231&PID_0720).

This eliminates the need for manual Zadig installation, which was the
root cause of KP_ERROR_CONNECT_FAILED_28 on Windows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:58:45 +08:00
49bdef68c7 fix: increase device connect timeout from 30s to 60s
KL520 USB Boot flow needs ~40s: retry connect (3x2s) + firmware load +
5s reboot wait + reconnect retry (3x3s). 30s was too tight.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:39:35 +08:00
9950bf7232 fix: add retry logic for KL520 USB connect and better error hints
- Retry connect up to 3 times with 2s delay and re-scan between attempts
- Re-scan refreshes USB device handles which can resolve timing issues
- Add Windows-specific hint about Zadig/WinUSB driver in error message
- Firmware reload reconnect also gets retry + fallback to without_check

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:31:35 +08:00
4ad39d2f17 feat: auto-install ffmpeg and yt-dlp during GUI installation
Add "Installing media tools" step to the installer that automatically
installs ffmpeg and yt-dlp if not already present on the system.
Uses winget (Windows), Homebrew (macOS), or apt-get (Linux).
Non-critical step — installation continues even if this fails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:25:45 +08:00
b07e47c517 fix: allow connecting to KL520 in USB Boot mode (is_connectable=False)
KL520 in USB Boot mode reports is_connectable=False, which is normal -
firmware must be loaded first. The previous code rejected the connection
attempt early. Now we use connect_devices_without_check() for devices
that are not yet connectable, then proceed with firmware loading.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:15:53 +08:00
f2596511e0 fix: bundle KneronPLUS SDK wheel for Windows device detection
The server's kneron_bridge.py requires the `kp` (KneronPLUS) module
to detect devices. Without it, HAS_KP=False and scan returns empty.

Changes:
- build-installer.ps1: copy KneronPLUS*.whl to payload/scripts/
- Makefile: same for macOS builds
- CI workflows: same for GitHub/Gitea Actions
- installer app.go: pip install the bundled wheel after requirements.txt

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:10:03 +08:00
c8e628c6ca fix: tray icon, console window, and device detection on Windows
Tray icon:
- Embed proper ICO files (green=running, red=stopped) instead of
  generic IDI_APPLICATION icon
- Switch icon dynamically based on server state

Console window:
- FreeConsole() to fully detach from parent console
- CREATE_NO_WINDOW flag on child server process to prevent
  black console window from appearing

Device detection:
- ResolvePython: add Windows venv paths (Scripts/python.exe) and
  %LOCALAPPDATA%\EdgeAIPlatform\venv, fallback to exec.LookPath
- DetectDevices + startPython: prepend install dir to PATH so
  libusb-1.0.dll is found by pyusb/kp SDK
- Also hide "cmd /c start" console when opening browser

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:01:59 +08:00
4e44406e71 fix: resolve "no backend available" libusb error on Windows
kneron_detect.py now prepends the install directory to PATH before
importing pyusb, so libusb-1.0.dll in the install dir is found.
DetectHardware() also sets PATH in the subprocess environment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:48:09 +08:00
74a850a00c feat: replace web GUI with native Windows system tray via syscall
- webgui.go: Native Windows tray icon + right-click popup menu using
  pure syscall (Shell_NotifyIconW, CreatePopupMenu, etc.)
  - No CGO required, no external dependencies
  - Shows server status, Start/Stop, Open Dashboard, Quit
  - Hides console window on startup
  - Handles OS signals and Windows session end
- webgui_other.go: Stub for non-Windows notray builds
- Remove webgui_html.go (browser-based approach no longer needed)
- Fix auto-start: replace schtasks (fails on Chinese Windows) with
  Registry Run key (HKCU\...\Run) which works without admin and
  has no locale encoding issues

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:41:26 +08:00
db6388523f feat: add --gui mode for Windows web-based server controller
Add a CGO-free alternative to the systray-based --tray mode. When
launched with --gui, the server starts a lightweight HTTP control panel
in the browser where users can start/stop the server, open the dashboard,
and view relay status.

New files:
- server/tray/webgui.go: HTTP API backend + child process management
- server/tray/webgui_html.go: Embedded HTML control panel

Modified:
- config.go: Add --gui flag
- main.go: Route --gui to RunWebGUI()
- tray.go: Add RunWebGUI stub for tray-enabled builds
- installer: Windows uses --gui instead of bare launch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:14:42 +08:00
53e0ba025c fix: Windows installer server launch and auto-start issues
- Remove --tray flag from LaunchServer() on Windows (notray build)
- Switch schtasks from PowerShell Register-ScheduledTask to schtasks CLI
  for Chinese Windows compatibility
- Remove /RL HIGHEST from schtasks (requires admin privileges)
- Add install log output to %TEMP%/edgeai-install.log
- Add critical flag to install steps (critical failures abort)
- Fix extractDir: create parent dirs before writing files
- Improve findPython3: skip Windows Store stub, auto-install via winget
- Enhance installLibusb: extract bundled DLL, fallback to winget

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:05:03 +08:00
551dee46cc feat: add Windows installer build script
One-command build: powershell -ExecutionPolicy Bypass -File scripts\build-installer.ps1
Checks prerequisites, builds frontend/server, stages payload, and
produces EdgeAI-Installer.exe via Wails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:48:38 +08:00
522800cc7d feat: auto-install libusb on Windows from bundled DLL
- installLibusb now extracts libusb-1.0.dll from payload to install dir
- Falls back to winget, then shows Zadig download link
- checkLibusbInstalled also checks install directory
- CI workflow copies libusb-1.0.dll into payload during staging

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:47:19 +08:00
8ac02b3b35 fix: Windows installer issues - Python detection and scheduled task
- findPython3: skip Windows Store stub (WindowsApps), search common
  install locations (LocalAppData/Programs/Python/PythonXXX)
- installAutoRestart: use schtasks instead of PowerShell
  Register-ScheduledTask to avoid XML parsing errors on non-English
  (Chinese) Windows

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:45:53 +08:00
9110e1647d fix: ensure parent directories exist before extracting files
extractDir was writing files without creating parent directories first,
causing "The system cannot find the path specified" errors on Windows
when models.json was walked before the data/ directory entry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:41:23 +08:00
ecabffc890 feat: write installation log to temp directory
Installer now writes a detailed log to %TEMP%/edgeai-install.log
(or /tmp/edgeai-install.log on macOS/Linux) with OK/FAIL status for
each step. Log path is shown on completion and in error messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:35:57 +08:00
67242de577 feat: auto-install Python 3 via winget on Windows
When Python 3 is not found during installation on Windows, the installer
now automatically attempts to install it using winget (Python.Python.3.12).
Falls back to manual install prompt if winget is unavailable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:22:05 +08:00
3bc537df95 fix: abort installation on critical step failure
Previously all step errors were treated as warnings and installation
continued silently. Now critical steps (create dir, extract binary,
extract data/scripts, write config) will abort with an error message.
Non-critical steps (libusb, python venv, symlink, auto-start) still
warn and skip.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:15:21 +08:00
5d9ef44526 Merge branch 'main' of https://gitea.innovedus.com/warrenchen/web_academy_prototype 2026-03-09 17:13:46 +08:00
31b64ef6df docs: add prerequisite install commands to Windows build guide
Added winget install commands and verification steps for Go, Node.js,
Git, pnpm, and Wails CLI in TDD section 11.7.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 16:59:22 +08:00
1eab9b7ceb docs: add Go HTTP alternative architecture and Windows build guide to TDD
- Section 8.5.14: added alternative architecture comparison table
  (Wails v2 vs Go HTTP + embedded Web UI) for future cross-compile reference
- Section 11.7: added step-by-step Windows installer build guide
  with PowerShell commands

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 01:10:17 +08:00
ff7dfb3562 ci: add continue-on-error to artifact upload steps
Prevents artifact storage quota issues from blocking the entire build.
Build jobs will succeed even if upload fails, allowing release job to proceed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 00:11:29 +08:00
eb68ab28f3 Merge branch 'main' of https://gitea.innovedus.com/warrenchen/web_academy_prototype 2026-03-07 05:40:46 +08:00
d652f38c41 ci: set artifact retention to 3 days to prevent storage quota issues
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 05:40:20 +08:00
2be1d4d8d5 merge: resolve frontend submodule conflict, keep as normal directory
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 05:26:28 +08:00
c6ba353337 fix: convert frontend from submodule reference to normal directory
The frontend directory was incorrectly stored as a git submodule pointer
(160000 commit), causing CI checkout to produce an empty directory.
This converts it to a regular tracked directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 05:25:51 +08:00
7a84f9e320 ci: add GitHub Actions workflow for macOS + Windows installer builds
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 04:24:24 +08:00
0b00bc82e4 fix: move CI workflow to repo root and update paths
Gitea Actions requires .gitea/workflows/ at repo root.
Updated all paths to use edge-ai-platform/ prefix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 03:50:14 +08:00
74fb9ce6aa restore: add back local_service_win to repo root
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 03:15:45 +08:00
5324408b84 refactor: reorganize repo — move edge-ai-platform to subdirectory
- Move all Edge AI Platform code into edge-ai-platform/ subdirectory
- Remove legacy local_service_win/ and relay-server-linux binary
- Keep docs/ and README.md at repo root
- Update docs to latest PRD v3.1 and TDD v2.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 02:41:24 +08:00
93b43235a9 merge: bring master into main
Merge installer improvements, CI workflow, and full frontend codebase.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

# Conflicts:
#	README.md
2026-03-07 02:28:56 +08:00
f27ed20cbc feat: installer improvements + CI workflow
- Auto-generate random relay token during installation
- Pre-fill relay URL and dashboard URL with EC2 defaults
- Fix hardware detection duplicate device parsing
- Add Dashboard URL field to relay config step
- Launch Server now auto-opens dashboard URL with token
- Add ad-hoc codesign to Makefile installer target
- Remove binary from git tracking
- Add Gitea Actions CI workflow for macOS + Windows builds

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 02:12:25 +08:00
d8128b6c75 initial 2026-03-06 17:33:30 +08:00
warrenchen
8a6a1e40b4 Add video inference viewer for object detection
- Implemented a new script `video_inference_viewer.py` for processing video files and performing inference using a specified model.
- Added functionality to encode frames in various formats and send them to a specified inference server.
- Included methods for decoding model outputs, applying non-maximum suppression (NMS), and drawing bounding boxes on the video frames.
- Integrated command-line arguments for configuration, including model ID, input dimensions, and output options.
- Added a graphical file dialog for selecting video files.
2026-03-04 11:53:46 +09:00
warrenchen
11e779bb40 Merge branch 'main' of https://gitea.innovedus.com/warrenchen/web_academy_prototype 2026-03-03 16:05:47 +09:00
warrenchen
f85613b8a6 Add new images, firmware files, and update versioning for KL520, KL630, KL720, and KL730
- Added new images: bike_cars_street_224x224.bmp and one_bike_many_cars_800x800.bmp.
- Updated TEST_PAIRS.md to reflect new source paths for YOLOv5 and FCOS models.
- Introduced VERSION files for KL520 (2.2.0), KL630 (SDK-v2.5.7), and KL720 (2.2.0).
- Added firmware binaries for KL520, KL630, KL720, and KL730.
- Updated third-party Kneron_DFUT resources, including new binaries and translations.
- Added KneronPLUS-1.2.1.zip to third-party resources.
2026-03-03 15:21:59 +09:00
0103a483b8 docs: add F19 cluster inference specs to PRD + TDD
- PRD v2.7: F19 multi-device cluster inference feature spec
- TDD v1.6: 8.5.15 cluster architecture, dispatcher, pipeline, API design

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 10:33:55 +08:00
f322557af3 docs: add KL720 hardware support and GUI installer design
PRD v2.6:
- F17: complete GUI installer spec (Wails v2, 6-step wizard, auto deps)
- F18: expand from KL520-only to KL520+KL720 dual-chip support
- KDP→KDP2 firmware update, cross-chip model path resolution

TDD v1.5:
- Section 5.2: rewrite Kneron driver with chip-aware architecture
- Section 8.5.13: dual-chip communication diagram + KL720 verification
- Section 8.5.14: new GUI installer technical design (Wails, Go API,
  install/uninstall flow, platform-specific handling, ASCII mockups)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 14:09:21 +08:00
3f02435414 docs: add F18 KL520 hardware integration specs to PRD + TDD
PRD v2.5:
- Add F18: Kneron KL520 hardware communication integration
  - USB Boot mode with auto firmware loading
  - JSON-RPC bridge architecture (Go → Python → SDK → USB)
  - Tiny YOLO v3 inference verified (~25ms latency)
  - COCO 80-class detection with NMS post-processing

TDD v1.4:
- Update 5.2: Replace placeholder driver with actual implementation
  - KL720Driver with JSON-RPC over stdin/stdout
  - Python bridge command protocol table
  - KL520 USB Boot connection flow
- Add 8.5.13: KL520 technical mapping with architecture diagram,
  inference pipeline code, YOLO post-processing specs,
  Apple Silicon compatibility notes, and verified detection results
- Update 11.5: Add firmware files, kp module, and scripts directory structure
- Update directory structure to match actual driver files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 04:52:22 +08:00
8c75a6508a docs: add F16 installation/distribution and F17 GUI installer specs
PRD v2.4: Added F16 (cross-platform install scripts, GoReleaser packaging,
startup dependency check, Kneron hardware detection) and F17 (planned GUI
installer wizard for non-technical users).

TDD v1.3: Added 8.5.12 (F16 technical mapping with install flow diagrams),
11.5 (installation scripts documentation), 11.6 (startup dependency checker).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 00:07:35 +08:00
b28aec2589 docs: 新增 F14 批次圖片推論、F15 攝影機自動偵測功能文件
PRD B4.5:
- 額外功能由 9 項更新為 11 項
- F5 補充批次圖片推論和拖放上傳說明
- 新增 F14(批次圖片推論)功能規格
- 新增 F15(攝影機自動偵測)功能規格
- i18n 翻譯 key 數量更新為 130+

TDD 8.5:
- 8.5.1 F5 表格新增批次圖片 API
- 新增 8.5.8 自訂模型上傳(F11)技術對照
- 新增 8.5.9 裝置健康狀態(F13)技術對照
- 新增 8.5.10 批次圖片推論(F14)完整技術對照
- 新增 8.5.11 攝影機自動偵測(F15)技術對照

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 04:30:18 +08:00
edc8355c23 docs: 更新 PRD v2.3 + 新增 TDD v1.2
- PRD: 新增 B4.5 已實作額外功能(i18n、深色模式、多來源推論、Dashboard 等 9 項)
- TDD: 新增技術設計文件,涵蓋前後端架構、通訊協定、Driver 抽象層、Camera Pipeline

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 01:03:33 +08:00
warrenchen
6f3800687e Add local service (win) 2026-02-13 13:48:43 +09:00
1902cd0f84 docs: 更新 PRD 至 v2.2 — 新增 Kneron 硬體規格與路線圖
- 新增 B3.7 硬體支援路線圖(Kneron Dongle → Arduino/KNEO Pi → 開放)
- 新增 B3.8 硬體技術規格(KL720/KL730 晶片規格、Kneron PLUS SDK、Toolchain、KneronDFUT)
- 新增 A6.3 TOP 3 痛點深度解析(部署後監控、模型漂移偵測、主動學習閉環)
- 更新產品定位為 Kneron 晶片深度整合策略
- 更新 B4.3 燒錄協定為具體 Kneron PLUS SDK API
- 新增 C3 Kneron 硬體與 SDK 參考來源

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:06:11 +08:00
b34c23d184 上傳檔案到「docs」 2026-02-12 13:48:52 +00:00