MKRWIFI1010 loses wi-fi connectivity when it warms up?

I started working with a MKRWIFI1010 about a week ago to prototype an automated watering system for a garden. I'm becoming convinced that the board loses its wi-fi connection when the ambient temperature rises. It's become fairly consistent that it loses its connection in the afternoon when the sun hits the plastic box that the MKR and other electronics are housed in. I know that the Arduino itself is still running because I'm having it blink its LED once every five seconds to indicate activity.

The ambient temperature around here is in the lower 90s (Fahrenheit--I'm in the USA). The plastic box it's in is off-white in color. In other words, it's probably getting warm, but not so warm that I'd expect electronics to be affected.

I updated the firmware a few days ago but there's been no change in its behavior since then.

I would like to use several of these boards to set up a system covering several plantings, but if I can't rely on them to handle outdoor temperatures, I'm going to have to find a different board.

Thank you for any confirmation of this problem and/or advice.

Hi,
maybe I will not be useful but I recently made some tests on Arduino MKR1010 WiFi and I want to share with you what I found.
I set up Arduino as webserver used to record some data during the day and to send them to any client using a browser.
During my first tests I could find 2 issues:
1 - WiFi loses connectivity randomly after 2 or 3 or 4 days, I don’t know why. Maybe because of my router, maybe because of summer temperatures
2 - sometimes WiFi stay connected to the network (ping to the Arduino is succesfull) but doesn’t answer to any client request

I fixed these problems:
1 - checking the state of the WiFi inside loop(): if “(WiFi.status() != WL_CONNECTED)” then I power-off the WiFi, then power-on WiFi and finally reconnect to the network
2 - inserting a timeout for client request: the original webserver example sketch use “while (client.connected())” and maybe this could be a problem (if client have some strange behavior)

After making these two fix my Arduino is running without problems for many days without disconnecting or stopping.

I am having a similar issue with my 1010 board where I will see through my Blynk app that the board is offline (happens about everyday), I will go out to the board, see that the CHRGE light is blinking, hit reset, and the board will then communicate with my Blynk app. Board is powered by micro USB going to an Apple brand wall plug. Sketch Below. I have included code now to try to get the WIFI connected if the board goes off line, but I have had the code uploaded for a few days now, with no change. I have read in other forums to do a soft reset, but I don’t think that is an option for me, since I am using case and switch statements,not to mention that seems like a band aid. Any ideas of what I can do? Thanks in advance for any help.

#include <Smoothed.h> 	
#include <Blynk.h>
#include <SPI.h>
#include <WiFiNINA.h>
#include <BlynkSimpleWiFiNINA.h>


char auth[] = "------";

char ssid[] = "-------";
char pass[] = "-------";

int keyIndex = 0;                                
int status = WL_IDLE_STATUS;                     

BlynkTimer timer; 

Smoothed <float> sensorData;
Smoothed <float> sensorData2;
float currentPreSensorValue;
float currentPostSensorValue;
float smoothedPreSensorValueExp;
float smoothedPostSensorValueExp;
//float smoothedPreSensorValueAvg;
//float smoothedPostSensorValueAvg;

float preVoltage;           
float postVoltage;          
float prePsi;               
float postPsi;              
float pressureDelta;
float preVoltageTotal;
float postVoltageTotal;


float orderThreshold = 3.0;
float changeThreshold = 4.0;

boolean beenNotified = false;

enum FilterStatus {FilterOk, OrderFilter, ChangeFilter};

FilterStatus FilterCondition = FilterOk;

int i;

WidgetLED ledGood(V1);
WidgetLED ledOrder(V2);
WidgetLED ledChange(V3);

byte preSensorPin = A1;   
byte postSensorPin = A2; 
const byte yellowLEDPin = 7;            
const byte redLEDPin = 6;    

void setup() {
  
  SerialUSB.begin(9600);
  
  Blynk.begin(auth, ssid, pass);
    
  timer.setInterval(1000L, myTimerEvent);
  
  sensorData.begin(SMOOTHED_EXPONENTIAL, 10);
  sensorData2.begin(SMOOTHED_EXPONENTIAL, 10); 
  
  pinMode(preSensorPin, INPUT);        
  pinMode(postSensorPin, INPUT); 
  pinMode(yellowLEDPin, OUTPUT);
  pinMode(redLEDPin, OUTPUT);
  
}


void loop() {
  
  Blynk.run();
  timer.run();
  
  // Read the value from the sensor
  currentPreSensorValue = analogRead(preSensorPin);
  currentPostSensorValue = analogRead(postSensorPin);
    
  //Add the new value to both sensor value stores
  sensorData.add(currentPreSensorValue);
  sensorData2.add(currentPostSensorValue);   
    
  // Get the smoothed values
  smoothedPreSensorValueExp = sensorData.get();
  smoothedPostSensorValueExp = sensorData2.get();
  
  Serial.print("  Pre-filter psi: ");
  Serial.println(prePsi);
  
  Serial.print("  Post-filter psi: ");
  Serial.println(postPsi);
   
  CheckFilter();
  ManageFilterNotify();
  ManageFilterLeds();
  
  if ( WiFi.status() != WL_CONNECTED) {
    while (WiFi.begin(ssid, pass) != WL_CONNECTED) {
      // unsuccessful, retry in 4 seconds
      Serial.print("failed ... ");
      delay(4000);
      Serial.print("retrying ... ");
    }
  }
}

void myTimerEvent()
{
  
  preVoltage =  (5.0 / 1023.0) * smoothedPreSensorValueExp;
  prePsi = (preVoltage - 0.5) * (100.0) / (4.5 - 0.5);
  Blynk.virtualWrite(V5, prePsi);
  
  
  postVoltage =  (5.0 / 1023.0) * smoothedPostSensorValueExp;
  postPsi = (postVoltage - 0.5) * (100.0) / (4.5 - 0.5);
  Blynk.virtualWrite(V6, postPsi);
  
  pressureDelta = (prePsi - postPsi);
  Blynk.virtualWrite(V7, pressureDelta);

}

void CheckFilter()  // Filter condition state machine
{
  // All we can do is go from OK to order or from Order to change
  switch (FilterCondition)
  {
    case FilterOk:
      if (prePsi - postPsi > orderThreshold)      //  if the pressure drop is greater than Order threshold
      {
        FilterCondition = OrderFilter;
      }
      break;
    case OrderFilter:
      if (prePsi - postPsi > changeThreshold)        //if the pressure drop is greater than replace threshold
      {
        FilterCondition = ChangeFilter;
      }
      break;
    case ChangeFilter:  // Once we're in this state, only a reset will change it.
      break;
  }
}

void ManageFilterNotify()
{
  switch (FilterCondition)
  {
    case FilterOk:
    Serial.println("Filter ok");
      ledGood.on();
      ledOrder.off();
      ledChange.off();
      break;
    case OrderFilter:
    Serial.println("Order filter");
      if (!beenNotified){
      Blynk.notify("It is time to order filter");
      Blynk.email("mrcparker90@gmail.com", "FilterLynk", "It is time to order the fitler.");
      beenNotified = true;
      }
      ledGood.off();
      ledOrder.on(); 
      break;
    case ChangeFilter:
    Serial.println("Replace filter");
      if(!beenNotified){
      Blynk.notify("It is time to replace fitler!");
      Blynk.email("mrcparker90@gmail.com", "FilterLynk", "It is time to change the fitler.");
      beenNotified = true;
      }
      ledOrder.off();
      ledChange.on(); 
      break;
  }
}

void ManageFilterLeds()
{
  switch (FilterCondition)
  {
    case FilterOk:
    Serial.println("Leds off - filter ok");
      digitalWrite(redLEDPin, LOW);
      digitalWrite(yellowLEDPin, LOW);
      break;
    case OrderFilter:
    Serial.println("Show yellow - order filter");
      digitalWrite(redLEDPin, LOW);
      digitalWrite(yellowLEDPin, HIGH);
      break;
    case ChangeFilter:
    Serial.println("Show red - replace filter");
      digitalWrite(redLEDPin, HIGH);
      digitalWrite(yellowLEDPin, LOW);
      break;
  }
}

I have updated the code that I believe will work, but now I am getting “myTimerEvent not declared in this scope”. I have declared BlynkTimer timer globally, so not sure why it won’t compile, even though I did not change anything with that timer.

#include <Smoothed.h> 	
#include <Blynk.h>
#include <SPI.h>
#include <WiFiNINA.h>
#include <BlynkSimpleWiFiNINA.h>


char auth[] = "dcy3wWSGO-ApB1uKvh9cUiEZ21HrPiab";

char ssid[] = "Cluckycastle";
char pass[] = "123456LW";

int status = WL_IDLE_STATUS;

BlynkTimer timer;

Smoothed <float> sensorData;
Smoothed <float> sensorData2;
float currentPreSensorValue;
float currentPostSensorValue;
float smoothedPreSensorValueExp;
float smoothedPostSensorValueExp;
//float smoothedPreSensorValueAvg;
//float smoothedPostSensorValueAvg;

float preVoltage;           
float postVoltage;          
float prePsi;               
float postPsi;              
float pressureDelta;
float preVoltageTotal;
float postVoltageTotal;


float orderThreshold = 3.0;
float changeThreshold = 4.0;

boolean beenNotified = false;

enum FilterStatus {FilterOk, OrderFilter, ChangeFilter};

FilterStatus FilterCondition = FilterOk;

int i;

WidgetLED ledGood(V1);
WidgetLED ledOrder(V2);
WidgetLED ledChange(V3);

byte preSensorPin = A1;   
byte postSensorPin = A2; 
const byte yellowLEDPin = 7;            
const byte redLEDPin = 6;    

void setup() {
  
  SerialUSB.begin(9600);
  
  // attempt to connect to Wifi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to Network named: ");
    Serial.println(ssid);                   // print the network name (SSID);

    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
    status = WiFi.begin(ssid, pass);
    // wait 10 seconds for connection:
    delay(10000);
  }


  Blynk.begin(auth, ssid, pass);
    
  timer.setInterval(1000L, myTimerEvent);
  
  sensorData.begin(SMOOTHED_EXPONENTIAL, 10);
  sensorData2.begin(SMOOTHED_EXPONENTIAL, 10); 
  
  pinMode(preSensorPin, INPUT);        
  pinMode(postSensorPin, INPUT); 
  pinMode(yellowLEDPin, OUTPUT);
  pinMode(redLEDPin, OUTPUT);
  
}


