Well, it seems not to go to sleep at all. It sends data to the IoT cloud all the time. With the ENV shield it is easy to see with the illuminance variable. I keep a hand over the ENV shield and the illuminance goes up and down all the time. I expected the MKR WiFi 1010 to stop sending data after the LowPower.sleep(8000), because the WiFi should be stopped by then.
The actual goal is to save power consumption, because I’d like to power the Arduino MKR WiFi 1010 from a battery. Since the method LowPower.sleep(8000) does not work, I tried something else.
There is also a method WiFi.lowPowerMode() of the WiFiNINA library, that automatically manages the power drain. It’s been accepted by the online Arduino editor but it is hard to say if it is even used. The IoT cloud code is somewhat like a black box. It is not clear if it even uses the WiFiNINA library to establish the WiFi connection.