Crash with http.get

Hi,

I try to make two esp32 communicate.
If the two are on and connected to Wifi, I can make an http.get from esp1 to esp2 without issue. So esp1 knows esp2 is available.
If esp2 is not online, esp1 crash when the hhtp.get is done.

E (566212) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (566212) task_wdt:  - async_tcp (CPU 0/1)
E (566212) task_wdt: Tasks currently running:
E (566212) task_wdt: CPU 0: IDLE0
E (566212) task_wdt: CPU 1: IDLE1
E (566212) task_wdt: Aborting.

abort() was called at PC 0x401038ac on core 0

So can someone tell me how to avoid this crash ?

Perhaps is there an other way to know if esp2 is online from esp 1 ???

Thank you

The ESP Exception Decoder can be useful in debugging ESP crashes and will show you where in the code the error ocurred. Without seeing your code it is difficult to advise, but do you have a timeout so that if the other device does not respond within a sensible time then the process aborts?

no, I have no timer for the http.get function.

void init_delestage() {
  String url;
      String reponse;
      url="http://"+configrelais.ip_adresse_delesteur+"/relaistate";
      HTTPClient http1;
      http1.begin(url);
      http1.GET();
      reponse=http1.getString();
      http1.end();
    
      if (reponse=="ON,OFF") {configrelais.relais1isON=true;configrelais.relais2isON=false;}
      if (reponse=="ON,ON") {configrelais.relais1isON=true;configrelais.relais2isON=true;}
      if (reponse=="OFF,OFF") {configrelais.relais1isON=false;configrelais.relais2isON=false;}
      if (reponse=="OFF,ON") {configrelais.relais1isON=false;configrelais.relais2isON=true;}
      Serial.println("REPONSE : "+ reponse);
  }

I think, since esp2 is OFF, there is no response, http.get is waiting, and the timeout triggered is risen.

Please post your complete code. Or, at least, a complete code that compiles and demonstrates the issue at hand.

I can't there are hundreds of lines !

In fact I call this fucntion init_delestage(), and I get the crash.
If I comment init_delestage(), it doesn't crash.

In the function I make a call at http.get with url=http://192.168.1.146/relaistate
When esp2 (address 192.168.1.146) is OFF, there is no answer and then the watchdog rises.

What can I do to bypass the fact that esp2 doesn't answer ?

I can't help you without seeing real, complete code. Good luck.

I know why it i crashong : the http.get takes too long to answer, it's normal because there are no answer from esp2..

So is there a way to disable the watchdog when I call this function ?