void loop() {
  
  Blynk.run();
  timer.run();
  
  // Read the value from the sensor
  currentPreSensorValue = analogRead(preSensorPin);
  currentPostSensorValue = analogRead(postSensorPin);
    
  //Add the new value to both sensor value stores
  sensorData.add(currentPreSensorValue);
  sensorData2.add(currentPostSensorValue);   
    
  // Get the smoothed values
  smoothedPreSensorValueExp = sensorData.get();
  smoothedPostSensorValueExp = sensorData2.get();
  
  Serial.print("  Pre-filter psi: ");
  Serial.println(prePsi);
  
  Serial.print("  Post-filter psi: ");
  Serial.println(postPsi);
   
  CheckFilter();
  ManageFilterNotify();
  ManageFilterLeds();
  
  }
}

void myTimerEvent()
{
  
  preVoltage =  (5.0 / 1023.0) * smoothedPreSensorValueExp;
  prePsi = (preVoltage - 0.5) * (100.0) / (4.5 - 0.5);
  Blynk.virtualWrite(V5, prePsi);
  
  
  postVoltage =  (5.0 / 1023.0) * smoothedPostSensorValueExp;
  postPsi = (postVoltage - 0.5) * (100.0) / (4.5 - 0.5);
  Blynk.virtualWrite(V6, postPsi);
  
  pressureDelta = (prePsi - postPsi);
  Blynk.virtualWrite(V7, pressureDelta);

}

