smart_garden/src/common.h

44 lines
976 B
C

#include <Arduino.h>
// this common Header file defines commonly used hardware and buildtime constants
// PUBLISH FREQUENCY (MS)
#define FREQUENCY 60000
// fix for core panic during wifi initialization
// #define configMINIMAL_STACK_SIZE 4096
// #define CONFIG_TIMER_TASK_STACK_SIZE 8192
// BH1750 lightsensor
#define MIN_LIGHT 0
#define MAX_LIGHT 54612
// DHT11
#define PIN_DHT11 14
// MOISTURE SENSOR // A7
#define PIN_MS 35
#define VALUE_WATER 1650
#define VALUE_AIR 3500
// Ventil
#define PIN_VALVE 32
#define MAX_VALVE_TIMEOUT 5000
// STATUS LED
#define PIN_LED_R 2
#define PIN_LED_G 0
#define PIN_LED_B 4
// LIGHT LED
#define LIGHT_LED_PIN_R 27
#define LIGHT_LED_PIN_G 26
#define LIGHT_LED_PIN_B 25
#define MAX_LIGHT_TIMEOUT (FREQUENCY - 5)
// MQTT
#define MQTT_HOST "mqtt.timovolkmann.de"
#define MQTT_PORT 1883
#define MQTT_TOPIC_BASE_SUB "smartgarden/commands"
#define MQTT_TOPIC_BASE_PUB "smartgarden/updates"
#define MQTT_PATH_SUB MQTT_TOPIC_BASE_SUB "/#"