From 8218de11b196b4c9c8ce92668059435f1e2220bb Mon Sep 17 00:00:00 2001 From: DeltaLima Date: Thu, 5 Dec 2024 03:51:56 +0100 Subject: [PATCH] firmware - add some javascript to soilmoisture sensor select --- Arduino/CanGrow/CanGrow.geany | 14 ++++++------- Arduino/CanGrow/CanGrow_HTML.h | 29 ++++++++++++++++++++++++++ Arduino/CanGrow/CanGrow_SysFunctions.h | 8 +++---- Arduino/CanGrow/CanGrow_Version.h | 2 +- Arduino/CanGrow/CanGrow_WebFunctions.h | 16 ++++++++------ 5 files changed, 51 insertions(+), 18 deletions(-) diff --git a/Arduino/CanGrow/CanGrow.geany b/Arduino/CanGrow/CanGrow.geany index 3bb3d81..6abde2c 100644 --- a/Arduino/CanGrow/CanGrow.geany +++ b/Arduino/CanGrow/CanGrow.geany @@ -29,14 +29,14 @@ long_line_column=72 [files] current_page=1 -FILE_NAME_0=0;Arduino;0;EUTF-8;0;1;0;.%2FCanGrow.ino;0;2 -FILE_NAME_1=0;C++;0;EUTF-8;0;1;0;.%2FCanGrow_HTML.h;0;2 -FILE_NAME_2=0;C++;0;EUTF-8;0;1;0;.%2FCanGrow_Init.h;0;2 +FILE_NAME_0=2265;Arduino;0;EUTF-8;0;1;0;%2Fhome%2Fmarcus%2Fdistrobox%2Fdebian-cangrow%2FCanGrow%2FArduino%2FCanGrow%2FCanGrow.ino;0;2 +FILE_NAME_1=14609;C++;0;EUTF-8;0;1;0;%2Fhome%2Fmarcus%2Fdistrobox%2Fdebian-cangrow%2FCanGrow%2FArduino%2FCanGrow%2FCanGrow_HTML.h;0;2 +FILE_NAME_2=2884;C++;0;EUTF-8;0;1;0;%2Fhome%2Fmarcus%2Fdistrobox%2Fdebian-cangrow%2FCanGrow%2FArduino%2FCanGrow%2FCanGrow_Init.h;0;2 FILE_NAME_3=0;C++;0;EUTF-8;0;1;0;.%2FCanGrow_Logo.h;0;2 FILE_NAME_4=0;C++;0;EUTF-8;0;1;0;.%2FCanGrow_PinAssignments.h;0;2 -FILE_NAME_5=0;C++;0;EUTF-8;0;1;0;.%2FCanGrow_Sensors.h;0;2 -FILE_NAME_6=0;C++;0;EUTF-8;0;1;0;.%2FCanGrow_SysFunctions.h;0;2 -FILE_NAME_7=0;C++;0;EUTF-8;0;1;0;.%2FCanGrow_WebFunctions.h;0;2 +FILE_NAME_5=4277;C++;0;EUTF-8;0;1;0;%2Fhome%2Fmarcus%2Fdistrobox%2Fdebian-cangrow%2FCanGrow%2FArduino%2FCanGrow%2FCanGrow_Sensors.h;0;2 +FILE_NAME_6=4737;C++;0;EUTF-8;0;1;0;%2Fhome%2Fmarcus%2Fdistrobox%2Fdebian-cangrow%2FCanGrow%2FArduino%2FCanGrow%2FCanGrow_SysFunctions.h;0;2 +FILE_NAME_7=27858;C++;0;EUTF-8;0;1;0;%2Fhome%2Fmarcus%2Fdistrobox%2Fdebian-cangrow%2FCanGrow%2FArduino%2FCanGrow%2FCanGrow_WebFunctions.h;0;2 [build-menu] C++FT_00_LB=_Compile @@ -54,4 +54,4 @@ C++FT_01_CM=~/.local/bin/arduino-cli --no-color compile -v -b esp8266:esp8266:d C++FT_01_WD= [VTE] -last_dir=~ +last_dir=/home/marcus/distrobox/debian-cangrow diff --git a/Arduino/CanGrow/CanGrow_HTML.h b/Arduino/CanGrow/CanGrow_HTML.h index 87fb112..55ea58f 100644 --- a/Arduino/CanGrow/CanGrow_HTML.h +++ b/Arduino/CanGrow/CanGrow_HTML.h @@ -526,3 +526,32 @@ const char HTMLsystemSubNav[] PROGMEM = R"EOF(
  • 💣 Factory reset
  • )EOF"; + +const char JSsoilmoistureTypeSelect[] PROGMEM = R"EOF( + +)EOF"; diff --git a/Arduino/CanGrow/CanGrow_SysFunctions.h b/Arduino/CanGrow/CanGrow_SysFunctions.h index 2d3edef..e5d2e3e 100644 --- a/Arduino/CanGrow/CanGrow_SysFunctions.h +++ b/Arduino/CanGrow/CanGrow_SysFunctions.h @@ -108,9 +108,9 @@ bool loadEEPROM() { * 241 PumpIntervalVeg (1 byte) * 242 PumpIntervalBloom (1 byte) * 243 OutputInvert (1 byte) - * 244 SoilmoistureWet (1 byte) - * 245 SoilmoistureDry (1 byte) - * 246 ... + * 244 SoilmoistureWet (2 byte) + * 246 SoilmoistureDry (2 byte) + * 248 ... * */ @@ -181,7 +181,7 @@ bool loadEEPROM() { // size is 1 byte EEPROM.get(244, SoilmoistureWet); // size is 1 byte - EEPROM.get(245, SoilmoistureDry); + EEPROM.get(246, SoilmoistureDry); } // 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 7096eff..a7cd58a 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 = "65e6989-20241205031950"; +const char* CanGrowBuild = "3795569-20241205035049"; diff --git a/Arduino/CanGrow/CanGrow_WebFunctions.h b/Arduino/CanGrow/CanGrow_WebFunctions.h index da4846d..4041f85 100644 --- a/Arduino/CanGrow/CanGrow_WebFunctions.h +++ b/Arduino/CanGrow/CanGrow_WebFunctions.h @@ -623,10 +623,9 @@ void WEBsystemSettings() { body += "Pump ON time: Seconds
    \n"; - - + // MoistureSensor_Type byte - body += "Soilmoisture sensor: \n"; if(configured == false) { body += "\n"; } @@ -640,18 +639,23 @@ void WEBsystemSettings() { body += "' required> %
    \n"; // SoilmoistureWet byte - body += "Soilmoisture wet: \n"; body += "

    Analog capacitive: 160
    \ I2C Chirp: 485

    "; // SoilmoistureDry byte - body += "Soilmoisture dry: \n"; body += "

    Analog capacitive: 360
    \ I2C Chirp: 250

    "; + + + // MoistureSensor_Type Javascript + body += FPSTR(JSsoilmoistureTypeSelect); + // TemperatureSensor_Type byte body += "Temperature sensor: