ESP32 reset loop when using wifi.h I have a strange behavior, using ESP32 devkit v.1 boards.
Everything works, I can upload blink sketch, serial works, led blinks.
However, once I upload any sketch which is using the wifi.h (and utilizing it for example calling WiFi.mode(WIFI_STA);), upon upload, the board keeps resetting the serial connection, stays up for not more then 1 second, resets again, and so on.
I could not debug the issue, since serial is unusable. Any ideas what is wrong? I did a fresh ArduinoIDE, ESP32 board manager install, etc. and normal sketches work flawlessly.
The USB cable was too long, and hence power loss.

Sorry, I figured it out a day after I asked this question.