How to reliable clear the dashboard message widget?

If I clear the message widget from Arduino code like this:

statusText = PropertyActions::CLEAR; 

It always works But if I try to clear then write a new message like this:

statusText = PropertyActions::CLEAR; 
statusText = "some message";

It always fails to clear first. A delay between doesn't help. I don't understand this!
Is there a way to clear then write to avoid long message lists?

Looks like I answer my own question. In the above example the second command overwrites the first clear command. The solution is to put ArduinoCloud.update(); in between like this:

statusText = PropertyActions::CLEAR; 
ArduinoCloud.update();
statusText = "some message";

Then it works as desired!

3 Likes

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