How can you send a variable from ESP32 to Squareline Studio’s GUI?

I’m working on the ESP32 to automatically update text labels from various inputs.

You dont mention what version of LVGL you are using so I’ll assume 9.1, I’ll also assume you are using Arduino…

The docs are here:
https://docs.lvgl.io/9.1/

You specifically want to look at:
https://docs.lvgl.io/9.1/widgets/label.html

In the past I’ve created global variables for the labels I want to update (not in the creation of the label itself) IE in the project.ino file define the label ie:

lv_obj_t * labelx;

Then create it as normal.

In your loop code (or even better a lv task) update the label per:

lv_label_set_text(labelx, "My updated text");

Or if you want sprintf type formatting you can use:

lv_label_set_text_fmt(labelx, "%s #%s %s°c#", bWeather.c_str(), strColour, doc["temp"].as<String>());

Hope that helps!

I think a similar issue had already been answered here: How do you send ESP32/Arduino variable to Squareline's GUI? - How to - Forum - SquareLine Studio