Data Buckets do not work (using IoTMP in esp-idf library)

I am using the thinger.io IoTMP library for the esp-idf framework.

I declared a few resources as described in the documentation; one of these is, for example:

thing["astatus"] >> [](thinger::iotmp::output& out) {
    out["manouvers"] = st_manouvers;
    out["overtemps"]  = st_overtempmans;
    out["workminuts"] = st_workhours;
    out["temperature"]  = conv_temperature(st_temperature) / 10.0;
    out["cooldown"]  = st_mot_cooldown / 60;
};

The device connects to the cloud flawlessly, and I can see its “connected status” in the “Devices” page. Statistics are ok, and show data are exchanged.

If I go to the device API, all the declared resources are visible and work perfectly, each with its correct name, type, and current value. I can also set new values for input resources. The “astatus” resource looks like this:

But if I use the dashboard, widgets are updated only when the page is refreshed, i.e. only when I open the dashboard or when I reload the page.

The bigger problem is that it seems that data buckets don’t record anything. I configured a data bucket to poll for resource “astatus” every 5 minutes:

(not shown in the image, but backend is MongoDB with retention 1 month - all default).

I tried different resources, nothing gets ever recorded. And it is strange, because the APIs work: a poll from data bucket would only call the device repeatedly like the API page does.

Moreover, I also tried to stream the resource using:

thing.stream("lastmove");

but again, a data bucket configured to update by “Stream by device” never records anything:

Yes I have two buckets, one polls and the other waits for a streaming. None of them records anything.

Before using the IoTMP library, I used the standard MQTT functions of esp-idf, and in that case the data buckets worked. I switched to IoTMP because of its “describe” functionality, which is perfect for my customer who don’t have to remember topics and so on. But I need data buckets (just one or two), and they don’t work.

In another question I posted here (IOTMP: how to set new value for a resource, by device (like a publish)) user “ega” suggested to use the instruction write_bucket(), but that does not work either - it even disconnects from the server and then reconnects. I traced the library with logs, and discovered that the library sends a packet but the server never replies.

This problem is getting me frustrated. The best for me would be to make a push to update a data bucket, but I could also lower my expectations and use polling. But nothing works.

Any help is appreciated. I suspect the culprit is the thinger.io IoTMP library. Can someone confirm it really works?

Suggestion: Try creating a simple sketch using the Arduino framework and check if you can register anything.
Use the Thinger.io Arduino library (GitHub - thinger-io/Arduino-Library: IOTMP Arduino Library for connecting devices to thinger.io #IoT · GitHub).

What version of the Thinger server are you using?

TY George.

I will try that, but I really want to use esp-idf because I need some advanced functionality.

I don’t understand your last question: I opened a free account to thinger.io, in order to do some testing. I can have up to 2 devices, 4 dashboards, 4 data buckets and 4 endpoints. My device connects to “iot.thinger.io” using IoTMP without TLS.

I’ve enabled logging, and I see that the server sends the request DESCRIBE when appropriate, and some START_STREAM when a dashboard is opened. I expected that, if in the dashboard a resource is monitored with “poll every 5 minutes”, then every 5 minutes a READ request should be sent to the device. It seems this does not happen.

Likewise, if a data bucket is configured to “poll every 5 minutes”, it should do that, instead it does not.

Before using IoTMP I used MQTT and that worked. Of course, in MQTT there is no way to poll a device, instead is the devices that pushes (publish) data.

That’s strange.
When selecting the “Update by Device” option, that is precisely the expected behavior.

That is why I suspect there might be a bug related to the “esp-idf” library.
I think you should try testing it with the Arduino library.

Thinger has excellent solutions for your needs.

Ok, I update the infos.

I have my complete application written with esp-idf, so I first tried to use the thinger arduino library on top of the arduino component of esp-idf. I had a lot of compilation problems and finally I gave up. It seems that thinger libraries can not work in esp-idf (I’m using version 6.x).

Then I tried arduino IDE and the thinger library for arduino.

As expected, everything works normally. This test has been a stupid test, because I expected it worked…

Now I have two options:

  1. Rewrite all my firmware using the arduino framework
  2. Hope that someone at thinger.io takes a look at the esp-idf library, which partly works but it must have some (perhaps stupid) bug. I wrote an email to thinger.io, but got no reply.

Thanks for the help and regards.