0

Line Chart blocks not displaying historical data
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Line Chart blocks not displaying historical data

by csn495 on Sun Sep 12, 2021 12:45 pm

First off I want to thank those who brought us Adafruit IO, it's awesome. I am having one problem though. I am using IO with a raspberry pi zero w and python, I followed the guides to get it up and running and I am sending data and receiving it on my feeds like it should be. I have it set up to send data from an MCP9808 and BME280 once every 60 seconds. The data is populating the feeds every 60 seconds like I want it to no problem. My text blocks and stream block on my dashboard are updating once a minute as new data points come in. The stream block DOES show historical data, for however far back I set it to. The issue I'm having is that the line chart blocks I'm setting up are not displaying any data points from before the time that I opened that dashboard in my browser. The line charts are almost acting as if they are set to only display live data, regardless of the amount of history I have them set to display, if that makes sense. When I check my feeds they do show the historical data, once per minute like I have it set up in the code. I have tried all of the different history settings on the line chart block (1 hour, 2 hour, 4 hour, and so on). I have also tired three different browses just to rule that out. If I leave my browser open to that dashboard for an hour, the line chart will populate with data points from that hour that it was open. As soon as I refresh the page that data disappears. I'm really hoping to get this working because the live graphing feature was actually what brought my attention to adfruit io in the first place.

EDIT: I just noticed that the same thing happens to the live chart on each of my feed pages. No historical data displays, only data that has come in since the time when I opened the page.

Here is a link to the script I am running if it helps:

https://github.com/csn495/environmental-monitoring-projects/blob/master/AdafruitIO/bme280-mcp9808-adafruitio.py

Is there something I can change on my end to get this to work, or is this a bug? Many thanks in advance!
Attachments
Screenshot 2021-09-12 123343.png
How my line chart blocks look
Screenshot 2021-09-12 123343.png (126.98 KiB) Viewed 800 times
Screenshot 2021-09-12 123259.png
Historical data in my feeds
Screenshot 2021-09-12 123259.png (77.07 KiB) Viewed 800 times

csn495
 
Posts: 3
Joined: Sun Sep 12, 2021 10:52 am

Re: Line Chart blocks not displaying historical data

by jwcooper on Mon Sep 13, 2021 11:41 am

It looks like you're saving data such as 72.84 F, including the Fahrenheit "F" string. I'm curious if that's causing issues here, particularly on historical data.

Can you try saving the data without the "F" on each data point?

jwcooper
 
Posts: 813
Joined: Tue May 01, 2012 9:08 pm

Re: Line Chart blocks not displaying historical data

by csn495 on Wed Sep 15, 2021 8:50 pm

Thank you so much, that seems to be what the problem was. I did what you suggested and the line charts are working properly now.

Shortly after resolving that issue I began experiencing another problem. My feeds were updating once minute for a while, then today I noticed that they were no longer updating with new data points, as if they were no longer being pushed data from the raspberry pi's ( I am currently running two separate pi's using the same code (different feeds) ) and they each dropped off at different times. I am attatching screenshots of the stream blocks, hopefully that will help make more sense of what I'm talking about. It was strange because when I left my browser open to the dashboard for a while, the line chart would populate with new data points, but when I refreshed the page those data points disappeared. It seemed to me like the pi's were still sending data, but adafruitIO wasn't storing it? I deleted all of my active feeds and created new ones, and also rebooted both Pi's (thus restarting the script). This resolved the issue for a short time then the same thing happened again. I forgot to mention before, but I am running pihole's as my primary and secondary DNS servers on my network, are there any known conflicts between pihole and AdafruitIO?
Attachments
Screenshot_20210915-162236_LI.jpg
Screenshot_20210915-162236_LI.jpg (802.78 KiB) Viewed 764 times
Screenshot_20210915-145223_LI.jpg
Screenshot_20210915-145223_LI.jpg (982.18 KiB) Viewed 764 times

csn495
 
Posts: 3
Joined: Sun Sep 12, 2021 10:52 am

Re: Line Chart blocks not displaying historical data

by jwcooper on Thu Sep 16, 2021 4:09 pm

A pihole should have no issues with adafruit io, you're good to go there.

Is the data on your feed page? /username/feeds

Drill down to each feed and check if the data is there. It should be if it's in the charts.

The Stream block only loads the last saved data when you refresh a browser. I'm not sure how it would handle when your computer goes to sleep. I think the chart would behave differently and pull all the data again.

jwcooper
 
Posts: 813
Joined: Tue May 01, 2012 9:08 pm

Re: Line Chart blocks not displaying historical data

by csn495 on Sun Sep 19, 2021 2:08 pm

Awesome, I'm glad to hear that about the piholes.

I have been monitoring all three of my active feeds over the past 3 days and I have observed two distinct issues. For whatever reason Issue #1 only happened a few times before I began seeing issue #2 exclusively. I'm going to describe issue #1 here just in case it could be useful in diagnosing issue #2 (the current issue).

Issue #1:
The first issue is where the feed in question was updating with new data points every 60 seconds, these data points were displayed on both the feed itself and the line graph on that feed page, yet the blocks on the dashboards related to that feed show data that stops at a random point in time. If I leave the webpage to the dashboard open, it begins populating with new data points again. But when I refresh that page, all the new data that has come in since first opening the page disappears, and it reverts to displaying the same old data points as before, stopping at the same data point it stopped at before.

Issue #2, (Current issue):
The second of the two issues, and the one that I am currently experiencing, is where the feeds themselves appear to stop receiving new data points altogether. The only way I have found to get the data flowing again is to reboot the pi's. This is happening on two different raspberry pi zero W's, both fully updated, running the newest version of Pi OS lite, and using the REST API for IO via python + blinka.

In order to rule out any issues with my code itself, I created another script using the example code from this guide:

https://learn.adafruit.com/adafruit-io- ... ython-code

The only changes I made was to add my API key and username, as well as changing the sleep time to 60 seconds.

This test script ran fine for a short period of time before displaying the same issue as both of my other scripts (Issue #2 above).

If there are any other tests I can do or any other info that would be helpful just let me know.

csn495
 
Posts: 3
Joined: Sun Sep 12, 2021 10:52 am

Please be positive and constructive with your questions and comments.