Board: ESP32-EVB
IDE: PlatformIO IDE
platform = https://github.com/platformio/platform-espressif32.git
Hello !
I am using ESPAsyncWebServer to serve some web-pages and to control the 2 relays that are on the board.
The ESP is configured with a static IP:
Code: Select all
if(!WiFi.config(local_IP_STA, gateway_STA, subnet_STA, local_IP_STA, primaryDNS)) {
logOutput((String)"Couldn't configure STATIC IP ! Starting DHCP IP !");
}
delay(50);
WiFi.begin(x[0].c_str(),x[1].c_str());
I am also using the following methods in order to prevent the ESP from freezing, but they don't help at all. With or without them I can't make the project reliable.
Code: Select all
enableCore1WDT();
esp_wifi_set_ps (WIFI_PS_NONE);
Code: Select all
This site can’t be reached
ERR_ADDRESS_UNREACHABLE
The issue I am experiencing makes the ESP a very unreliable board. I don't know if it's the ESP at fault or the Server's Library.
The `void loop()` is pretty straight forward:
Code: Select all
void loop(){
if (shouldReboot) {
logOutput("Restarting in 5 seconds...");
delay(5000);
server.reset();
ESP.restart();
}
currentTimeRelayOne = millis();
currentTimeRelayTwo = millis();
if(startTimeRelayOne != 0 && !needManualCloseRelayOne) {
if ((currentTimeRelayOne - startTimeRelayOne) > (Delay1.toInt()*1000)) {
digitalWrite(RELAY1,LOW);
status1 = "OFF";
logOutput((String)relay1 + " closed");
startTimeRelayOne = 0;
}
}
if(startTimeRelayTwo != 0 && !needManualCloseRelayTwo) {
if ((currentTimeRelayTwo - startTimeRelayTwo) > (Delay2.toInt()*1000)) {
digitalWrite(RELAY2,LOW);
status2 = "OFF";
logOutput((String)relay2 + " closed");
startTimeRelayTwo = 0;
}
}
delay(2);
}