From 99703e5ad11360e2df6d51b21fd2229eb31234dd Mon Sep 17 00:00:00 2001 From: c3ma Date: Fri, 9 Jul 2021 19:40:51 +0200 Subject: [PATCH] Adjust moister sensor boundaries --- esp32/include/ControllerConfiguration.h | 7 ++++--- esp32/src/main.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/esp32/include/ControllerConfiguration.h b/esp32/include/ControllerConfiguration.h index 2b5ef6f..980599e 100644 --- a/esp32/include/ControllerConfiguration.h +++ b/esp32/include/ControllerConfiguration.h @@ -80,14 +80,15 @@ */ #define FIRMWARE_VERSION "sw 1.3 hw 0.10" -#define MOIST_SENSOR_MAX_ADC (85 * 4095 / 100) -#define MOIST_SENSOR_MIN_ADC (25 * 4095 / 100) +#define MOIST_SENSOR_MAX_ADC 1200 //swamp earth - 50 margin +#define MOIST_SENSOR_MIN_ADC 1800 //dry earth + 1500 margin #define SOLAR_VOLT_FACTOR 11 #define BATTSENSOR_INDEX_SOLAR 0 #define BATTSENSOR_INDEX_BATTERY 1 -#define MQTT_TIMEOUT (1000 * 10) /**< After 10 seconds, MQTT is expected to be connected */ +#define MQTT_TIMEOUT (1000 * 60) /**< After 10 seconds, MQTT is expected to be connected */ +#define ESP_STALE_TIMEOUT (MQTT_TIMEOUT+(30*1000)) #define MAX_PLANTS 7 #define SOLAR_CHARGE_MIN_VOLTAGE 7 /**< Sun is rising (morning detected) */ diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index 0b61263..57d1662 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -742,7 +742,7 @@ void loop() } /** Timeout always stopping the ESP -> no endless power consumption */ - if (millis() > 60000 && !mDownloadMode) + if (millis() > ESP_STALE_TIMEOUT && !mDownloadMode) { Serial << (millis() / 1000) << "not terminated watchdog reset" << endl; Serial.flush();