firmware wip - add configurable soilmoisture wet and dry values
This commit is contained in:
parent
c17819155f
commit
65e6989a5d
5 changed files with 36 additions and 4 deletions
|
@ -76,6 +76,9 @@ a:active {
|
|||
|
||||
.helpbox {
|
||||
font-size: 0.8em;
|
||||
margin-left: 15px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.nav {
|
||||
background: #333;
|
||||
|
|
|
@ -110,6 +110,8 @@ char Esp32CamIP[16];
|
|||
// PumpLastOn (long) timestamp
|
||||
unsigned long PumpLastOn;
|
||||
bool OutputInvert;
|
||||
byte SoilmoistureWet;
|
||||
byte SoilmoistureDry;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -108,7 +108,9 @@ bool loadEEPROM() {
|
|||
* 241 PumpIntervalVeg (1 byte)
|
||||
* 242 PumpIntervalBloom (1 byte)
|
||||
* 243 OutputInvert (1 byte)
|
||||
* 244 ...
|
||||
* 244 SoilmoistureWet (1 byte)
|
||||
* 245 SoilmoistureDry (1 byte)
|
||||
* 246 ...
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -176,7 +178,10 @@ bool loadEEPROM() {
|
|||
EEPROM.get(237, PumpLastOn);
|
||||
// size is 1 byte
|
||||
EEPROM.get(243, OutputInvert);
|
||||
|
||||
// size is 1 byte
|
||||
EEPROM.get(244, SoilmoistureWet);
|
||||
// size is 1 byte
|
||||
EEPROM.get(245, SoilmoistureDry);
|
||||
}
|
||||
// TODO auth does not work atm
|
||||
// EEPROM.get(160, WebUiUsername);
|
||||
|
@ -257,6 +262,10 @@ bool loadEEPROM() {
|
|||
Serial.println(PumpLastOn);
|
||||
Serial.print("OutputInvert: ");
|
||||
Serial.println(OutputInvert);
|
||||
Serial.print("SoilmoistureWet: ");
|
||||
Serial.println(SoilmoistureWet);
|
||||
Serial.print("SoilmoistureDry: ");
|
||||
Serial.println(SoilmoistureDry);
|
||||
|
||||
Serial.println("---- Grow values ----");
|
||||
Serial.print("GrowName: ");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* CanGrow_Version.h gets generated from cangrow.sh */
|
||||
|
||||
const char* CanGrowVer = "0.1-dev";
|
||||
const char* CanGrowBuild = "3c14910-20241205024405";
|
||||
const char* CanGrowBuild = "c178191-20241205031352";
|
||||
|
||||
|
|
|
@ -637,7 +637,21 @@ void WEBsystemSettings() {
|
|||
// SoilmoistureLow byte
|
||||
body += "Soilmoisture low: <input class='inputShort' type='number' name='SoilmoistureLow' min='0' value='";
|
||||
body += SoilmoistureLow;
|
||||
body += "' required> %<br>\n";
|
||||
body += "' required> %<br>\n";
|
||||
|
||||
// SoilmoistureWet byte
|
||||
body += "Soilmoisture wet: <input class='inputShort' type='number' name='SoilmoistureWet' min='0' value='";
|
||||
body += SoilmoistureWet;
|
||||
body += "' required>\n";
|
||||
body += "<p class='helpbox'><b>Analog capacitive:</b> <i>160</i><br> \
|
||||
<b>I2C Chirp:</b> <i>485</i></p>";
|
||||
|
||||
// SoilmoistureDry byte
|
||||
body += "Soilmoisture dry: <input class='inputShort' type='number' name='SoilmoistureDry' min='0' value='";
|
||||
body += SoilmoistureDry;
|
||||
body += "' required>\n";
|
||||
body += "<p class='helpbox'><b>Analog capacitive:</b> <i>360</i><br> \
|
||||
<b>I2C Chirp:</b> <i>250</i></p>";
|
||||
|
||||
// TemperatureSensor_Type byte
|
||||
body += "Temperature sensor: <select id='TemperatureSensor_Type' name='TemperatureSensor_Type' required>\n";
|
||||
|
@ -847,6 +861,8 @@ void POSTsystemSettings() {
|
|||
String Esp32CamIP_tmp = webserver.arg("Esp32CamIP");
|
||||
Esp32CamIP_tmp.toCharArray(Esp32CamIP, 221);
|
||||
OutputInvert = webserver.arg("OutputInvert").toInt();
|
||||
SoilmoistureWet = webserver.arg("SoilmoistureWet").toInt();
|
||||
SoilmoistureDry = webserver.arg("SoilmoistureDry").toInt();
|
||||
|
||||
configured = true;
|
||||
|
||||
|
@ -873,6 +889,8 @@ void POSTsystemSettings() {
|
|||
EEPROM.put(219, MaintenanceDuration);
|
||||
EEPROM.put(221, Esp32CamIP);
|
||||
EEPROM.put(243, OutputInvert);
|
||||
EEPROM.put(244, SoilmoistureWet);
|
||||
EEPROM.put(245, SoilmoistureDry);
|
||||
|
||||
// write data to EEPROM
|
||||
EEPROM.commit();
|
||||
|
|
Loading…
Reference in a new issue