Cannot graph data from bucket bug

I’m using a free test account, my data is being uploaded and visible in the bucket I just created (I only have one, so I can’t get the name wrong).

I have a dashboard showing the raw data, but any data from the bucket was not being displayed. I pulled my hair over this.
Then, I left the dashboard, re-entered it, and the time graphs showing bucket data, magically had the data that wasn’t being displayed.
Seems like a bug.
I’m good now, but I lost close to an hour trying to figure out why it wasn’t working, and only got out and back in the dashboard while writing this message.
The 3 graphs at the bottom were from bucket data and they were just completely empty

Live URL if that helps debug the backend:

Hello @marcmerlin,

Sometimes the web console needs to be refreshed to start getting data from server, so when this issues appear, click-off the dashboard edition switch in order to save the progress and refresh the browser tab.

Hope it helps

Yes, that’s what I found out as you said, but pretty counter-intuitive, I spent maybe 1H trying to debug something that wasn’t a problem and went away by reloading the page :-/
That said, I think I may have a bug for real this time.
‘temp2 now’ just never refreshes, and unless I really suck, is defined the exact same way as ‘temp now’, but on device #2. Device 2 works fine when going through buckets, or even displaying the right now temperature as text (upper left).
I’m guessing I can’t easily share my widget definition though, so here are screenshots:

The live text version displays fine

Any ideas?

Hello @marcmerlin,

Ok you’re defining a real time widget, with “update by device” mode, so I guess that your code is executing a “” instruction, isn’t it? Please be extremely careful with that instruction in order to prevent from intensive data polling (for example under 250 milliseconds). On the other hand, you can check in the data bucket if the data is being ingested, so I think that the problem isn’t in the device code.

Have you tried to delete the widget, and creating it again? you can also duplicate Temp1 now and change the device.


thanks @JorgeTrincado for the suggestion.
I use

void setup(void) {
  thing.add_wifi(SECRET_SSID, SECRET_PASS);
  thing["temp"] >> outputValue(fahrenheit);
loop {
 calculate fahrenheit...

That’s it. I tried deleting the temp2 streaming widget, and duplicating it from temp, and it literally broke the temp/temp2 display plus temp streaming widget too.
I have no idea why, I changed absolutely nothing other than deleting stream temp2 and duplicating it from stream temp as you suggested.
It’s all broken now, except reading from buckets, showing at at least the devices are still sending data ok:

I’m assuming that thing.handle() does its own magic so that it doesn’t spam the server and I thought using the device update interval was better than polling asynchronously? I’m happy to change to poll if you think that’s better though.

Hello @marcmerlin,

Ok, if you aren’t using the stream instruction there is no risks, thing.handle() will not spam the server, it only creates the wifi connection and sends the input/output resources configuration at the beginning of the execution, then waits to be questioned by the server to send the data.

This is how works: During the handshake, the server subscribes to the device resources and only extracts data from them when there is any consumer such as a data bucket, an opened dashboard, or maybe another device… thanks to this, no useless data is ever sent. But we have to configure the data buckets, widgets, etc to retrieve data from the devices in the sampling interval we want (as I guess you have made in the data bucket configuration).

However, the platform provides a way to send asynchronous data, using the instruction which allows sending data when we don’t know the exact timing, for example, the opening of a door.

So… I think that the problem with your widgets is the refresh mode configuration. They are waiting to receive a device stream, but the stream never comes (maybe one of them was catching the bucket message, but that was a coincidence). So the only you have to make is change the refresh mode to sampling interval, I’m sure that then it will start working.

Hope it helps!

@JorgeTrincado you were exactly right, that wasn’t super obvious because it seemed to randomly work before, but as you said, it was likely just timing luck.
Once I moved the server to using poll, instead of update by device, it started working reliably.
I also checked that the buckets were setup to sample once a minute.
Sorry, this was likely in the docs somewhere and I missed it.