diff --git a/esp32/include/ControllerConfiguration.h b/esp32/include/ControllerConfiguration.h index a49e269..fd1a946 100644 --- a/esp32/include/ControllerConfiguration.h +++ b/esp32/include/ControllerConfiguration.h @@ -25,7 +25,7 @@ #define SENSOR_PLANT0 32 /**< GPIO 32 (ADC1) */ #define SENSOR_PLANT1 33 /**< GPIO 33 (ADC1) */ #define SENSOR_PLANT2 25 /**< GPIO 25 (ADC2) */ -#define SENSOR_PLANT3 25 /**< GPIO 26 (ADC2) */ +#define SENSOR_PLANT3 26 /**< GPIO 26 (ADC2) */ #define SENSOR_PLANT4 27 /**< GPIO 27 (ADC2) */ #define SENSOR_PLANT5 14 /**< GPIO 14 (ADC2) */ #define SENSOR_PLANT6 12 /**< GPIO 12 (ADC2) */ @@ -35,7 +35,7 @@ #define OUTPUT_PUMP2 21 /**< GPIO 21 */ #define OUTPUT_PUMP3 19 /**< GPIO 19 */ #define OUTPUT_PUMP4 18 /**< GPIO 18 */ -#define OUTPUT_PUMP5 29 /**< GPIO 29 */ +#define OUTPUT_PUMP5 5 /**< GPIO 5 */ #define OUTPUT_PUMP6 15 /**< GPIO 15 */ #define OUTPUT_SENSOR 16 /**< GPIO 16 - Enable Sensors */ diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index b8a2af7..5c9c487 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -133,6 +133,7 @@ void espDeepSleepFor(long seconds, bool activatePump = false){ } else { esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_SLOW_MEM, ESP_PD_OPTION_OFF); gpio_hold_dis(GPIO_NUM_13); //pump pwr + gpio_deep_sleep_hold_dis(); digitalWrite(OUTPUT_PUMP, LOW); for (int i=0; i < MAX_PLANTS; i++) { mPlants[i].deactivatePump(); @@ -516,6 +517,9 @@ bool mode1(){ Serial.println("m1"); Serial << getCurrentTime() << " curtime" << endl; + /* Disable all sleeping stuff before reading sensors */ + gpio_deep_sleep_hold_dis(); + readSensors(); //queue sensor values for