Sending AT commands to the ESP32 on my MKR1010

Dear all,
I am experiencing randomly Wifi connection failures after a few days of operations. Wifi status becomes 5, which means disconnection. Obviously I need to find out what is causing it. But I was also thinking, is it possible for me to send an AT command directly to the ESP32 chip to for example reset it.
Any suggestions on that? Thanks so much,
regards
Jitse

In my setup I have this:

/* If WiFi is lost, re-initializes it */
if (WiFi.status() != WL_CONNECTED)
{
init();
}