From f920d6509d855b83a488f768ca57d16afe0f402f Mon Sep 17 00:00:00 2001 From: DeltaLima Date: Mon, 9 Dec 2024 03:43:44 +0100 Subject: [PATCH] firmware - add manual pump trigger, fix missing eeprom commit in controlPump --- Arduino/CanGrow/CanGrow_SysFunctions.h | 2 ++ Arduino/CanGrow/CanGrow_WebFunctions.h | 30 +++++++++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Arduino/CanGrow/CanGrow_SysFunctions.h b/Arduino/CanGrow/CanGrow_SysFunctions.h index f6e3c88..369bf60 100644 --- a/Arduino/CanGrow/CanGrow_SysFunctions.h +++ b/Arduino/CanGrow/CanGrow_SysFunctions.h @@ -731,6 +731,7 @@ void controlPUMP() { setOutput(3, 0); //digitalWrite(PinPUMP, LOW); EEPROM.put(237, PumpLastOn); + EEPROM.commit(); //write to EEPROM PumpOnTimePassed = 0; } // otherwise check which PumpMode to use @@ -796,6 +797,7 @@ void controlPUMP() { //digitalWrite(PinPUMP, LOW); PumpLastOn = timeClient.getEpochTime(); EEPROM.put(237, PumpLastOn); + EEPROM.commit(); //write to EEPROM PumpOnTimePassed = 0; } // when valSoilmoistureAvg is greater then the Low value, diff --git a/Arduino/CanGrow/CanGrow_WebFunctions.h b/Arduino/CanGrow/CanGrow_WebFunctions.h index ec8f842..4ead04c 100644 --- a/Arduino/CanGrow/CanGrow_WebFunctions.h +++ b/Arduino/CanGrow/CanGrow_WebFunctions.h @@ -210,20 +210,32 @@ void Syslogout() { void SysMaintenance() { String body = returnHTMLheader(); - if( (webserver.hasArg("on")) ) { + if( (webserver.hasArg("DimmOn")) ) { MaintenanceMode = true; MaintenanceStarted = millis(); - body += "
⏸️ On for "; + body += "
⏸️ Dimm LED On for "; body += MaintenanceDuration; body += "s
"; - } else if (webserver.hasArg("off")){ + } else if (webserver.hasArg("DimmOff")){ MaintenanceMode = false; - body += "
⏸️ Off
"; + body += "
⏸️ Dimm LED Off
"; + } else if(webserver.hasArg("PumpOnManual")) { + PumpOnManual = true; + body += "
💧 Pump manual activated for "; + body += PumpOnTime; + body += "s
"; } - body += "

⏸️ Maintenance Mode

"; - body += "On  Off"; + body += "

🧰 Maintenance

"; + + body += "Dimm LED On  Off


"; + body += "Pump manual Activate for "; + body += PumpOnTime; + body += "s
"; + + + body += FPSTR(HTMLfooter); webserver.send(200, "text/html", body); @@ -379,11 +391,13 @@ void WEBroot() { body += "Critical"; break; } + body += "
\n"; } - body += "
\n"; + body += "Growlight brightness: "; body += ((PinLEDPWM * 100) / 255); body += " %
\n"; + body += "
\n"; //~ body += "
\n"; //~ body += "MOSFET: \n"; //~ body += "

\n"; - body += "Maintenance Mode"; + body += "🧰 Maintenance"; body += FPSTR(HTMLfooter);