I am running EmonCMS on a Pi 4 and I have a problem I cannot seem to find an answer to. And I am running a system at home and at my work and both have the same problem.
At work I have presently have one data source which is ESP8266 with a BME280 environment sensor. Right now I am sending data every 10 seconds and graphing every minute for temperature, pressure and humidity and the data looks fine.
While doing this the ESP8266 also queries a time server and at the end of each day (midnight) I send two more inputs, which is the average temperature for that day and the incremented days counter.
Then I create two feeds and for each one using the Engine “Emoncms Fixed Interval time series” and I set the “Select interval” to 1d.
Is this correct because I do not always get data for both feeds. And sometimes I get data at a bizarre time.
So to conclude I can send data every 10 seconds and it is received perfectly but when I send data every 24 hours it is hit and miss.
Hello @MrGadget if you are looking at the data in the graph view, try selecting the interval there as daily:
Yes Trystan I did set it to 1d so thank you for confirming that.
And I just tried setting it to daily and nothing changed.
However, I also changed the program to send out data every minute. And for that to work I took out the condition to check for midnight. After running overnight it works perfectly. Continuous data, no missing points.
So somehow it must be my time check for midnight but I have already checked that a few times and it appeared to be OK.
I will focus more on this but if anyone has any suggestions I have uploaded my code.
The problem must be in the time server code and the decision of when to execute in bool endOfDayEvent(void *).
And and this is called about 3 times per hour using #include <arduino-timer.h>.
So I think the problem is either:
hours = timeClient.getHours();
or it must be this:
if ((hours == 00) && (midnightFlag == 0))
But I have spent time testing this and I do not see any issue with it.
EnvironmentCMS.txt (6.7 KB)