I have a MKR ENV shield piggybacked on a MKRWiFi 1010 board, connected via USB to Windows 10 PC running the IDE. The ENV shield is on top with all the header pins lining up correctly with the corresponding pin on the WiFi 1010.
I have the Arduino_MKRENV 1.1.0 library installed.
I went through all the steps to test the MKR1010 (fine) and got it connected to my WiFi network.
However, all I get on the serial monitor is "Failed to initialize MKR ENV shield!"
I am assuming the USB connection that is powering the 1010 is also powering the MKE ENV shield.
What might cause failure to initialize the ENV shield?
Thanks, John P.
/*
MKR ENV Shield - Read Sensors
This example reads the sensors on-board the MKR ENV shield
and prints them to the Serial Monitor once a second.
The circuit:
- Arduino MKR board
- Arduino MKR ENV Shield attached
This example code is in the public domain.
*/
#include <Arduino_MKRENV.h>
void setup() {
Serial.begin(9600);
while (!Serial);
if (!ENV.begin()) {
Serial.println("Failed to initialize MKR ENV shield!");
while (1);
}
}
void loop() {
// read all the sensor values
float temperature = ENV.readTemperature();
float humidity = ENV.readHumidity();
float pressure = ENV.readPressure();
float illuminance = ENV.readIlluminance();
float uva = ENV.readUVA();
float uvb = ENV.readUVB();
float uvIndex = ENV.readUVIndex();
// print each of the sensor values
Serial.print("Temperature = ");
Serial.print(temperature);
Serial.println(" °C");
Serial.print("Humidity = ");
Serial.print(humidity);
Serial.println(" %");
Serial.print("Pressure = ");
Serial.print(pressure);
Serial.println(" kPa");
Serial.print("Illuminance = ");
Serial.print(illuminance);
Serial.println(" lx");
Serial.print("UVA = ");
Serial.println(uva);
Serial.print("UVB = ");
Serial.println(uvb);
Serial.print("UV Index = ");
Serial.println(uvIndex);
// print an empty line
Serial.println();
// wait 1 second to print again
delay(1000);
}
No replies here, so I sent in a trouble ticket to Arduino. They have had me repeat many tests I told them I had already done, just now asked for a video of me plugging the board in and verifying/loading the sketch, and getting the failure to initialize message - did so.
It has been taking days between requests, responses, next request. One suggestion was not to plug it in to the MKR relay shield, which I did, but if that had been the problem then the relay shield would have to be bad!
Any suggestions on how to get a working env shield out of Arduino? At this point I'm ready to take my losses and abandon the MKR line completely.
The finally did reply and it took a month or so, but they found a problem in the WiFi1010 firmware that they fixed. I've now had it running for several months and it was working well for a while but the IoT cloud connection was very fragile.
Complained to them about that, once again took a month or so but they pushed a fix out to the IoT cloud service - very reliable now.
But, the humidity sensor in ENV is now reading values above 100%, which shouldn't happen. I'm going to reload my sketch, see if some bit error happened but kinda seems like a hardware issue.
The first time I had to send them screen shots of it not working and try some changes they suggested, which didn't solve the problem. I think the issue was that on the ENV board, my version did not have the UV sensor but still had the circuit board traces for it and the firmware didn't work.
First they sent me a private firmware update, I loaded it and it fixed the problem. A few weeks later it was part of the MKR ENV library - so make sure your library is up to date.
Thanks for the info. I think mine is just "bust" then. Tried it on multiple mkr 1010 boards and every time I put power to the board then the orange LED that is normally the battery charge LED lights up and blinks and will not stop blinking.
That light blinks all the time on mine, also. I looked into it once - I forget what I found but bottom line was it had nothing to do the using the sensors, so I just let it blink.
Haha, one would have thought that these folks running a company this significant would have perhaps come up with a simple explanation of what the lights mean...lol.