- Contents in this wiki are for entertainment purposes only
DataNet System Microservices Architecture
Jump to navigation
Jump to search
DataNet WiFi Lab System
Lab System Microservices Architecture
Web Interface Service
API Gateway Service
Control Service
Device Communication Service
Event Data Service
Analysis Service
DataNet WiFi Lab System
for telemetry and control
🧪 Lab System Microservices Architecture
Simple HTML/JS/CSS interface with editable numeric and text fields. Handles user input validation and real-time updates from analysis results.
Tech: Pure HTML/JS/CSS, WebSocket client, minimal framework
Central entry point that routes requests, handles authentication, and manages WebSocket connections for real-time communication.
Tech: Node.js/Express or Go, WebSocket support, CORS handling
Receives UI field values, validates them, and formats control data for ESP32 register transmission. Maintains current control state.
Tech: Python/FastAPI or Node.js, UDP/TCP client, register mapping
Manages WiFi protocol with ESP32. Sends control registers and receives event data blocks containing: on-timestamp, off-timestamp, event-count from binary counter captures on state transitions.
Tech: Python/asyncio, UDP/TCP, binary packet parsing, block buffering
Receives event data blocks from ESP32: processes pulse timing (on/off timestamps) and event counts. Calculates pulse width, frequency, and counter deltas for analysis.
Tech: Python/FastAPI, time-series DB, event processing, pulse analysis
Processes logged data, performs calculations, and generates parametric changes to feed back to UI control fields for closed-loop operation.
Tech: Python/NumPy/SciPy, algorithm engine, parameter optimization
📊 Event-Driven Data Flow
Web UI
Controls
Controls
→
ESP32
Registers
Registers
→
Binary Input
Monitor
Monitor
→
State Change
Trigger
Trigger
→
Event Packet
Capture
Capture
→
Block Buffer
ESP32
ESP32
→
Event Data
Service
Service
🔧 ESP32 Event Capture Logic
Interrupt-driven: Binary input triggers on falling edge (off-state transition)
Event packet: [on_timestamp, off_timestamp, counter_value] - 12 bytes typical
Block transmission: Buffer N packets (e.g., 10-100) before WiFi transmission
Counter capture: Sample wide binary counter at exact moment of state transition
Timing precision: ESP32 microsecond timestamps for pulse width analysis
⚡ ESP32 Firmware Services Needed
Interrupt Handler
Binary input monitoring, timestamp capture, counter sampling
Binary input monitoring, timestamp capture, counter sampling
Event Buffer Manager
Packet queuing, block-size detection, memory management
Packet queuing, block-size detection, memory management
WiFi Communication
Register updates from PC, event data transmission to PC
Register updates from PC, event data transmission to PC
Register Interface
Control parameter storage, add-on board interfacing
Control parameter storage, add-on board interfacing
ESP32 Protocol
UDP/TCP
UDP/TCP
WebSocket
Real-time
Real-time
SQLite/InfluxDB
Time-series
Time-series
Python/Node.js
Services
Services
Pure HTML/JS
No Libraries
No Libraries
Docker
Containerization
Containerization