From d5695f89268240a21f3242694323f8859157e111 Mon Sep 17 00:00:00 2001 From: Marcus Date: Wed, 17 Apr 2024 23:16:44 +0200 Subject: [PATCH] firmware wip --- Arduino/CanGrow/CanGrow.ino | 54 +++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/Arduino/CanGrow/CanGrow.ino b/Arduino/CanGrow/CanGrow.ino index fbe1063..f2d6075 100644 --- a/Arduino/CanGrow/CanGrow.ino +++ b/Arduino/CanGrow/CanGrow.ino @@ -95,6 +95,8 @@ bool UseFan; // In case the user uses no 12V LED on the LED output and an relais instead // we have to disable PWM. So we ask here for what kind of light user is going bool UseLEDrelais; +// Which temperature sensor to use? +byte TemperatureSensor_Type; @@ -703,6 +705,11 @@ bool loadEEPROM() { EEPROM.get(167, ntpOffset); // size is 1 byte EEPROM.get(169, UseLEDrelais); + // size is 1 byte + // I forgot to add TemperatureSensor_Type to EEPROM and noticed it + // quite late in the process of programming. So this value residents + // in 214 and not directly after UseLEDrelais + EEPROM.get(214, TemperatureSensor_Type); } // TODO auth does not work atm // EEPROM.get(160, WebUiUsername); @@ -1204,9 +1211,40 @@ void WEBroot() { } else { String body = FPSTR(HTMLheader); - body += "

configured!

"; + body += "

🌱"; + body += GrowName; + body += "

"; body += "

"; - body += timeClient.getFormattedTime(); + body += "Grow started: "; + body += returnStrDateFromEpoch(GrowStart); + body += "
"; + body += "Day of Grow: "; + body += DayOfGrow; + body += "

"; + body += "Soil Moisture: "; + body += getSoilmoisture(MoistureSensor_Type); + body += " %
"; + body += "Humidity: "; + body += getHumidity(); + body += " ?
"; + body += "Temperature: "; + body += getTemperature(TemperatureSensor_Type); + body += " °C
"; + if(UsePump == true) { + body += "Pump water level: "; + switch(getWaterlevel()) { + case 0: + body += "OK"; + break; + case 1: + body += "Warning"; + break; + case 2: + body += "Critical"; + break; + } + } + body += "

"; body += returnHTMLfooter(); @@ -1331,6 +1369,15 @@ void WEBsystemSettings() { body += SoilmoistureLow; body += "' required>
\n"; + // TemperatureSensor_Type byte + body += "Temperature sensor type:
\n"; + // ntpOffset int body += "NTP offset: