Hi,
My setup consists of an EmonPI + EmonTx. I’ve added an Arduino with Ethernet that measures temperature (+barometric pressure) and sends it to the EmonCMS API over HTTP every 10 seconds.
It’s been running for about 24 hours now and the temperature graph looks like this:
The screenshot was taken at 21:31, so there should have been data up till then. As you can see, there are several gaps in the graph.
What is kinda strange is that, at the time the screenshot was taken, the feed was last updated 9s ago. So there should be data in the feed. For some reason, it’s not showing in the graph.
So I dug a little further and, using the data.json API call, I polled for the data in feed 25 for the last 5 minutes. The result I got was even stranger. Sometimes the result is empty, sometimes it contains data. Whether or not there is data in the result seems to depend on the start parameter of the call.
First a successful call:
1526709337 = Sat May 19 05:55:37 UTC 2018 1526709637 = Sat May 19 06:00:37 UTC 2018 http://192.168.1.3/emoncms/feed/data.json?apikey=xxx&id=25&start=1526709337000&end=1526709637000&interval=10 [[1526709337000,20.10000038147],[1526709347000,20.10000038147],[1526709357000,20.10000038147],[1526709367000,20.10000038147],[1526709377000,20.10000038147],[1526709387000,20.10000038147],[1526709397000,20],[1526709407000,20.10000038147],[1526709417000,20.10000038147],[1526709427000,20.10000038147],[1526709437000,20.10000038147],[1526709447000,20.10000038147],[1526709457000,20.10000038147],[1526709467000,20.10000038147],[1526709477000,20.10000038147],[1526709487000,20.10000038147],[1526709497000,20.10000038147],[1526709507000,20.10000038147],[1526709517000,20.10000038147],[1526709527000,20.10000038147],[1526709537000,20.10000038147],[1526709547000,20.10000038147],[1526709557000,20.10000038147],[1526709567000,20.10000038147],[1526709577000,20.10000038147],[1526709587000,20.10000038147],[1526709597000,20.10000038147],[1526709607000,20.10000038147],[1526709617000,20.10000038147],[1526709627000,20.10000038147],[1526709637000,20.10000038147]]
Just one second later, an empty array is returned
1526709338 = Sat May 19 05:55:38 UTC 2018 1526709638 = Sat May 19 06:00:38 UTC 2018 http://192.168.1.3/emoncms/feed/data.json?apikey=xxx&id=25&start=1526709338000&end=1526709638000&interval=10 []
A few seconds later, still no data:
1526709341 = Sat May 19 05:55:41 UTC 2018 1526709641 = Sat May 19 06:00:41 UTC 2018 http://192.168.1.3/emoncms/feed/data.json?apikey=xxx&id=25&start=1526709341000&end=1526709641000&interval=10 []
Again no data…
1526709342 = Sat May 19 05:55:42 UTC 2018 1526709642 = Sat May 19 06:00:42 UTC 2018 http://192.168.1.3/emoncms/feed/data.json?apikey=xxx&id=25&start=1526709342000&end=1526709642000&interval=10 []
One second later: data!
1526709343 = Sat May 19 05:55:43 UTC 2018 1526709643 = Sat May 19 06:00:43 UTC 2018 http://192.168.1.3/emoncms/feed/data.json?apikey=xxx&id=25&start=1526709343000&end=1526709643000&interval=10 [[1526709343000,20.10000038147],[1526709353000,20.10000038147],[1526709363000,20.10000038147],[1526709373000,20.10000038147],[1526709383000,20.10000038147],[1526709393000,20],[1526709403000,20.10000038147],[1526709413000,20.10000038147],[1526709423000,20.10000038147],[1526709433000,20.10000038147],[1526709443000,20.10000038147],[1526709453000,20.10000038147],[1526709463000,20.10000038147],[1526709473000,20.10000038147],[1526709483000,20.10000038147],[1526709493000,20.10000038147],[1526709503000,20.10000038147],[1526709513000,20.10000038147],[1526709523000,20.10000038147],[1526709533000,20.10000038147],[1526709543000,20.10000038147],[1526709553000,20.10000038147],[1526709563000,20.10000038147],[1526709573000,20.10000038147],[1526709583000,20.10000038147],[1526709593000,20.10000038147],[1526709603000,20.10000038147],[1526709613000,20.10000038147],[1526709623000,20.10000038147],[1526709633000,20.10000038147]]
It is perfectly reproducible. The second but last and last call for exmaple:
wget -qO- “http://192.168.1.3/emoncms/feed/data.json?apikey=${APIREADKEY}&id=25&start=1526709342000&end=1526709642000&interval=10”; echo
wget -qO- “http://192.168.1.3/emoncms/feed/data.json?apikey=${APIREADKEY}&id=25&start=1526709343000&end=1526709643000&interval=10”; echo[[1526709343000,20.10000038147],[1526709353000,20.10000038147],[1526709363000,20.10000038147],[1526709373000,20.10000038147],[1526709383000,20.10000038147],[1526709393000,20],[1526709403000,20.10000038147],[1526709413000,20.10000038147],[1526709423000,20.10000038147],[1526709433000,20.10000038147],[1526709443000,20.10000038147],[1526709453000,20.10000038147],[1526709463000,20.10000038147],[1526709473000,20.10000038147],[1526709483000,20.10000038147],[1526709493000,20.10000038147],[1526709503000,20.10000038147],[1526709513000,20.10000038147],[1526709523000,20.10000038147],[1526709533000,20.10000038147],[1526709543000,20.10000038147],[1526709553000,20.10000038147],[1526709563000,20.10000038147],[1526709573000,20.10000038147],[1526709583000,20.10000038147],[1526709593000,20.10000038147],[1526709603000,20.10000038147],[1526709613000,20.10000038147],[1526709623000,20.10000038147],[1526709633000,20.10000038147],[1526709643000,20.10000038147],[1526709653000,20.10000038147]]
Let’s zoom in on the call that does not return data.
Changing the end parameter doesn’t seem to have any effect.
wget -qO- “http://192.168.1.3/emoncms/feed/data.json?apikey=${APIREADKEY}&id=25&start=1526709342000&end=1526709643000&interval=10”; echo
wget -qO- “http://192.168.1.3/emoncms/feed/data.json?apikey=${APIREADKEY}&id=25&start=1526709342000&end=1526709644000&interval=10”; echo
wget -qO- “http://192.168.1.3/emoncms/feed/data.json?apikey=${APIREADKEY}&id=25&start=1526709342000&end=1526709645000&interval=10”; echo
Changing the start parameter with one second seems to have an effect though.
wget -qO- “http://192.168.1.3/emoncms/feed/data.json?apikey=${APIREADKEY}&id=25&start=1526709342000&end=1526709642000&interval=10”; echo
wget -qO- “http://192.168.1.3/emoncms/feed/data.json?apikey=${APIREADKEY}&id=25&start=1526709343000&end=1526709642000&interval=10”; echo
[[1526709343000,20.10000038147],[1526709353000,20.10000038147],[1526709363000,20.10000038147],[1526709373000,20.10000038147],[1526709383000,20.10000038147],[1526709393000,20],[1526709403000,20.10000038147],[1526709413000,20.10000038147],[1526709423000,20.10000038147],[1526709433000,20.10000038147],[1526709443000,20.10000038147],[1526709453000,20.10000038147],[1526709463000,20.10000038147],[1526709473000,20.10000038147],[1526709483000,20.10000038147],[1526709493000,20.10000038147],[1526709503000,20.10000038147],[1526709513000,20.10000038147],[1526709523000,20.10000038147],[1526709533000,20.10000038147],[1526709543000,20.10000038147],[1526709553000,20.10000038147],[1526709563000,20.10000038147],[1526709573000,20.10000038147],[1526709583000,20.10000038147],[1526709593000,20.10000038147],[1526709603000,20.10000038147],[1526709613000,20.10000038147],[1526709623000,20.10000038147],[1526709633000,20.10000038147],[1526709643000,20.10000038147]]
Is there something wrong with my parameters?
Is it a bug?
Could this somehow be related to the gaps in the graph?