void CheckFilter()  // Filter condition state machine
{
  // All we can do is go from OK to order or from Order to change
  switch (FilterCondition)
  {
    case FilterOk:
      if (prePsi - postPsi > orderThreshold)      //  if the pressure drop is greater than Order threshold
      {
        FilterCondition = OrderFilter;
      }
      break;
    case OrderFilter:
      if (prePsi - postPsi > changeThreshold)        //if the pressure drop is greater than replace threshold
      {
        FilterCondition = ChangeFilter;
      }
      break;
    case ChangeFilter:  // Once we're in this state, only a reset will change it.
      break;
  }
}

void ManageFilterNotify()
{
  switch (FilterCondition)
  {
    case FilterOk:
    Serial.println("Filter ok");
      ledGood.on();
      ledOrder.off();
      ledChange.off();
      break;
    case OrderFilter:
    Serial.println("Order filter");
      if (!beenNotified){
      Blynk.notify("It is time to order filter");
      Blynk.email("mrcparker90@gmail.com", "FilterLynk", "It is time to order the fitler.");
      beenNotified = true;
      }
      ledGood.off();
      ledOrder.on(); 
      break;
    case ChangeFilter:
    Serial.println("Replace filter");
      if(!beenNotified){
      Blynk.notify("It is time to replace fitler!");
      Blynk.email("mrcparker90@gmail.com", "FilterLynk", "It is time to change the fitler.");
      beenNotified = true;
      }
      ledOrder.off();
      ledChange.on(); 
      break;
  }
}

