Trying to start: Dashboard: how to link widgets to target code

Hello all.

I’ve just begun in Thinger and I’d like to get it to work. I see I’ll need your help.

I use VSCode / PlatformIO with Arduino Framework to code a ESP32 Pico D4, embeded in a LilyGo TTGO T3 V2.1.6 board.

I’ve been following a couple of instructions like:
https://docs.thinger.io/features/dashboards

In the device’s code there is:

void Thinger_configura_sensores() 
{
  thing["pH"]           >> [](pson& out)  { out = leitura_instantanea.AI[0][1]; };
  thing["Temperatura"]  >> [](pson& out)  { out = leitura_instantanea.AI[1][1]; };
  thing["Vazao"]        >> [](pson& out)  { out = leitura_instantanea.AI[2][1]; };
  thing["Proporcional"] >> [](pson& out)  { out = leitura_instantanea.AI[3][1]; };
}

which I try to associate with:

image

How should I go on?

Thank you.
Regards, Ciro.

Looking around Thinger tools, I found out that I must use buckets to transfer the code’s variables to Thinger dashboard. Then I’ve tried to configure it, but I’m stuck here:

image

None of these options make the gauge display the actual value the variable has (leitura_instantanea.AI[0][1]).

Thank you.
Regards,
Ciro.

Configuring the next one.
What to select in Select Resource?

Thank you.
Regards

Ok, thanks God now I can see values!

image

Is it possible to set decimal places? 5 pH is far away from 5.4 pH.

Thank you.
Regards, Ciro.

Hi,

You can feed the widget directly from the device resource, no bucket needed at all for this, if you are so kind to share your code (in appropriate way) we can see what may be causing the issue that avoids to feed the widget from the device.

Bests.

Hi @ega

This has been the only way I found out.
How to do it without buckets?

Thank you.
Regards

Hi,

The widgets should display the available defined resources, it is weird that your widget doesnt show them, thats why Im asking to see your code.

Regards,

Sure. Let me sumarize the Thinger related parts in the code:

#define THINGER_SERIAL_DEBUG
#define THINGER_FREE_RTOS

#include <ThingerESP32.h>
#include <ThingerESP32OTA.h>

#define USERNAME "C... ...o"
#define DEVICE_ID "R... ...r"
#define DEVICE_CREDENTIAL "kv... ...j9"

ThingerESP32 thing (USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);

ThingerESP32OTA ota(thing);

void Thinger_configura_sensores() 
{
  thing["pH"]           >> [](pson& out)  { out = leitura_instantanea.AI[0][1]; };
  thing["Temperatura"]  >> [](pson& out)  { out = leitura_instantanea.AI[1][1]; };
  thing["Vazao"]        >> [](pson& out)  { out = leitura_instantanea.AI[2][1]; };
  thing["Proporcional"] >> [](pson& out)  { out = leitura_instantanea.AI[3][1]; };
}

...

void setup() {
...

thing.add_wifi(STA_ssid, STA_senha);
thing.start();
Thinger_configura_sensores();
}

void loop(){
  thing.handle();
...
}

Thank you.

Hi,

As it is defined it should work, it is very weird that you can store the values into a bucket but it does not show at the dashboards, it is the same resource, can you double check it please?