From 85d785f3cdc781080c2bcbc727bdc1627404e48b Mon Sep 17 00:00:00 2001 From: DeltaLima Date: Thu, 12 Dec 2024 02:19:04 +0100 Subject: [PATCH] firmware - add soilmoisture calibration, add grow end date to root page query json without jquery: https://gist.github.com/laurenancona/bd560948d71054e3d1477e43c4d48cb6 --- Arduino/CanGrow/CanGrow_HTML.h | 27 ++- Arduino/CanGrow/CanGrow_WebFunctions.h | 57 ++---- playground/html/systemSettings/index.html | 232 ++++++++++++++++------ 3 files changed, 213 insertions(+), 103 deletions(-) diff --git a/Arduino/CanGrow/CanGrow_HTML.h b/Arduino/CanGrow/CanGrow_HTML.h index 9220d18..1caff30 100644 --- a/Arduino/CanGrow/CanGrow_HTML.h +++ b/Arduino/CanGrow/CanGrow_HTML.h @@ -545,7 +545,7 @@ const char HTMLsystemSubNav[] PROGMEM = R"EOF( )EOF"; -const char JSsoilmoistureTypeSelect[] PROGMEM = R"EOF( +const char JSsoilmoisture[] PROGMEM = R"EOF( )EOF"; + +const char HTMLsoilmoistureCalibrateText[] PROGMEM = R"EOF(

Calibration
+Put your soilmoisture sensor into dry soil and hit Refresh.
+Adjust the value of 'Soilmoisture dry' if needed according to the reading.
+Repeat this with wet soil for 'Soilmoisture wet'.

)EOF"; diff --git a/Arduino/CanGrow/CanGrow_WebFunctions.h b/Arduino/CanGrow/CanGrow_WebFunctions.h index 6614e9b..8f91b96 100644 --- a/Arduino/CanGrow/CanGrow_WebFunctions.h +++ b/Arduino/CanGrow/CanGrow_WebFunctions.h @@ -377,6 +377,9 @@ void WEBroot() { body += "Grow started: 🗓️ "; body += returnStrDateFromEpoch(GrowStart); body += "
\n"; + body += "Grow end (est.): 🗓️ "; + body += returnStrDateFromEpoch(GrowStart + (60 * 60 * 24 * (DaysVeg + DaysVeg) ) ); + body += "
\n"; body += "Day of Grow: "; if(DayNight == true) { body += " 🌞 "; @@ -599,14 +602,6 @@ void WEBgrowSettings() { body += "'/> %

\n"; - - - - - - - - body += "Pump configuration
"; // PumpMode byte @@ -632,11 +627,6 @@ void WEBgrowSettings() { body += "' required> %
\n"; - - - - - body += "Pump interval vegetation: every \n"; - - // UseFan bool - //~ body += "Fan mode:
\n"; - -/* - // UsePump bool - body += "Use PUMP:
\n"; -*/ - + body += "Output configuration
"; // OutputInvert bool body += "Invert Outputs:

\n"; - - body += "Sensor configuration
"; // MoistureSensor_Type byte @@ -739,19 +710,25 @@ void WEBsystemSettings() { // SoilmoistureDry byte body += "Soilmoisture dry: \n"; - body += "

Analog capacitive: 360
\ -I2C Chirp: 250

"; + body += "' required>
\n"; // SoilmoistureWet byte body += "Soilmoisture wet: \n"; - body += "

Analog capacitive: 160
\ -I2C Chirp: 485

"; + body += "' required>
\n"; + + if(configured == true) { + body += "Soilmoisture raw reading: "; + body += valSoilmoistureRaw; + body += "
\n"; + body += FPSTR(HTMLsoilmoistureCalibrateText); + } else { + body += "

Calibration
\ + You have to save settings first before you can calibrate the soilmoisture sensor.

"; + } // MoistureSensor_Type Javascript - body += FPSTR(JSsoilmoistureTypeSelect); + body += FPSTR(JSsoilmoisture); // TemperatureSensor_Type byte diff --git a/playground/html/systemSettings/index.html b/playground/html/systemSettings/index.html index 35c474f..0cd45b5 100644 --- a/playground/html/systemSettings/index.html +++ b/playground/html/systemSettings/index.html @@ -4,21 +4,27 @@ -CanGrow - Ruderalis Indica +CanGrow - Amnesia Haze -