As a test, I connected the ESP32 to the home network via a WLAN hotspot on my desktop PC.
Here, too, the connection was periodically lost. The time between two interruptions was now exactly 249 minutes (and 36 seconds; observation period: 24 hours).
The log file entries are initially identical to those from the previous report. However, there are now 2 additional entries that show that the IP address has been renewed.
02:04:39.311 > [D][WiFiClient.cpp:509] connected(): Disconnected: RES: -1, ERR: 113
02:04:39.317 > [E][WiFiClient.cpp:232] connect(): connect on fd 57, errno: 118, “Host is unreachable”
02:04:39.330 > [D][WiFiGeneric.cpp:337] _eventCallback(): Event: 7 - STA_GOT_IP
02:04:39.330 > [D][WiFiGeneric.cpp:381] _eventCallback(): STA IP: 192.168.137.26, MASK: 255.255.255.0, GW: 192.168.137.1
02:04:40.368 > mqttClient.publish->published: log:#mqttConnect:1621123481
The Fritzbox does not show any special events during these times. The cause is probably in the ESP itself. It is annoying that the program execution in the ESP stops completely during an (MQTT) connection break, since PubSubClient is executed by default together with the actual main program in CPU 1.