Contents in this wiki are for entertainment purposes only
This is not fiction ∞ this is psience of mind

DataNet System Microservices Architecture

From Catcliffe Development
Jump to navigation Jump to search

DataNet WiFi Lab System
for telemetry and control

Microservices Architecture
Format & Protocol
WebSocket Lab Server
On Claude
On Claude


Lab System Microservices Architecture

🧪 Lab System Microservices Architecture

UI
Web Interface Service
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
GW
API Gateway Service
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
CT
Control Service
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
DV
Device Communication Service
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
DB
Event Data Service
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
AN
Analysis Service
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
ESP32
Registers
Binary Input
Monitor
State Change
Trigger
Event Packet
Capture
Block Buffer
ESP32
Event Data
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
Event Buffer Manager
Packet queuing, block-size detection, memory management
WiFi Communication
Register updates from PC, event data transmission to PC
Register Interface
Control parameter storage, add-on board interfacing
ESP32 Protocol
UDP/TCP
WebSocket
Real-time
SQLite/InfluxDB
Time-series
Python/Node.js
Services
Pure HTML/JS
No Libraries
Docker
Containerization