Reset of ESP32 chip

I am still facing the issue that after some days of operations my MKR1310 loses its wifi connection.
Tried all kind of commands to kind of reset ESP32 during program run. To no avail.
The only thing that helps is switch of power and than power up again.
I know it is related to the ESP.
Could any one suggest an in program completely reset so that wifi is restored ? Or a different command that might help.
For example I now have this sequence after the
WiFi.status() != WL_CONNECTED

WiFi.end();
WiFi.disconnect();
WiFi.end();
delay(10000);
init();
delay(2000);
status = WiFi.begin(ssid, pass);

Just a random sequence of commands. Ha Ha. But it does not work. I also tried numerous other combinations.
Any help is appreciated. If I can't get my server based on MKR1010 stable I need to switch to another platform. Thank you.

this may be tripping me up, too. So I'll follow this topic.