MKRIoT not working without computer

Hi everyone. I upload the sketch on my Arduino IoT Carrier (connected to MKR WIFI 1010) from the computer and everything works. But, when I detach it and power it with a battery or through a wall USB cable, it seems that it doesn't load the code. The frontal LED starts, there's some sound and the display turn on, but then nothing. I have to use it in a gardenhouse, so I will power my Arduino only with USB cable. I use also this simple code.

/*

*/
#include<Arduino_MKRIoTCarrier.h> //libreria per far funzionare Arduino
MKRIoTCarrier carrier; //creo un oggetto virtuale che corrisponde all'Arduino fisico
float temperatura;
float umidita;
void setup() {
    CARRIER_CASE = false;
    carrier.begin();
}

void loop() {
    temperatura = carrier.Env.readTemperature(); //leggo la temperatura dall'Arduino e salvo il valore nel nome temperatura
    umidita = carrier.Env.readHumidity(); //leggo la umidità dall'Arduino e salvo il valore nel nome umidita
    
    carrier.Buttons.update();
    
    if(carrier.Buttons.onTouchDown(TOUCH0)){ //permette di scrivere sul display dell'Arduino il valore della temperatura
      printTemperature();
    }
    
    if(carrier.Buttons.onTouchDown(TOUCH1)){ //permette di scrivere sul display dell'Arduino il valore dell'umidità
      printHumidity();
    }
}

void printTemperature(){
      carrier.display.setTextSize(2);
      carrier.display.fillScreen(ST77XX_RED);
      carrier.display.setCursor(30,50);
      carrier.display.print("Temperatura = ");
      carrier.display.setCursor(30,80);
      carrier.display.print(temperatura);
      carrier.display.print(" C");
}

void printHumidity(){
      carrier.display.setTextSize(2);
      carrier.display.fillScreen(ST77XX_BLUE);
      carrier.display.setCursor(40,100);
      carrier.display.print("Umidita = ");
      carrier.display.print(umidita);
      carrier.display.print(" %");
}

Hi, me and others had the same issue about a year ago.

I was in contact with the support thereafter for two weeks but they couldn't help and eventually I gave up due to a broken library which at least compiles now.

I now updated the firmware & libraries and uploaded my sketch to see if those problems have been resolved, I even deployed everything on a second kit to - it still doesn't work properly, I experience the same problem as you do. For me it works only when connected via USB and when I upload a different sketch before.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.