server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
IPAddress ip = request->client()->remoteIP();
............................
ip sometimes is 0.0.0.0 and ESP32 reloads. Cannot find a reason/workaround. Any hints?
Sorry, not to put the full code here, as it contains about 1000 lines. It works quite fine, except in situations when in a web page I quickly trigger several GETs. In this case, instead of the client IP address, IP is 0.0.0.0 and ESP32 crashes
no problem.
Make a strip down version of your sketch which shows exactly this behaviour.
It should be compileable so we can put it in the IDE and debug it.
There is a good chance that you find the error in your code on your own during focusing on the problem.
I considered it.. but even if I shorten and simplify it, it will be too complex. Web page uses images, you need to install LittleFS plugin for it, not clear how to embed data subdirectory in the code snippet etc . In other words- cannot find a way how to reduce a problem to a few lines of code... On another hand- if i will somehow manage to do it, doubt smbdy will dig in....
I think the problem itself is due to asynchronicity. As a number of activities overlap, each thread is not independent and interferes somehow. My suspicions, of course.. Consider using a kind of critical section - e.g. mark a part of code as uniq (not to allow new thread while first one not ended), but not familiar with language constructions for it. Could you refer me to some descriptions or smth for new ideas.
As I wrote before - the code works, except in situations when I press clickable map areas (causing multile GETs) in "panic" mode