Issues with the dashboard

When starting, dashboard fires an "on change" event
I have a dashboard full of slides and steppers and some buttons. When I start my Arduino and it establishes contact with the cloud, the dashboard fires on change events for some of the gadgets. I don't want that. Can I prevent it in the dashboard? I want to set up the dashboard values from the Arduino. Not the other way around.

Dashboard doesn't remember correctly the last value
If I have to stick with the dashboard pushing its values as on change events at the beginning, I'd hope the dashboard would push correct values. But I have a slider going from -300 to -270. The dashboard remembers that the last value is +278. That is a value I had long ago, before I had to change to negative values. The dashboard still pushes that +278 at the start. It might not be a dashboard issue. When I handle the variables in the cloud, I can see the wrong value. Also the last update timestamp is wrong:

The variable in concern is discant_higher. The time stamp is some 20 minutes late. When I refreshed the browser page, it got even worse:

Seems like the cloud randomly picks any previous value from a shady cache somewhere.

So these two issues don't go together very well. They corrupt my attempts to fine tune my machine with the help of an Arduino cloud dashboard.

1 Like

As far as I am aware there is no means of changing the events from the dashboard end. (Perhaps an improvement suggestion to Arduino? :thinking:)
I would set up a variable in setup, say
int justStarted = 0;

And define numberOfSliders = 6 // or whatever your number is

And then in the onChange do something like
if (justStarted > numberOfSliders){
// your on change code

I am sure some C++ whizz will give a better method and correct my syntax and logic but you should be able to work something out from here :grinning:

1 Like

Right now it seems I have correct values in the last value field in the cloud. But still it's very inconvenient to have to write code, which prevents the values from being loaded from the cloud into the Arduino at start up.

Well, right now it seems the last value can be anything previously used. It goes back and forth from the correct value from this morning to the wrong value from yesterday, when I keep refreshing the browser page. Really annoying! And totally a useless idea to have the dashboard feed values to the Arduino at startup.

I'm testing the following:

bool starting;

void setup()
  starting = true;


  // Connect to Arduino IoT Cloud
  // more setup, like setting the sliders in the dashboard where I want them

  starting = false;

Then, each onChange function goes like this:

void onBassHigherChange()  {
  if (starting)
  // Add your code here to act upon BassHigher change
  angles[0][bass_tone][1] = bass_higher;
  Serial.println("bass higher change");

So if the starting flag is set, the function returns immediately. If not, the bass_higher variable taken from one slider is placed in my data array.

You have an Arduino update instruction in your loop?
Shouldn’t you set starting false after the first update?
Do your on change routines get calls before the first update in loop?

I noticed the same, even with simple example like a button and LED, LED might be on or off when dashboard connects, regardless of the state it was left off previously. This is for Arduino IoT team to sort out, we can only create work arounds. Another annoyance is that reading a variable from the board could take a long time initially, measured 10 sec, then it updates ok

Good point! I thought the calls would happen already at the
call. Don't know for sure, but I guess I have to reset the flag only after the first update. I haven't actually tracked down the exact moment, when the stupid first update happens. Do all automatic updates happen during the first
or one by one. To be sure, I might reset the flag 5 seconds after it was set.

void main()
  if (starting && millis() > fiveSeconds)
    starting = false;

(When starting is finally set to false, the if() never calls the millis() function again, if the compiler is smart enough.)

Dashboard doesn't remember correctly the last value also for me, it's a recent problem, before all is ok, please resolve this bug

Same problem with the dashboard values being wrong, this looks like the same issue as yandy1471's thread. Worked fine for months but whatever recent update there was broke it.

I think it would be nice if the start values could be decided from the Arduino sketch. Either you do something like:
or you start setting values for each gadget in your setup() .

Same issue, really annoying, my code flips an air conditioner on when the set temp is less than the recorded temp. The relay is triggered, A/C is on, but the temp setting stores an old value… this is really set at 72degrees.

Arduino team please fix!


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