diff --git a/esp32/include/ControllerConfiguration.h b/esp32/include/ControllerConfiguration.h index ec3e2a0..61ac30e 100644 --- a/esp32/include/ControllerConfiguration.h +++ b/esp32/include/ControllerConfiguration.h @@ -127,7 +127,7 @@ #define FIRMWARE_BASENAME "PlantControl" #define FIRMWARE_NAME FIRMWARE_BASENAME FIRMWARE_FEATURE1 FIRMWARE_FEATURE2 -#define FIRMWARE_VERSIONNMUMBER "3.020" +#define FIRMWARE_VERSIONNMUMBER "3.021" #ifdef HWREVISION07 #define FIRMWARE_VERSION FIRMWARE_VERSIONNMUMBER " HW0.7" @@ -168,8 +168,8 @@ #define MAX_CONFIG_SETTING_ITEMS 100 /**< Parameter, that can be configured in Homie */ #define MAX_JSON_CONFIG_FILE_SIZE_CUSTOM 2500 -#define TEMPERATUR_TIMEOUT 3000 /**< 3 Seconds timeout for the temperatures sensors */ -#define WATERSENSOR_TIMEOUT 3000 /**< 3 Seconds timeout for the water distance sensor */ +#define TEMPERATUR_TIMEOUT 5000 /**< 5 Seconds timeout for the temperatures sensors */ +#define WATERSENSOR_TIMEOUT 1000 /**< 1 Seconds timeout for the water distance sensor */ #define WATERSENSOR_CYCLE 10 /**< 10 sensor measurement are performed */ #define DS18B20_RESOLUTION 9 /**< 9bit temperature resolution -> 0.5°C steps */ diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index a0b9a19..cc4b403 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -837,12 +837,18 @@ void safeSetup() uint8_t sensorCount = 0U; /* Required to read the temperature at least once */ - while ((sensorCount == 0 || !battery.isFound()) && millis() < tempInitStartTime + TEMPERATUR_TIMEOUT) + for(int i=0; + ((sensorCount == 0 || !battery.isFound()) && millis() < tempInitStartTime + TEMPERATUR_TIMEOUT); + i++) { sensors.begin(); battery.begin(); sensorCount = sensors.getDS18Count(); - delay(50); + if (i > 1) + { + Serial << "DS18S20 count: " << sensorCount << ", battery is found: " << battery.isFound() << " ( loop: " << i << " )" << endl; + } + delay(100); } readOneWireSensors();