Начальный каркас: прошивка 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).
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
// Контроллер зоны "Гроубокс" для платформы 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();
|
||||
}
|
||||
Reference in New Issue
Block a user