Values won't change in dashboard?

hello there,
I got an opla kit a little while ago so I used it today. all was going well when the dashboard stopped updating the values. I was using the personal weather station here is the code:`

#include “thingProperties.h”

#include <Arduino_MKRIoTCarrier.h>

MKRIoTCarrier carrier;

void setup() {

// Initialize serial and wait for port to open:

Serial.begin(9600);

while (!Serial);

// Defined in thingProperties.h

initProperties();

// Connect to Arduino IoT Cloud

ArduinoCloud.begin(ArduinoIoTPreferredConnection);

//Get Cloud Info/errors , 0 (only errors) up to 4

setDebugMessageLevel(2);

ArduinoCloud.printDebugInfo();

//Wait to get cloud connection to init the carrier

while (ArduinoCloud.connected() != 1) {

ArduinoCloud.update();

delay(500);

}

delay(500);

CARRIER_CASE = false;

carrier.begin();

carrier.display.setRotation(0);

delay(1500);

}

void loop() {

ArduinoCloud.update();

carrier.Buttons.update();

while(!carrier.Light.colorAvailable()) {

delay(5);

}

int none;

carrier.Light.readColor(none, none, none, light);

temperature = carrier.Env.readTemperature();

humidity = carrier.Env.readHumidity();

pressure = carrier.Pressure.readPressure();

if (carrier.Button0.onTouchDown()) {

carrier.display.fillScreen(ST77XX_WHITE);

carrier.display.setTextColor(ST77XX_RED);

carrier.display.setTextSize(2);



carrier.display.setCursor(30, 110);

carrier.display.print("Temp: ");

carrier.display.print(temperature);

carrier.display.print(" C");

}

if (carrier.Button1.onTouchDown()) {

carrier.display.fillScreen(ST77XX_WHITE);

carrier.display.setTextColor(ST77XX_RED);

carrier.display.setTextSize(2);



carrier.display.setCursor(30, 110);

carrier.display.print("Humi: ");

carrier.display.print(humidity);

carrier.display.print(" %");

}

if (carrier.Button2.onTouchDown()) {

carrier.display.fillScreen(ST77XX_WHITE);

carrier.display.setTextColor(ST77XX_RED);

carrier.display.setTextSize(2);



carrier.display.setCursor(30, 110);

carrier.display.print("Light: ");

carrier.display.print(light);

}

if (carrier.Button3.onTouchDown()) {

carrier.display.fillScreen(ST77XX_WHITE);

carrier.display.setTextColor(ST77XX_RED);

carrier.display.setTextSize(2);



carrier.display.setCursor(30, 110);

carrier.display.print("Pressure: ");

carrier.display.print(pressure);

}

if (humidity >= 60 && temperature >= 15) {

weather_report = "It is very humid outside";

}else if (temperature >= 15 && light >= 700) {

weather_report = "Warm and sunny outside";

}else if (temperature <= 16 && light >= 700) {

weather_report = "A little cold, but sunny outside";

}

else{

weather_report = “Weather is normal”;

}

}`

no one reply please, i just had to open the serial monitor. i am very dumb!!!

Hi, I wish someone can help here… as I have a similar issue

I set up my weather station using Opla IoT Kit…I connected to the battery and at 2am is last reading. So this means unit lost connection with the server… how can I restart/reconnect? Do I need to connect to full Editor - Upload and Save then click Monitor to start again? Not sure if this is clear or I need to make print screens?

@anon33446669
or me it does not work without this extra line

int none;
int light; //for me it does not work without this line
carrier.Light.readColor(none, none, none, light);

first, does the code have while(!serial) ?

yes in void set up

void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial);

  // Defined in thingProperties.h
  initProperties();

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  //Get Cloud Info/errors , 0 (only errors) up to 4
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();

  //Wait to get cloud connection to init the carrier
  while (ArduinoCloud.connected() != 1) {
    ArduinoCloud.update();
    delay(500);
  }
  delay(500);
  CARRIER_CASE = true;
  carrier.begin();
  carrier.display.setRotation(0);
  delay(1500);
}

ok well if you re-upload then you have to open serial monitor and then the rest of the code will run unless thats not your problem. if so please reply

@anon33446669 thanks for looking into it…
I think it is sth else I log the whole case as a separate item to document each step…

ok, im very beginner so that probably didn’t help but if it did then glad i could help!

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