Files
home_automatization_control…/growbox/config.h.example
T
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

34 lines
1.3 KiB
Plaintext
Raw 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.
// Скопировать в config.h и заполнить своими значениями.
// config.h в .gitignore — секреты (Wi-Fi, адрес брокера) в репозиторий не попадают.
#pragma once
// --- Wi-Fi ---
#define WIFI_SSID "your-wifi-ssid"
#define WIFI_PASSWORD "your-wifi-password"
// --- MQTT (mosquitto из home_automatization/docker-compose.yml, порт 1883, без auth в dev) ---
#define MQTT_BROKER_HOST "192.168.1.100"
#define MQTT_BROKER_PORT 1883
#define MQTT_CLIENT_ID "growbox-esp32"
// --- Зона и устройства ---
// zone_id — id зоны "Гроубокс" в Postgres (laravel-app, таблица zones).
// device_id должны совпадать с devices.external_id, засеянными в Laravel.
#define ZONE_ID "1"
#define DEVICE_ID_SENSOR "sensor-1"
#define DEVICE_ID_LIGHT "light-1"
#define DEVICE_ID_PUMP "pump-1"
#define DEVICE_ID_FAN "fan-1"
// --- Пины (ESP32 DevKitC) ---
#define PIN_DHT22 4
#define PIN_RELAY_LIGHT 16
#define PIN_RELAY_PUMP 17
#define PIN_RELAY_FAN 18
// Большинство дешёвых реле-модулей активны по LOW (сигнал LOW = реле включено).
#define RELAY_ACTIVE_LOW true
// --- Телеметрия ---
#define TELEMETRY_INTERVAL_MS 30000UL