is it somehow possible to keep the WiFi connection after uploading the code? Seems like the WiFiNINA resets the ESP-Chip each time the class is initialized. It's fine for production but I'd like to keep the connection to speed up the development process. Otherwise I have to wait several seconds after each upload until the connection is established.
while (status != WL_CONNECTED) {
Serial.print("Attempting to connect to WPA SSID: ");
Serial.println(ssid);
// Connect to WPA/WPA2 network:
status = WiFi.begin(ssid, pass);
// wait 10 seconds for connection:
delay(10000);
}
I have this. But after the boot status (WiFi.status()) is always IDLE and the module is trying to connect to WiFi. So on each boot the code starts with WiFi.begin(...). But this is exactly what I want to avoid (to speed up the development time).
Sure, in normal operation mode, this is exactly what I'm expecting: Reset after boot. I just would like to skip the reset during development.
Because the main uC communicates over SPI using AT-Commands with the WiFi-Module, it should work without problems to reprogram the uC and keep the WiFi-Module connected. At least so the theory..
No, it's not working, "status" is a local variable, which is always Zero after boot. The correct state would be "WiFi.status()" but it is also Zero because of the reset.
while (status != WL_CONNECTED) {
Serial.print("Attempting to connect to WPA SSID: ");
Serial.println(ssid);
// Connect to WPA/WPA2 network:
status = WiFi.begin(ssid, pass);
if (status == WL_CONNECTED)
break;
// wait 10 seconds for connection:
delay(10000);
}