Dashboard does not show current data

I built a weather station that transmits the data via the IOT cloud.
I can upload my program without any problems and the data is displayed to me via the serial monitor, and the data is also initially displayed via the dashboard.
After about 3 hours (never really paying attention to the exact time) no more new data is sent to the IOT Cloud, even if the board is displayed there as online.
My current solution is to play the program again and again. But that's not a solution either...
I definitely don't know what to do anymore.
Can someone help me to solve this problem?

here is my code:

/*
  Sketch generated by the Arduino IoT Cloud Thing "Untitled"
  https://create.arduino.cc/cloud/things/15f4fa14-2298-4c75-aba6-40e17ee54ea2

  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  float luftdruck;
  CloudTemperatureSensor temperatur;
  CloudIlluminance helligkeit;
  int buttonPushCounter;
  int buttonState;
  int lastButtonState;
  int luftfeuchtigkeit;
  int regenSen;
  CloudVolume regenmenge;

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/

#include <ArduinoIoTCloud.h>

#include "thingProperties.h"

#include <BH1750.h>


#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>



#define BME_SCK 13
#define BME_MISO 12
#define BME_MOSI 11
#define BME_CS 10

#define SEALEVELPRESSURE_HPA (1013.25)

Adafruit_BME280 bme; // I2C
//Adafruit_BME280 bme(BME_CS); // hardware SPI
//Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); // software SPI

unsigned long delayTime;


BH1750 lightMeter;

#include "RTClib.h"

RTC_DS3231 rtck;


char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};




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);

  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
  */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();

  Wire.begin();

  pinMode(2, INPUT);

  lightMeter.begin();
  Serial.println(F("BH1750 Test"));

  while (!Serial);   // time to get serial running
  Serial.println(F("BME280 test"));

  unsigned status;

  // default settings
  status = bme.begin(0x77);
  // You can also pass in a Wire library object like &Wire2
  // status = bme.begin(0x76, &Wire2)
  if (!status) {
    Serial.println("Could not find a valid BME280 sensor, check wiring, address, sensor ID!");
    Serial.print("SensorID was: 0x"); Serial.println(bme.sensorID(), 16);
    Serial.print("        ID of 0xFF probably means a bad address, a BMP 180 or BMP 085\n");
    Serial.print("   ID of 0x56-0x58 represents a BMP 280,\n");
    Serial.print("        ID of 0x60 represents a BME 280.\n");
    Serial.print("        ID of 0x61 represents a BME 680.\n");
    while (1) delay(10);
  }

  Serial.println("-- Default Test --");
  delayTime = 1000;

  Serial.println();

#ifndef ESP8266
  while (!Serial); // wait for serial port to connect. Needed for native USB
#endif

#ifndef ESP8266
  while (!Serial); // wait for serial port to connect. Needed for native USB
#endif

  if (! rtck.begin()) {
    Serial.println("Couldn't find RTC");
    Serial.flush();
    abort();
  }

  Serial.println("Setting the time...");
  // When time needs to be set on a new device, or after a power loss, the
  // following line sets the RTC to the date & time this sketch was compiled
  rtck.adjust(DateTime(F(__DATE__), F(__TIME__)));
  // This line sets the RTC with an explicit date & time, for example to set
  // January 21, 2014 at 3am you would call:
  // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));

}

void loop() {
  ArduinoCloud.update();
  // Your code here


  // read the pushbutton input pin:
  buttonState = digitalRead(2);

  // compare the buttonState to its previous state
  if (buttonState != lastButtonState) {

    // if the state has changed, increment the counter
    if (buttonState == HIGH) {

      // if the current state is HIGH then the button went from off to on:
      buttonPushCounter++;
    }
  }

  // Delay a little bit to avoid bouncing
  delay(50);

  regenmenge = buttonPushCounter * 0.45;

  delay(50);

  DateTime now = rtck.now();


  if (now.hour() == 22) {
    if (now.minute() == 1) {
      if (now.second() == 1) {
        buttonPushCounter = 0;
      }
    }
  }

  delay(50);

  luftdruck = bme.readPressure() / 100.0F;

  luftfeuchtigkeit = bme.readHumidity() ;

  temperatur = bme.readTemperature();

  helligkeit = lightMeter.readLightLevel();

  float lux = lightMeter.readLightLevel();



  Serial.print("Light: ");
  Serial.print(lux);
  Serial.println(" lx");
  delay(50);

  printValues();
  delay(50);

  Serial.println("--------------------");
  Serial.print(now.day(), DEC);
  Serial.print('/');
  Serial.print(now.month(), DEC);
  Serial.print('/');
  Serial.print(now.year(), DEC );
  Serial.print(" (");
  Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
  Serial.print(") ");
  Serial.print(now.hour(), DEC);
  Serial.print(':');
  Serial.print(now.minute(), DEC);
  Serial.print(':');
  Serial.println(now.second(), DEC);

  delay(50);

  Serial.print("heutige Regenmenge: ");
  Serial.print(regenmenge);
  Serial.println(" l");

}

void printValues() {

  Serial.print("Temperature = ");
  Serial.print(bme.readTemperature());
  Serial.println(" °C");

  delay(50);


  Serial.print("Pressure = ");
  Serial.print(bme.readPressure() / 100.0F);
  Serial.println(" hPa");

  delay(50);


  Serial.print("Approx. Altitude = ");
  Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
  Serial.println(" m");

  delay(50);

  Serial.print("Humidity = ");
  Serial.print(bme.readHumidity());
  Serial.println(" %");

  delay(50);

  Serial.println();
  Serial.println();



}



Is the information being printed in the serial port when you are not receiving data in the Cloud?

What is the sending interval of your variables? In my case the chart is always empty until next data push when entering the dashboard.

Hi, i am a newby with arduino. I have the same issue, I though it could be a memory problem but I don't know where to star. Did you find a solution?

What is the fastest that the dashboard can update?

My project is unique in that the majority of the time the arduino will be doing nothing, but when i do use it, I'd like to send 5ish variables to be updated once or twice per second. I am controlling an espresso machine pump and would like the shot variables to be as accurate as possible (timer, pressure, flow rate, and weight from a Bluetooth scale, as well as a shot phase indicator).

Using a tft right now, and thinking of moving to an ESP32 screen, but thought the dashboard could be perfect if it could update as fast as my tft.

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