- websocket client on ESP32

- telemetry protocol builder
- server-side message handling
- database migrations
- telemetry persistence
This commit is contained in:
2026-04-14 16:09:18 +03:00
parent 977227296e
commit 4100931deb
57 changed files with 4960 additions and 63 deletions

View File

@@ -0,0 +1,20 @@
CREATE TABLE devices (
id BIGINT PRIMARY KEY,
is_enabled BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE telemetry (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
device_id BIGINT NOT NULL,
ts BIGINT NOT NULL,
metric VARCHAR(32) NOT NULL,
source VARCHAR(64) NOT NULL,
unit VARCHAR(16) NOT NULL,
payload JSON NOT NULL,
processed BOOLEAN NOT NULL DEFAULT FALSE,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (device_id) REFERENCES devices(id)
);