Page 1 of 1

Recent history webtags

Posted: Tue 11 Jun 2019 1:07 pm
by Matt.j5b
I am experiencing a problem using the recent history webtags in a table for the last 72hrs on my website. On my website this is very obvious in that each tag with a different time parameter reports the same time and data. I have triple checked this and I can't see to figure what is happening. I have these webtags processed by Cumulus MX in my php webtags file, which gets uploaded to my web server. There are however are a lot of tags in the file, if that makes any difference.

Link: https://fernygroveweather.com/recent-observations.php

As an examples this is the webtags for fours rows of the table (after the first row of the table)

Code: Select all

$RecentTSM30		=	'<#RecentTS m=31 format="d/MM h:mm tt">';
$RecentOutsideTempM30	=	'<#RecentOutsideTemp m=31>';
$RecentDewPointM30		=	'<#RecentDewPoint m=31>';
$RecentHumidityM30		=	'<#RecentHumidity m=31>';
$RecentWindAvgBearingM30	=   '<#RecentWindAvgDir m=31>';
$RecentWindSpeedM30		=	'<#RecentWindSpeed m=31>';
$RecentWindGustM30		=	'<#RecentWindGust m=31>';
$RecentPressureM30		=	'<#RecentPressure m=31>';
$RecentRainTodayM30	=	'<#RecentRainToday m=31>';

$RecentTSH1			=	'<#RecentTS h=1 m=1 format="d/MM h:mm tt">';
$RecentOutsideTempH1	=	'<#RecentOutsideTemp h=1 m=1>';
$RecentDewPointH1		=	'<#RecentDewPoint h=1 m=1>';
$RecentHumidityH1		=	'<#RecentHumidity h=1 m=1>';
$RecentWindAvgBearingH1 =   '<#RecentWindAvgDir h=1 m=1>';
$RecentWindSpeedH1		=	'<#RecentWindSpeed h=1 m=1>';
$RecentWindGustH1		=	'<#RecentWindGust h=1 m=1>';
$RecentPressureH1		=	'<#RecentPressure h=1 m=1>';
$RecentRainTodayH1		=	'<#RecentRainToday h=1 m=1>';

$RecentTSH1M30				=	'<#RecentTS h=1 m=31 format="d/MM h:mm tt">';
$RecentOutsideTempH1M30		=	'<#RecentOutsideTemp h=1 m=31>';
$RecentDewPointH1M30		=	'<#RecentDewPoint h=1 m=31>';
$RecentHumidityH1M30		=	'<#RecentHumidity h=1 m=31>';
$RecentWindAvgBearingH1M30		=   '<#RecentWindAvgDir h=1 m=31>';
$RecentWindSpeedH1M30		=	'<#RecentWindSpeed h=1 m=31>';
$RecentWindGustH1M30		=	'<#RecentWindGust h=1 m=31>';
$RecentPressureH1M30		=	'<#RecentPressure h=1 m=31>';
$RecentRainTodayH1M30		=	'<#RecentRainToday h=1 m=31>';

$RecentTSH2				=	'<#RecentTS h=2 m=1 format="d/MM h:mm tt">';
$RecentOutsideTempH2	=	'<#RecentOutsideTemp h=2 m=1>';
$RecentDewPointH2		=	'<#RecentDewPoint h=2 m=1>';
$RecentHumidityH2		=	'<#RecentHumidity h=2 m=1>';
$RecentWindAvgBearingH2		=   '<#RecentWindAvgDir h=2 m=1>';
$RecentWindSpeedH2		=	'<#RecentWindSpeed h=2 m=1>';
$RecentWindGustH2		=	'<#RecentWindGust h=2 m=1>';
$RecentPressureH2		=	'<#RecentPressure h=2 m=1>';
$RecentRainTodayH2		=	'<#RecentRainToday h=2 m=1>';
And after the webtags are processed:

Code: Select all

$RecentTSM30				=	'11/06 11:00 pm';
$RecentOutsideTempM30	=	'13.5';
$RecentDewPointM30		=	'10.7';
$RecentHumidityM30		=	'83';
$RecentWindAvgBearingM30	=   '0';
$RecentWindSpeedM30		=	'0';
$RecentWindGustM30		=	'0';
$RecentPressureM30		=	'1024.65';
$RecentRainTodayM30		=	'0.0';

$RecentTSH1				=	'11/06 11:00 pm';
$RecentOutsideTempH1	=	'13.5';
$RecentDewPointH1		=	'10.7';
$RecentHumidityH1		=	'83';
$RecentWindAvgBearingH1	=   '0';
$RecentWindSpeedH1		=	'0';
$RecentWindGustH1		=	'0';
$RecentPressureH1		=	'1024.65';
$RecentRainTodayH1		=	'0.0';

$RecentTSH1M30				=	'11/06 11:00 pm';
$RecentOutsideTempH1M30		=	'13.5';
$RecentDewPointH1M30		=	'10.7';
$RecentHumidityH1M30		=	'83';
$RecentWindAvgBearingH1M30		=   '0';
$RecentWindSpeedH1M30		=	'0';
$RecentWindGustH1M30		=	'0';
$RecentPressureH1M30		=	'1024.65';
$RecentRainTodayH1M30		=	'0.0';

