reset or setup() called every time I open the serial monitor?

Very strange issue, setup() is called every time I open the serial monitor, shouldn't that only be called once when you initially power the device?

I'm using a brand new wifi rev2 board now, and the stock WifiNINA AP_SimpleWebServer example.

I'm certain it is calling setup() because I edited a serial output string that is created there to make sure.

Why would it reset every time I open the serial monitor?

Can someone please check if that happens with their board?

Apparently this is normal for Arduino....

I am used to the Leonardo, which is not totally insane.

If you don't like the reset when you open Serial Monitor, you can disable it by connecting a 10 uF capacitor between the reset and ground pins. On other boards, this makes it so you can't upload any more, but to my surprise I am still able to upload to my Uno WiFi Rev2 even with the capacitor in place. I actually don't completely understand how uploading works on the Uno WiFi Rev2 so I don't have an explanation for this.

Ok, thanks, will do.

I am chasing a strange problem where the Wifi Rev. 2 doesn't start after a blackout.

Since it doesn't do OTA I was hoping to recoup some of my loss and use it as a remote voltage / current monitor for a solar installation. It works fine all day when it works, but when power is lost overnight it does not start in the morning. The Wifi access point is not created, and it does not send any serial debug information. It's as if the flash memory was corrupted.
A reset does not change anything, nor do power cycles.
When it works and I do power cycles (long or short, doesn't matter) it restarts just fine.

I think there is a bug with brownout detection, or it can not cope with power pulses during dusk/dawn when the capacitors charge periodically.

If I re-upload the sketch it works again just fine.

Not sure If I will be inclined to fiddle with this more. I already had to chase an issue with the Vin regulator (MPS switcher), it was so noisy you could not use the ADC, possibly it has to do with this.