Edge Processing & WASM
Relevant source files
The following files were used as context for generating this wiki page:
- firmware/esp32-csi-node/main/wasm_runtime.c
- firmware/esp32-csi-node/main/edge_processing.c
- v2/crates/wifi-densepose-wasm-edge/src/lib.rs
- v2/crates/wifi-densepose-desktop/ui/src/pages/EdgeModules.tsx
- plugins/ruview/skills/ruview-cli-api/SKILL.md
- plugins/ruview/skills/ruview-configure/SKILL.md
- v2/crates/wifi-densepose-wasm/README.md
Edge Processing & WASM shifts Channel State Information (CSI) analysis from centralized servers to the network edge. The system executes WebAssembly (WASM) modules directly on ESP32-S3 and ESP32-C6 hardware using the WASM3 interpreter. This architecture enables real-time, privacy-preserving human sensing without requiring cloud connectivity or external cameras.
The project utilizes the wifi-densepose-wasm-edge crate to provide 60+ specialized edge modules. These modules perform tasks ranging from gesture recognition to medical vital sign monitoring. By running in a sandboxed WASM environment, the system maintains high performance and security while allowing hot-reloading of sensing logic.
Architecture and Runtime
RuView uses the WASM3 interpreter to run low-latency edge modules on ESP32 devices. Modules are packaged in the RuVector Format (RVF), which bundles WASM bytecode with metadata and security signatures. The runtime manages sandboxed execution, inter-module communication, and resource quotas.
Data Flow
The diagram shows the progression from raw signal capture through configurable edge tiers to final WASM-based inference and result output.
Sources: plugins/ruview/skills/ruview-configure/SKILL.md, v2/crates/wifi-densepose-desktop/ui/src/pages/EdgeModules.tsx:59-67
Edge Processing Tiers
You configure the depth of edge analysis using NVS provisioning flags.
- Tier 0: Disables edge processing; streams raw data.
- Tier 1: Computes 8-dimensional statistical features and motion levels.
- Tier 2: Executes complex WASM-based vitals and pose inference.
Sources: plugins/ruview/skills/ruview-configure/SKILL.md
Edge Module Library
The RuView ecosystem contains 67 built-in edge modules optimized for ESP32 hardware. These modules are categorized into functional domains, each targeting specific sensing requirements.
Core Modules
Core modules provide foundational signal processing and security checks required for reliable sensing.
| Module ID | Name | Purpose | Memory |
|---|---|---|---|
coherence | Coherence Gate | Z-score signal quality decisions (Accept/Reject) | 24 KB |
gesture | Gesture Recognizer | DTW template matching for swipes/circles | 48 KB |
adversarial | Adversarial Detector | Detects physically impossible signal patterns | 32 KB |
occupancy | Room Occupancy | Multi-link fusion for person counting (0-8 people) | 32 KB |
rvf | RVF Runtime | Core WASM3 execution and sandbox management | 64 KB |
Sources: v2/crates/wifi-densepose-desktop/ui/src/pages/EdgeModules.tsx:29-106
Specialized Domain Modules
Beyond core functions, the library includes modules for medical, security, and industrial applications.
- Medical: Includes
med_sleep_apneafor monitoring breathing patterns andmed_cardiac_arrhythmiafor detecting heart rhythm irregularities via CSI phase analysis. - Security: Features
sec_perimeter_breachfor direction tracking andsec_weapon_detectfor identifying metallic signatures. - Industrial: Provides
ind_forklift_proximityfor safety warnings andind_confined_spacefor OSHA compliance monitoring.
Sources: v2/crates/wifi-densepose-desktop/ui/src/pages/EdgeModules.tsx:135-300
WASM Browser and Web Bindings
The wifi-densepose-wasm crate enables the same sensing stack to run in web browsers. It exposes a JavaScript-friendly API using wasm-bindgen.
Components and Features
- MatDashboard: A client-side disaster response dashboard that manages scan zones and tracks survivors.
- Canvas Rendering: The dashboard draws survivor markers and zone boundaries directly to an HTML Canvas.
- WebSocket Integration: The WASM module connects to sensing servers via
web-sysfor live data ingestion.
Sources: v2/crates/wifi-densepose-wasm/README.md
This sequence diagram illustrates the interaction between the Browser's JavaScript environment and the WASM-based sensing dashboard.
Sources: v2/crates/wifi-densepose-wasm/README.md
Configuration and Deployment
You deploy edge modules using the desktop UI or CLI tools. The EdgeModules.tsx page allows you to discover nodes, check WASM support, and upload .wasm or .rvf files.
Runtime Statistics
The WASM runtime provides real-time health metrics for each node:
- Total Executions: Count of module function calls.
- Memory Usage: Current KB used versus the hardware limit.
- Module State: Monitors if a module is
running,stopped,error, orloading.
Sources: v2/crates/wifi-densepose-desktop/ui/src/pages/EdgeModules.tsx:442-500
Provisioning
Use provision.py to set edge tiers and detection thresholds on the hardware:
python firmware/esp32-csi-node/provision.py --port COM8 \
--edge-tier 2 \
--pres-thresh 50 \
--fall-thresh 15000
Sources: plugins/ruview/skills/ruview-configure/SKILL.md
Edge Processing & WASM provides a high-performance framework for decentralized RF sensing. By combining the portability of WebAssembly with the efficiency of ESP32 hardware, the system achieves low-latency inference while maintaining strict privacy boundaries.