diff --git a/Arduino/CanGrow/CanGrow.ino b/Arduino/CanGrow/CanGrow.ino index 6d6aa8c..e5fc9e7 100644 --- a/Arduino/CanGrow/CanGrow.ino +++ b/Arduino/CanGrow/CanGrow.ino @@ -279,12 +279,19 @@ void loop() { * - PumpInterval (int) in days * - SoilmoistureLow (int) in % * - PumpLastOn (long) timestamp + * - PumpMode (short) 1: Pump on every n days, 2: Pump on when Soilmoisture <= SoilmoistureLow, 3: Both + * * */ - +void controlPUMP() { + // UsePump true? + if (UsePump == true) { + + } +} diff --git a/Arduino/CanGrow/CanGrow_Init.h b/Arduino/CanGrow/CanGrow_Init.h index d5a91c9..590a966 100644 --- a/Arduino/CanGrow/CanGrow_Init.h +++ b/Arduino/CanGrow/CanGrow_Init.h @@ -94,6 +94,12 @@ bool UseFANrelais; byte TemperatureSensor_Type; unsigned short MaintenanceDuration = 300; char Esp32CamIP[16]; +// PumpInterval (int) in days +byte PumpInterval; +// PumpLastOn (long) timestamp +unsigned long PumpLastOn; +// PumpMode (short) 1: Pump on every n days, 2: Pump on when Soilmoisture <= SoilmoistureLow, 3: Both +byte PumpMode; // // Grow Stuff diff --git a/Arduino/CanGrow/CanGrow_SysFunctions.h b/Arduino/CanGrow/CanGrow_SysFunctions.h index 102be0a..7978df4 100644 --- a/Arduino/CanGrow/CanGrow_SysFunctions.h +++ b/Arduino/CanGrow/CanGrow_SysFunctions.h @@ -104,7 +104,10 @@ bool loadEEPROM() { * 218 SunFadeDuration * 219 MaintenanceDuration (2 byte) * 221 Esp32CamIP (16 byte) - * 237 ... + * 237 PumpInterval (1 byte) + * 238 PumpLastOn (4 byte) + * 242 PumpMode (1 byte) + * 243 ... * */ @@ -167,7 +170,13 @@ bool loadEEPROM() { // size is 2 byte EEPROM.get(219, MaintenanceDuration); // size is 16 byte - EEPROM.get(221, Esp32CamIP); + EEPROM.get(237, Esp32CamIP); + // size is 1 byte + EEPROM.get(237, PumpInterval); + // size is 4 byte + EEPROM.get(238, PumpLastOn); + // size is 1 byte + EEPROM.get(242, PumpMode); } // TODO auth does not work atm // EEPROM.get(160, WebUiUsername); diff --git a/Arduino/CanGrow/CanGrow_Version.h b/Arduino/CanGrow/CanGrow_Version.h index 94f9390..d0aab83 100644 --- a/Arduino/CanGrow/CanGrow_Version.h +++ b/Arduino/CanGrow/CanGrow_Version.h @@ -1,5 +1,5 @@ /* CanGrow_Version.h gets generated from cangrow.sh */ const char* CanGrowVer = "0.1-dev"; -const char* CanGrowBuild = "25bf84e"; +const char* CanGrowBuild = "064db73"; diff --git a/cangrow.sh b/cangrow.sh index b367f73..207dad0 100755 --- a/cangrow.sh +++ b/cangrow.sh @@ -51,7 +51,7 @@ case $1 in echo "" echo ":: installing Arduino IDE packages with apt, please enter sudo password:" sudo apt update - sudo apt install arduino + sudo apt install arduino python3 echo "" echo ":: Installing ESP8266 core for Arduino" ${ACLI_CMD} core install esp8266:esp8266