void ManageFilterLeds()
{
  switch (FilterCondition)
  {
    case FilterOk:
    Serial.println("Leds off - filter ok");
      digitalWrite(redLEDPin, LOW);
      digitalWrite(yellowLEDPin, LOW);
      break;
    case OrderFilter:
    Serial.println("Show yellow - order filter");
      digitalWrite(redLEDPin, LOW);
      digitalWrite(yellowLEDPin, HIGH);
      break;
    case ChangeFilter:
    Serial.println("Show red - replace filter");
      digitalWrite(redLEDPin, HIGH);
      digitalWrite(yellowLEDPin, LOW);
      break;
  }
}

hi, I'm having similar issues with my board. basically I load a sketch that shows on a webpage (ip: 198.168.50.200) some analog inputs values read by the micro with a refresh time selectable by the user.

I've found that after a while (less than one hour) I get my device disconnected but I cannot get connection again by means of refreshing the webpage and I have to reset the micro. maybe your "point 2" solution could help me, can you please explain in detail what you have implemented?

does anybody have any suggestion? this is quite annoying...

thanks

dario_show:
Hi,
maybe I will not be useful but I recently made some tests on Arduino MKR1010 WiFi and I want to share with you what I found.
I set up Arduino as webserver used to record some data during the day and to send them to any client using a browser.
During my first tests I could find 2 issues:
1 - WiFi loses connectivity randomly after 2 or 3 or 4 days, I don't know why. Maybe because of my router, maybe because of summer temperatures
2 - sometimes WiFi stay connected to the network (ping to the Arduino is succesfull) but doesn't answer to any client request

I fixed these problems:
1 - checking the state of the WiFi inside loop(): if "(WiFi.status() != WL_CONNECTED)" then I power-off the WiFi, then power-on WiFi and finally reconnect to the network
2 - inserting a timeout for client request: the original webserver example sketch use "while (client.connected())" and maybe this could be a problem (if client have some strange behavior)

After making these two fix my Arduino is running without problems for many days without disconnecting or stopping.

Hi,
I show you the part of my sketch where you can see the connectionBeginTime variable that does his job if client doesn’t close the connection. This code, except for my modification, comes from the WebServer example of WiFiNina.
For sure I’m not expert about client-server transmission, but I found that this solution solved my problem, especially if I connect the Arduino to the real internet where unknown client make some kind of request.
P.S. You probably heard of the risk coming from using the Arduino String class. I removed the usage of every String in my sketch too, to avoid any memory overflow (but this was not my problem).

client = server.available();
if (client) {
	int webserverRxBufferIndex = 0; // index init
	webserverRxBuffer[0] = NULL;
	boolean currentLineIsBlank = true;
	unsigned long connectionBeginTime = millis();
	while (client.connected()) {
	  if (client.available()) {
		char c = client.read();
		if (webserverRxBufferIndex < WEBSERVER_RX_BUFFER_LENGTH - 1) {
		  webserverRxBuffer[webserverRxBufferIndex++] = c; // save char into buffer
		  webserverRxBuffer[webserverRxBufferIndex] = NULL; // insert string terminator char
		}
		if (c == '\n' && currentLineIsBlank) {
		  LogHandler(WEBSERVER_LOG_PATH, webserverRxBuffer);
		  HttpRequestHandler(webserverRxBuffer);
		  break;
		}
		if (c == '\n') {
		  // you're starting a new line
		  currentLineIsBlank = true;
		} else if (c != '\r') {
		  // you've gotten a character on the current line
		  currentLineIsBlank = false;
		}
	  }
	  // interruption with fixed timeout
	  if (millis() - connectionBeginTime > 5000) {
		Serial.println(F("Webserver receive timeout"));
		break;
	  }
	}
	delay(1); // give the web browser time to receive the data
	client.stop(); // close the connection
}