Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.6.5 (build 3081) - 28 May 2020 (please see important announcement regarding releases since 3.5.0)
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of the NOAA report and Snow Index drop-down menus to 2030)

See the Wiki to download the software or click on the Downloads link in the Forum Banner.

Recent history webtags

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
Matt.j5b
Posts: 471
Joined: Mon 28 Nov 2011 2:13 am
Weather Station: Davis VP2 with DFARS
Operating System: RPi Raspbian (Buster)
Location: Ferny Grove, Brisbane, Australia
Contact:

Recent history webtags

Post 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).
Regards, Matt of Brisbane, Australia
Ferny Grove Weather
Image

Matt.j5b
Posts: 471
Joined: Mon 28 Nov 2011 2:13 am
Weather Station: Davis VP2 with DFARS
Operating System: RPi Raspbian (Buster)
Location: Ferny Grove, Brisbane, Australia
Contact:

Re: Recent history webtags

Post 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?
Regards, Matt of Brisbane, Australia
Ferny Grove Weather
Image

User avatar
mcrossley
Posts: 6469
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Recent history webtags

Post by mcrossley »

I'll have a look and see if I can spot anything...

User avatar
mcrossley
Posts: 6469
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Recent history webtags

Post 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...

Matt.j5b
Posts: 471
Joined: Mon 28 Nov 2011 2:13 am
Weather Station: Davis VP2 with DFARS
Operating System: RPi Raspbian (Buster)
Location: Ferny Grove, Brisbane, Australia
Contact:

Re: Recent history webtags

Post 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.
Regards, Matt of Brisbane, Australia
Ferny Grove Weather
Image

User avatar
mcrossley
Posts: 6469
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Recent history webtags

Post 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?

Matt.j5b
Posts: 471
Joined: Mon 28 Nov 2011 2:13 am
Weather Station: Davis VP2 with DFARS
Operating System: RPi Raspbian (Buster)
Location: Ferny Grove, Brisbane, Australia
Contact:

Re: Recent history webtags

Post 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.
Regards, Matt of Brisbane, Australia
Ferny Grove Weather
Image

User avatar
mcrossley
Posts: 6469
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Recent history webtags

Post by mcrossley »

Can you post a zip of mxdiags folder please.

Matt.j5b
Posts: 471
Joined: Mon 28 Nov 2011 2:13 am
Weather Station: Davis VP2 with DFARS
Operating System: RPi Raspbian (Buster)
Location: Ferny Grove, Brisbane, Australia
Contact:

Re: Recent history webtags

Post by Matt.j5b »

Please find mxdiags attached. Thanks for this assistance.
You do not have the required permissions to view the files attached to this post.
Regards, Matt of Brisbane, Australia
Ferny Grove Weather
Image

User avatar
mcrossley
Posts: 6469
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Recent history webtags

Post 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?

Matt.j5b
Posts: 471
Joined: Mon 28 Nov 2011 2:13 am
Weather Station: Davis VP2 with DFARS
Operating System: RPi Raspbian (Buster)
Location: Ferny Grove, Brisbane, Australia
Contact:

Re: Recent history webtags

Post by Matt.j5b »

The webtags are working correctly now after a Raspbian update and restart. However I not sure how this actually happened.
Regards, Matt of Brisbane, Australia
Ferny Grove Weather
Image

Post Reply