feat: live ESP32 CSI pipeline + auto-connect WebSocket
- Add auto-connect to local sensing server WebSocket (ws://localhost:8765) - Demo shows "Live ESP32" when connected to real CSI data - Add build_firmware.ps1 for native Windows ESP-IDF builds (no Docker) - Add read_serial.ps1 for ESP32 serial monitor Pipeline: ESP32 → UDP:5005 → sensing-server → WS:8765 → browser demo Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
parent
4ce8ffc465
commit
2f5e7ffb41
|
|
@ -0,0 +1,31 @@
|
|||
# Remove MSYS environment variables that trigger ESP-IDF's MinGW rejection
|
||||
Remove-Item env:MSYSTEM -ErrorAction SilentlyContinue
|
||||
Remove-Item env:MSYSTEM_CARCH -ErrorAction SilentlyContinue
|
||||
Remove-Item env:MSYSTEM_CHOST -ErrorAction SilentlyContinue
|
||||
Remove-Item env:MSYSTEM_PREFIX -ErrorAction SilentlyContinue
|
||||
Remove-Item env:MINGW_CHOST -ErrorAction SilentlyContinue
|
||||
Remove-Item env:MINGW_PACKAGE_PREFIX -ErrorAction SilentlyContinue
|
||||
Remove-Item env:MINGW_PREFIX -ErrorAction SilentlyContinue
|
||||
|
||||
$env:IDF_PATH = "C:\Users\ruv\esp\v5.4\esp-idf"
|
||||
$env:IDF_TOOLS_PATH = "C:\Espressif\tools"
|
||||
$env:IDF_PYTHON_ENV_PATH = "C:\Espressif\tools\python\v5.4\venv"
|
||||
$env:PATH = "C:\Espressif\tools\xtensa-esp-elf\esp-14.2.0_20241119\xtensa-esp-elf\bin;C:\Espressif\tools\cmake\3.30.2\cmake-3.30.2-windows-x86_64\bin;C:\Espressif\tools\ninja\1.12.1;C:\Espressif\tools\ccache\4.10.2\ccache-4.10.2-windows-x86_64;C:\Espressif\tools\idf-exe\1.0.3;C:\Espressif\tools\python\v5.4\venv\Scripts;$env:PATH"
|
||||
|
||||
Set-Location "C:\Users\ruv\Projects\wifi-densepose\firmware\esp32-csi-node"
|
||||
|
||||
$python = "$env:IDF_PYTHON_ENV_PATH\Scripts\python.exe"
|
||||
$idf = "$env:IDF_PATH\tools\idf.py"
|
||||
|
||||
Write-Host "=== Cleaning stale build cache ==="
|
||||
& $python $idf fullclean
|
||||
|
||||
Write-Host "=== Building firmware (SSID=ruv.net, target=192.168.1.20:5005) ==="
|
||||
& $python $idf build
|
||||
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "=== Build succeeded! Flashing to COM7 ==="
|
||||
& $python $idf -p COM7 flash
|
||||
} else {
|
||||
Write-Host "=== Build failed with exit code $LASTEXITCODE ==="
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
$p = New-Object System.IO.Ports.SerialPort('COM7', 115200)
|
||||
$p.ReadTimeout = 5000
|
||||
$p.Open()
|
||||
Start-Sleep -Milliseconds 200
|
||||
|
||||
for ($i = 0; $i -lt 60; $i++) {
|
||||
try {
|
||||
$line = $p.ReadLine()
|
||||
Write-Host $line
|
||||
} catch {
|
||||
break
|
||||
}
|
||||
}
|
||||
$p.Close()
|
||||
|
|
@ -116,6 +116,18 @@ function init() {
|
|||
visualCnn.tryLoadWasm(wasmBase);
|
||||
csiCnn.tryLoadWasm(wasmBase);
|
||||
|
||||
// Auto-connect to local sensing server WebSocket if available
|
||||
const defaultWsUrl = 'ws://localhost:8765/ws/sensing';
|
||||
if (wsUrlInput) wsUrlInput.value = defaultWsUrl;
|
||||
csiSimulator.connectLive(defaultWsUrl).then(ok => {
|
||||
if (ok && connectWsBtn) {
|
||||
connectWsBtn.textContent = '✓ Live ESP32';
|
||||
connectWsBtn.classList.add('active');
|
||||
statusLabel.textContent = 'LIVE CSI';
|
||||
statusDot.classList.remove('offline');
|
||||
}
|
||||
});
|
||||
|
||||
// Auto-start camera for video/dual modes
|
||||
updateModeUI();
|
||||
startTime = performance.now() / 1000;
|
||||
|
|
|
|||
Loading…
Reference in New Issue