ota debugging attempts
This commit is contained in:
parent
47aea7aee1
commit
b1fc885f4e
@ -159,7 +159,7 @@ void mode2MQTT(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lipoTempWarning = abs(temp[1] - temp[2]) > 5;
|
bool lipoTempWarning = abs(temp[0] - temp[1]) > 5;
|
||||||
if(lipoTempWarning){
|
if(lipoTempWarning){
|
||||||
wait4sleep.in(500, prepareSleep);
|
wait4sleep.in(500, prepareSleep);
|
||||||
return;
|
return;
|
||||||
@ -462,8 +462,13 @@ bool switch3Handler(const HomieRange& range, const String& value) {
|
|||||||
return switchGeneralPumpHandler(2, range, value);
|
return switchGeneralPumpHandler(2, range, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void homieLoop(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void systemInit(){
|
void systemInit(){
|
||||||
WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
|
Serial.println("1");
|
||||||
|
|
||||||
Homie_setFirmware("PlantControl", FIRMWARE_VERSION);
|
Homie_setFirmware("PlantControl", FIRMWARE_VERSION);
|
||||||
|
|
||||||
@ -472,12 +477,23 @@ void systemInit(){
|
|||||||
deepSleepNightTime.setDefaultValue(0);
|
deepSleepNightTime.setDefaultValue(0);
|
||||||
wateringDeepSleep.setDefaultValue(60000); /* 1 minute in milliseconds */
|
wateringDeepSleep.setDefaultValue(60000); /* 1 minute in milliseconds */
|
||||||
|
|
||||||
|
Serial.println("2");
|
||||||
|
|
||||||
waterLevelMax.setDefaultValue(1000); /* 100cm in mm */
|
waterLevelMax.setDefaultValue(1000); /* 100cm in mm */
|
||||||
waterLevelMin.setDefaultValue(50); /* 5cm in mm */
|
waterLevelMin.setDefaultValue(50); /* 5cm in mm */
|
||||||
waterLevelWarn.setDefaultValue(500); /* 50cm in mm */
|
waterLevelWarn.setDefaultValue(500); /* 50cm in mm */
|
||||||
waterLevelVol.setDefaultValue(5000); /* 5l in ml */
|
waterLevelVol.setDefaultValue(5000); /* 5l in ml */
|
||||||
|
|
||||||
|
Serial.println("4");
|
||||||
|
Homie.setLoopFunction(homieLoop);
|
||||||
|
Serial.println("5");
|
||||||
|
Homie.setup();
|
||||||
|
Serial.println("6");
|
||||||
|
|
||||||
|
Serial.println("3");
|
||||||
|
|
||||||
mConfigured = Homie.isConfigured();
|
mConfigured = Homie.isConfigured();
|
||||||
|
Serial.println("3b");
|
||||||
if (mConfigured) {
|
if (mConfigured) {
|
||||||
// Advertise topics
|
// Advertise topics
|
||||||
plant1.advertise("switch").setName("Pump 1")
|
plant1.advertise("switch").setName("Pump 1")
|
||||||
@ -498,7 +514,6 @@ void systemInit(){
|
|||||||
plant3.advertise("moist").setName("Percent")
|
plant3.advertise("moist").setName("Percent")
|
||||||
.setDatatype("number")
|
.setDatatype("number")
|
||||||
.setUnit("%");
|
.setUnit("%");
|
||||||
#if (MAX_PLANTS >= 4)
|
|
||||||
plant4.advertise("moist").setName("Percent")
|
plant4.advertise("moist").setName("Percent")
|
||||||
.setDatatype("number")
|
.setDatatype("number")
|
||||||
.setUnit("%");
|
.setUnit("%");
|
||||||
@ -512,7 +527,6 @@ void systemInit(){
|
|||||||
.setDatatype("number")
|
.setDatatype("number")
|
||||||
.setUnit("%");
|
.setUnit("%");
|
||||||
|
|
||||||
#endif
|
|
||||||
sensorTemp.advertise("control")
|
sensorTemp.advertise("control")
|
||||||
.setName("Temperature")
|
.setName("Temperature")
|
||||||
.setDatatype("number")
|
.setDatatype("number")
|
||||||
@ -544,8 +558,6 @@ void systemInit(){
|
|||||||
// Mode 3
|
// Mode 3
|
||||||
stayAlive.advertise("alive").setName("Alive").setDatatype("number").settable(aliveHandler);
|
stayAlive.advertise("alive").setName("Alive").setDatatype("number").settable(aliveHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
Homie.setup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user