57 Commits

Author SHA1 Message Date
2d68387ed1 Add interactive guided tour with driver.js
6-step spotlight tour (Scan → Connect → Manage → Flash → Workspace → Inference)
with step completion validation, polling auto-detection, and i18n support (en/zh-TW).
Triggered from onboarding dialog or header help button.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 11:29:05 +08:00
7b4492c41e Update PRD v3.2 + TDD v2.1: WinUSB auto-install, ffmpeg, uninstall fixes
PRD v3.2:
- Document WinUSB driver auto-install (self-signed cert + pnputil)
- ffmpeg/yt-dlp now mandatory install components
- Update uninstall description (Wails native dialog, preserve system deps)
- Fix packaging output description (DMG + ad-hoc codesign)

TDD v2.1:
- Rewrite install steps to match actual 11-step implementation
- Add detailed Windows WinUSB driver install flow (self-sign + pnputil)
- Update uninstall flow with ConfirmUninstall native dialog
- Update ProgressEvent struct to match actual implementation

Installer:
- Add ConfirmUninstall() with Wails native MessageDialog
- Replace JS confirm() with Go native dialog (fixes macOS WebView issue)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 02:10:28 +08:00
98b89fe104 Fix WinUSB driver install: self-signed cert + pnputil approach
Replace DiInstallDriverW (failed with 0xE000022F / no catalog) with
proven approach: create self-signed code signing cert via PowerShell
New-SelfSignedCertificate, install to TrustedPublisher + Root stores
via certutil, then use pnputil /add-driver /install which accepts
the unsigned INF when cert is trusted. Removes syscall/unsafe deps.

Tested successfully on Windows: KL520 + KL720 drivers installed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:49:51 +08:00
9ec1926133 Add self-signed cert + catalog approach for driver installation
New flow: PowerShell New-SelfSignedCertificate → install to
TrustedPublisher/Root stores → create .cat via inf2cat/makecat/
New-FileCatalog → sign with signtool/Set-AuthenticodeSignature →
pnputil /install. Falls back to SetupAPI DIF_INSTALLDEVICE.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:41:19 +08:00
c9b0ae5b89 Improve test tool: proper REG_MULTI_SZ parsing and device enumeration debug
- Parse MULTI_SZ hardware IDs correctly (was only reading first string)
- Add device listing step to show all Kneron devices with Hardware IDs
- Case-insensitive HWID matching
- Better debug output at each SetupAPI step

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:33:55 +08:00
0c45e77911 Add SetupAPI direct device node driver install method to test tool
Method 3 uses SetupDiGetClassDevs + SetupDiEnumDeviceInfo to find the
exact device node, then SetupDiBuildDriverInfoList + DIF_SELECTBESTCOMPATDRV
+ DIF_INSTALLDEVICE to install driver directly on the device, bypassing
the catalog signature check that blocks Methods 1 and 2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:31:10 +08:00
17110a1606 Add UpdateDriverForPlugAndPlayDevicesW to driver install test tool
Test both methods: UpdateDriverForPlugAndPlayDevicesW (with Hardware ID
matching) and DiInstallDriverW. Also includes go.mod and pre-built exe.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:25:44 +08:00
faa4e86a19 chore: add test tool for DiInstallDriverW debugging on Windows
Build: already cross-compiled as test_driver_install.exe
Usage: .\test_driver_install.exe "C:\path\to\kneron_winusb.inf"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:15:31 +08:00
cc1edfc89d fix: use DiInstallDriver API for WinUSB driver installation
pnputil rejects unsigned INF, installer_x64.exe is not a CLI tool.
Switch to calling Windows DiInstallDriverW from newdev.dll directly,
which can install unsigned drivers with a user confirmation dialog.
Uses DIIRFLAG_FORCE_INF flag to force INF installation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:50:57 +08:00
2ab910d5ca fix: use Kneron official driver installer instead of pnputil
pnputil rejects unsigned INF files ("does not contain digital signature
information"). Replace with installer_x64.exe (libwdi-based) from
Kneron SDK, which handles driver signing automatically with a
self-signed certificate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:38:27 +08:00
22d6076568 fix: clear stale DeviceGroup before retry to prevent access violation
When connect fails, the partially-created DeviceGroup object could
trigger an access violation in __del__ during GC. Explicitly set
_device_group = None before each retry and in the except handler.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:21:08 +08:00
eca1363298 docs: update PRD v3.1 and TDD v2.0 with recent installer features
PRD F17: WinUSB auto-install, ffmpeg/yt-dlp auto-install, Windows
native tray (--gui mode), Registry Run auto-start, KneronPLUS SDK.
PRD F18: KL520 USB Boot connect retry mechanism.
TDD 8.5.14: Complete 11-step install flow, WinUSB driver details,
Windows syscall tray implementation, Python auto-install.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:01:28 +08:00
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