There is a 2019 thread and a 2020 thread on this topic, but there doesn't seem to have been an answer to the issue in either one.
I'm running the WiFi1010 with a MKR Env Shield to send temperature, humidity, air pressure, and light level to the IoT cloud where I view the data using dashboard widgets.
There have been several problems with the MKR ENV library code that I've had sessions with Arduino support and they updated the library once and for a more recent problem, sent me the sketch below, which works - for a while.
When running the board stack powered over the USB connection, with no battery or computer connected, after random amounts of time, the data just stops - and pretty much every time that happens when I check, the orange Battery Charge light is blinking. Might run for a few hours, sometimes less than an hour, never successfully overnight.
On earlier thread said the specs on that charging circuit would cause the LED to blink when these conditions are observed: "Charge suspend (Input over-voltage, TS fault, timer fault, input or system over-voltage)" and mention was made that the USB handling stops when the board blinks the charge LED.
The WiFi 1010 FAQ doesn't mention the charging light at all.
Is there someway to include in the code a way to reset that condition online, or any other way to have a reliable data stream?
#include "thingProperties.h"
#include <Arduino_MKRENV.h>
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
// This delay gives the chance to wait for a Serial Monitor without blocking if none is found
delay(1500);
// Defined in thingProperties.h
initProperties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
while(ArduinoCloud.connected() != 1){
ArduinoCloud.update();
delay(500);
}
delay(500);
if (!ENV.begin()) {
Serial.println("Failed to initialize MKR ENV shield!");
while (1);
}
}
void loop() {
ArduinoCloud.update();
// Your code here
temperature = ENV.readTemperature();
humidity = ENV.readHumidity();
pressure = ENV.readPressure();
illuminance = ENV.readIlluminance();
// print each of the sensor values
Serial.print("Temperature = ");
Serial.print(temperature);
Serial.println(" f");
Serial.print("Humidity = ");
Serial.print(humidity);
Serial.println(" %");
Serial.print("Pressure = ");
Serial.print(pressure);
Serial.println(" mb");
Serial.print("Illuminance = ");
Serial.print(illuminance);
Serial.println(" lx");
// print an empty line
Serial.println();
// wait 1 second to print again
delay(1000);
}