0

How to stop a data point expiring
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

How to stop a data point expiring

by cjdshaw on Fri Sep 27, 2019 12:40 pm

I have a dashboard I'm very happy with. It has some sliders for me to adjust, my ESP8266 reads these and sends its output to a graph. The only problem is that if I don't adjust a slider for a month, the data point expires, the slider reads 0 and Adafruit IO return [] as the last data, causing the whole system to fail. Is there a recommended way to avoid this? I could have the ESP read the data, then immediately update it, but that runs the risk of overriding a user interaction if there's any delay.

cjdshaw
 
Posts: 20
Joined: Mon May 08, 2017 4:04 pm

Re: How to stop a data point expiring

by brubell on Mon Sep 30, 2019 9:49 am

You could try turning feed history off - turning history off for your feed will mean only the last value received is stored.

brubell
 
Posts: 528
Joined: Fri Jul 17, 2015 10:33 pm

Re: How to stop a data point expiring

by abachman on Mon Sep 30, 2019 10:05 am

Not trying to be sarcastic, but that's pretty much the exact reason we made IO+ ;)

But if that doesn't work (totally fine), I would recommend looking into wrapping a small application around your IO feeds. Adafruit IO won't hold old data, but you can hold it as long as you like. Create a web app (free on Heroku, Glitch, zeit.co, raspberry pi in a shoebox, etc.), have that app pull your data, aim the ESP at your app instead of IO.

Easier said than done, but the key bit is switching from IO being the sole source of truth to IO being a pass-through for your data.


- adam b.

abachman
 
Posts: 338
Joined: Mon Feb 01, 2010 12:48 pm

Re: How to stop a data point expiring

by cjdshaw on Mon Sep 30, 2019 10:11 am

brubell wrote:You could try turning feed history off - turning history off for your feed will mean only the last value received is stored.


Great, I'll try that

cjdshaw
 
Posts: 20
Joined: Mon May 08, 2017 4:04 pm

Please be positive and constructive with your questions and comments.