Files
cacto a645737927 Начальный каркас: прошивка ESP32 для зоны "Гроубокс"
Реализованы sensor-1 (DHT22, телеметрия temperature/humidity) и
реле-актуаторы light-1/pump-1/fan-1 (turn_on/turn_off/set_level) по
протоколу MQTT платформы home_automatization (devices/{id}/telemetry|commands|ack).
2026-08-11 18:46:37 +05:00

29 lines
785 B
Arduino
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Контроллер зоны "Гроубокс" для платформы home_automatization.
// Одна плата ESP32 владеет четырьмя устройствами зоны:
// sensor-1 (DHT22, телеметрия temperature/humidity)
// light-1, pump-1, fan-1 (реле, turn_on/turn_off/set_level)
// Протокол общения с device-control-service/ingest-service описан в README.md.
#include "config.h"
#include "devices.h"
#include "mqtt_link.h"
#include "net.h"
#include "telemetry.h"
#include "time_sync.h"
void setup() {
Serial.begin(115200);
devicesBegin();
netBegin();
timeSyncBegin();
mqttBegin();
telemetryBegin();
}
void loop() {
netEnsureConnected();
mqttEnsureConnected();
mqttLoop();
telemetryTick();
}