I am developing on the Arduino MKR IoT + Wifi1010 and the "thing" ARDUINO library.
I have is a somewhat long setup() procedure, with many waits,
so it lasts upt to 30 seconds, when I sum up all delays.
Unfortunately, it never gets to the end of this process; the card resets itself during a delay().
It is not a power issue since the card has no peripherals and in on USB power.
My hypotheses are:
a. wifi library gets some message and fills in some buffer that eventually overflows, triggering the reset;
b. there is a watchdog somewhere by default, but I could not find any doc about it
So the questions are:
a. Should I write my code in a non-blocking stateful fashion? (eg: with a list of tasks, every pass in the loop executes one task, and delays are implemented by checking the RTC.epoch() )
b. Should I call some Wifi-related buffer cleanup code regularly?
c. Should I avoid delays?
d. is it something else?