Skip to content

ESP32 freezes out of nowhere. Destination Host Unreachable #2999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GeorgeFlorian opened this issue Jul 18, 2019 · 2 comments
Closed

ESP32 freezes out of nowhere. Destination Host Unreachable #2999

GeorgeFlorian opened this issue Jul 18, 2019 · 2 comments
Labels
Status: Stale Issue is stale stage (outdated/stuck)

Comments

@GeorgeFlorian
Copy link

GeorgeFlorian commented Jul 18, 2019

OS: Linux Mint 19.1
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:

       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());

The issue that I am having is that the ESP freezes randomly with no DEBUG message. I have set the DEBUG level at Verbose: build_flags = -DCORE_DEBUG_LEVEL=5.
Now it works and I can ping at it for hours and then it doesn't.

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.

  enableCore1WDT();
  esp_wifi_set_ps (WIFI_PS_NONE);

I get the following browser error:

This site can’t be reached
ERR_ADDRESS_UNREACHABLE

And pinging the ESP ends with Destination Host 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.

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);
}
@stale
Copy link

stale bot commented Sep 16, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Sep 16, 2019
@stale
Copy link

stale bot commented Sep 30, 2019

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Issue is stale stage (outdated/stuck)
Projects
None yet
Development

No branches or pull requests

1 participant