Dashboard, Time Picker is incorrect

Just create a small "Thing" to have a LED blink on a schedule. Use the Cloud Time Picker and create a Dashboard.
You will see a time difference in "Time Picker" Cloud variable with the actual time.
It starts perfectly after uploading the code to ESP8266. But, when time passes by (after 3 to 5 minutes) you will see a time difference of what is shown in "Time Picker" window with the actual time where time picker is showing a lower time drift than the actual time.
When the same code runs for few hours, this time difference gets accumulated and shows a huge difference in minutes or hours.
Basically, the time picker seconds are displayed in a lower speed when compared with actual second counting speed.
Any solution for this ?
Please help and inform.

Hello manjulacr

We need some additional information.
Post your sketch, well formated, with well-tempered comments and in so called code tags "</>" to see how we can help.

Have a nice day and enjoy coding in C++.

Hi Paul,

There's no code required to see what I am saying. It's about a bug in "Time Picker" widget in Arduino IoT Cloud platform.

Log in to your Arduino IoT account and do the follwing:

  1. Create a thing by any name as a "CloudTime" variable type. (Example: CloudTime time_read;)
  2. in Dashboard, create a widget as a "Time Picker"
  3. Allow the "Time Picker" to display the current local time (in my case, I selected "Asia/Colombo"
  4. Let it run for 5 minutes or bit more. See the time difference of the "Time Picker" and your System Time (Windows time displayed in Right hand corner). The "Time Picker" time is slower than the System Time. If you keep running the "Time Picker" for more hours, the "Time Picker" time difference increases and the differnce is huge.
    So, Whnat I am tring to point is that there is a bug in "Time Picker" widget where the display time is slow than the usual. Basically, it takes bit less milliseconds (number of milisecnds are slow to change a single second) to change each second.

Hope you got it.

OK. I think I found the issue. It seems to be that I am having some if conditions and functions within void loop.
I will post my code.
Can some one give me a feedback how to correct and eleminate the time delay issue when displaying Cloud time ?

The code within void loop is:

void loop() {
  ArduinoCloud.update();
  time_read = ArduinoCloud.getLocalTime();
  random_value = random(100, 900);
  if (ArduinoCloud.connected() == 0) {
    network_status = false;
  } else {
    network_status = true;
  }

  if (scheduler) {
    if (schedule_vera.isActive()) {
      lightv = true;
      led_V = true;
      digitalWrite(Led_V, HIGH);

      if (togglev) {
        counterv = ++counterv;
        togglev = false;
      }
    } else {
      lightv = false;
      led_V = false;
      digitalWrite(Led_V, LOW);
      togglev = true;
    }

    if (schedule_hall.isActive()) {
      lighth = true;
      led_H = true;
      digitalWrite(Led_H, HIGH);

      if (toggleh) {
        counterh = ++counterh;
        toggleh = false;
      }
    } else {
      lighth = false;
      led_H = false;
      digitalWrite(Led_H, LOW);
      toggleh = true;
    }
  }
}

Can someone help me to coreect this ?

If I have time_read = ArduinoCloud.getLocalTime(); only inside void loop, there's no such delay.

@manjulacr did you solve this problem? if so what was the issue. I am seeing a similar problem.

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