$RecentTSH2				=	'11/06 11:00 pm';
$RecentOutsideTempH2	=	'13.5';
$RecentDewPointH2		=	'10.7';
$RecentHumidityH2		=	'83';
$RecentWindAvgBearingH2		=   '0';
$RecentWindSpeedH2		=	'0';
$RecentWindGustH2		=	'0';
$RecentPressureH2		=	'1024.65';
$RecentRainTodayH2		=	'0.0';
Edit: And it now seems to working after a Cumulus MX restart and tweaking the extra file settings. I had the same file processed twice, which might have caused an issue (with one for the website and the other locally on XAMPP).

Re: Recent history webtags

Posted: Sat 15 Jun 2019 1:00 pm
by Matt.j5b
This issue has been happening again in the same way as previously described. I have found that most of the time the webtags are not returning the correct data. The most recent tags often work correctly much of the time but all the webtags are more than 1 hour ago return the same data. However sometimes it does work properly. However I can't figure out what is causing this. Any ideas?

Re: Recent history webtags

Posted: Mon 17 Jun 2019 11:00 am
by mcrossley
I'll have a look and see if I can spot anything...

Re: Recent history webtags

Posted: Mon 17 Jun 2019 11:24 am
by mcrossley
OK, I tried using this file...

Code: Select all

m=11: <#RecentTS m=11 format="d/MM h:mm tt">
m=21: <#RecentTS m=21 format="d/MM h:mm tt">
m=31: <#RecentTS m=31 format="d/MM h:mm tt">
m=41: <#RecentTS m=41 format="d/MM h:mm tt">
m=51: <#RecentTS m=51 format="d/MM h:mm tt">
m=61: <#RecentTS m=61 format="d/MM h:mm tt">
h=1,m=1: <#RecentTS h=1 m=1 format="d/MM h:mm tt">
h=1,m=11: <#RecentTS h=1 m=11 format="d/MM h:mm tt">
h=1,m=21: <#RecentTS h=1 m=21 format="d/MM h:mm tt">
h=2,m=1: <#RecentTS h=2 m=1 format="d/MM h:mm tt">
and the output was...

Code: Select all

m=11: 17/06 12:10 PM
m=21: 17/06 12:10 PM
m=31: 17/06 11:57 AM
m=41: 17/06 11:47 AM
m=51: 17/06 11:37 AM
m=61: 17/06 11:27 AM
h=1,m=1: 17/06 11:27 AM
h=1,m=11: 17/06 11:17 AM
h=1,m=21: 17/06 11:07 AM
h=2,m=1: 17/06 10:27 AM
Which allowing for logger intervals and that I just restarted MX looks OK to me. I'll leave it running for an hour and see what happens...

Re: Recent history webtags

Posted: Mon 17 Jun 2019 11:56 am
by Matt.j5b
Thanks for looking at this.

That output looks fine but is different to what I get. Using the same tags as your test I get:

Code: Select all

17/06 9:45 pm
17/06 9:35 pm
17/06 9:25 pm
17/06 9:15 pm
17/06 9:05 pm
17/06 9:00 pm
17/06 9:00 pm
17/06 9:00 pm
17/06 9:00 pm
17/06 9:00 pm
What had found is when I restarted MX, it worked correctly for each tag and the next day it had stopped working after working well for at least a few hours.

Re: Recent history webtags

Posted: Mon 17 Jun 2019 1:00 pm
by mcrossley
The way it works internally is to convert the "d,h,m" into minutes, subtract that from the current date/time, then perform a query with the result on the internal MX database like this..

Code: Select all

select * from RecentData where Timestamp >= ? order by Timestamp limit 1
Where the "minutes ago" date/time is substituted for the "?"
So it should return the oldest record greater than or equal to the requested "minutes ago"
What you are seeing implies that either the database is empty, or the timestamps are incorrect for some reason.

EDIT: Has this ever worked for you?

Re: Recent history webtags

Posted: Mon 17 Jun 2019 1:15 pm
by Matt.j5b
Thanks for the information.

I have only been using these for the last fortnight. I did previously give the tags a play quite a while ago with Cumulus 1 on Windows without trouble, though I only defined the number of minutes and didn't define any days or hours. I am now running MX on a pi but not with the same success using these web tags.

Re: Recent history webtags

Posted: Tue 18 Jun 2019 3:27 pm
by mcrossley
Can you post a zip of mxdiags folder please.

Re: Recent history webtags

Posted: Tue 18 Jun 2019 9:02 pm
by Matt.j5b
Please find mxdiags attached. Thanks for this assistance.

Re: Recent history webtags

Posted: Fri 28 Jun 2019 10:18 am
by mcrossley
I can't see anything there apart from when you had a badly formed web tag that prevent the page being processed correctly, but it looks like you corrected that?

Re: Recent history webtags

Posted: Fri 28 Jun 2019 10:51 am
by Matt.j5b
The webtags are working correctly now after a Raspbian update and restart. However I not sure how this actually happened.