Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.4.6 (build 3070) - 23 March 2020
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

See the Wiki for downloading either version.

SOLVED: Recent History Tags question

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
sfws
Posts: 601
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Modified Fine Offset
Operating System: Win. 10 PC
Location: The Marches, UK

SOLVED: Recent History Tags question

Post by sfws » Thu 19 Mar 2020 4:19 pm

Are these same in Cumulus 1 and MX?

Will

Code: Select all

<#RecentPressure h=3 m=1> <#pressunit>
work for both?

I am trying MX, the windows command window is continually saying "webtag error".
The file created in MXdiags is not helping me understand what I need to change (short excerpt follows) nor which of my Cumulus template files is at fault.
Web tag error
Exception: i=91538 len=136856
inputText.Length=136856
token=<#RecentWindSpeed d=' . $j . '>
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at CumulusMX.Cumulus.TokenParserOnToken(String strToken, String& strReplacement)
at CumulusMX.TokenParser.Parse3()
Web tag error
Exception: i=91679 len=136856
inputText.Length=136856
token=<#RecentWindAvgDir d='
. $j . '>
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at CumulusMX.Cumulus.TokenParserOnToken(String strToken, String& strReplacement)
at CumulusMX.TokenParser.Parse3()
Web tag error
EDIT: Thread title updated
Last edited by sfws on Thu 19 Mar 2020 6:20 pm, edited 1 time in total.

water01
Posts: 1705
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: WH1081
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Recent History Tags question

Post by water01 » Thu 19 Mar 2020 4:45 pm

Think these have to change as per List of allowed modifiers in the https://cumuluswiki.org/a/Webtags Webtags part of the Wiki.

h I think has to be H and I think m has to be %M, but I haven't used them just interpreting the table.
David
Image

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

Re: Recent History Tags question

Post by mcrossley » Thu 19 Mar 2020 5:43 pm

No, they haven't changed. Those changed modifiers are for web tag "output" formatting. The tag parameters for input have not changed.

I think your problem is Cumulus is processing your file as-is, but you have variables embedded within the tag. So it is trying to process...

Code: Select all

<#RecentWindSpeed d=' . $j . '>
Rather than say...

Code: Select all

<#RecentWindSpeed d=1>

sfws
Posts: 601
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Modified Fine Offset
Operating System: Win. 10 PC
Location: The Marches, UK

Solved: Recent History Tags question

Post by sfws » Thu 19 Mar 2020 6:19 pm

mcrossley wrote:
Thu 19 Mar 2020 5:43 pm
No, they haven't changed. Those changed modifiers are for web tag "output" formatting. The tag parameters for input have not changed.
Thank you for confirming what I thought.
I have updated the Wiki to reflect this at https://cumuluswiki.org/a/Webtags#Recent_History.
mcrossley wrote:
Thu 19 Mar 2020 5:43 pm
you have variables embedded within the tag
No I don't, the original wiki text that Steve contributed said that Cumulus 1 handles these tags by replacing the input parameter with an array position. I assume that MX is using $j to signify that array position. I use the tags the way you say I should (see first post).

I have solved my problem now. One of my web pages (as I illustrated in another topic recently) shows the weather figures for each day in the last week. It not only shows the extremes, it also shows the equivalent of the "now" figures for the other days using Recent History web tags. The problem I have now spotted is for the earlier days it quotes the time using the (output) format "H:nn" that suits Cumulus 1. I will produce a new version of that web page for MX changing that to "H:mm".
sfws wrote:
Thu 19 Mar 2020 4:19 pm
The file created in MXdiags is not helping me understand what I need to change (short excerpt follows) nor which of my Cumulus template files is at fault.
Is there any way that you could improve the MXdiags output to specifically indicate which template file it was processing when it found the error? The Cumulus 1 diagnostics do say in which file they find any error they report. Or do I need to turn on some setting to see that level of detail from MX?

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

Re: Solved: Recent History Tags question

Post by mcrossley » Thu 19 Mar 2020 6:30 pm

sfws wrote:
Thu 19 Mar 2020 6:19 pm
mcrossley wrote:
Thu 19 Mar 2020 5:43 pm
you have variables embedded within the tag
No I don't, the original wiki text that Steve contributed said that Cumulus 1 handles these tags by replacing the input parameter with an array position. I assume that MX is using $j to signify that array position. I use the tags the way you say I should (see first post).
But the exception message in post shows that the tag is not in a valid format...

Code: Select all

token=<#RecentWindSpeed d=' . $j . '>
Cumulus expects a number after the "d=", you seem to have some PHP code, Cumulus cannot handle that. That file needs to be processed by PHP and output to another file for Cumulus to process.

sfws wrote:
Thu 19 Mar 2020 6:19 pm
Is there any way that you could improve the MXdiags output to specifically indicate which template file it was processing when it found the error? The Cumulus 1 diagnostics do say in which file they find any error they report. Or do I need to turn on some setting to see that level of detail from MX?
I'll look into it...

sfws
Posts: 601
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Modified Fine Offset
Operating System: Win. 10 PC
Location: The Marches, UK

Cumulus 1 seemed to work

Post by sfws » Thu 19 Mar 2020 6:57 pm

mcrossley wrote:
Thu 19 Mar 2020 6:30 pm
Cumulus expects a number after the "d=", you seem to have some PHP code, Cumulus cannot handle that. That file needs to be processed by PHP and output to another file for Cumulus to process
I now discover you are right. The page has each recent history tag spelt out for everything until it gets to "RecentWindSpeed ...", then you are right for some unknown reason I appeared to use PHP code to populate Cumulus web tags.

Strangely enough, Cumulus 1 did successfully process

Code: Select all

<?php
					for($j=1;$j < 7; $j++)
					{
							echo $tdArray[$j];
							echo '<#RecentWindSpeed d=' . $j . '> <#windunit> from <#RecentWindAvgDir d='
								. $j . '> &deg;<br>at <#RecentTS d=' . $j . ' format="h:nn am/pm"></td>';
					}
				?>
to give me different figures in each table cell so I never noticed that I had coded that row wrongly! But again in Steve Loft's original text for Recent History web tags he said the results were unpredictable if input parameters not specified. I have checked the figures it was generating against a correctly specified table row and the figures do not match!

I'm going back to Cumulus 1 for now, as my browser is saying page not found for "192.168.1.64.8998" which I thought was where I should see the user interface.

water01
Posts: 1705
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: WH1081
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: SOLVED: Recent History Tags question

Post by water01 » Thu 19 Mar 2020 7:26 pm

I'm going back to Cumulus 1 for now, as my browser is saying page not found for "192.168.1.64.8998" which I thought was where I should see the user interface.
Not necessarily as internal routers that use DHCP have a nasty habit of giving out a new IP address once a renewal is asked for. Log into your router and it will show you the IP address allocated to the CumulusMX computer our alternatively give your Computer a fixed address by finding the network card via Network and Sharing Centre (Control Panel), click on Change Adapter Settings, then Right click on Ethernet or WiFi Adapter, select Properties and in the window that opens right click on Internet Protocol Version 4 (TCP/IP 4), and select properties and in that Window tell the computer to "use the following IP address and fill it out (in your case 192.168.1.64, with a subnet mask of 255.255.255.0 and gateway address if either 192.168.1.1 or 192.168.1.254 depending on the address of your router).

Then with a fixed address 192.168.1.64:8998 will always wok in your browser.
David
Image

sfws
Posts: 601
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Modified Fine Offset
Operating System: Win. 10 PC
Location: The Marches, UK

Re: SOLVED: Recent History Tags question

Post by sfws » Thu 19 Mar 2020 8:07 pm

water01 wrote:
Thu 19 Mar 2020 7:26 pm
it will show you the IP address allocated to the CumulusMX computer

...
give your Computer a fixed address
I actually did exactly that. I looked at what provider calls the "Hub manager" and copied what IP address it showed for my PC into the place where the MX command panel has a "*". I have just done that again, and so double checked I had put in right numbers.

Thank you for your advice, and for spelling out what I should put where, I did that fix to the IP for my PC, and it appeared to disconnect my broadband totally. But that broadband is back now.

Anyway I closed Cumulus 1, and restarted MX. I still get "Server not found" when I type http://192.168.1.64.8998/.

water01
Posts: 1705
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: WH1081
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: SOLVED: Recent History Tags question

Post by water01 » Thu 19 Mar 2020 8:14 pm

If that is what you are typing that is what is wrong it should be http://192.168.1.64:8998/
Notice the : not the .
David
Image

sfws
Posts: 601
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Modified Fine Offset
Operating System: Win. 10 PC
Location: The Marches, UK

Re: SOLVED: Recent History Tags question

Post by sfws » Thu 19 Mar 2020 8:41 pm

Well spotted, I did type it wrong, I meant to put in colon but my fingers must have moved too low.

From my browser history, I see I did type it correctly earlier with the colon and I did then see "Server not found". so I don't know why that earlier attempt failed, but I am in now which is all that matters

THANK YOU VERY MUCH, as always you are very helpful

water01
Posts: 1705
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: WH1081
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: SOLVED: Recent History Tags question

Post by water01 » Thu 19 Mar 2020 9:05 pm

My pleasure, glad to be of help.
David
Image

sfws
Posts: 601
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Modified Fine Offset
Operating System: Win. 10 PC
Location: The Marches, UK

Re: SOLVED: Recent History Tags question

Post by sfws » Tue 24 Mar 2020 6:46 pm

Version 3.4.6 - Build 3070 is now available for download.
...
Additional diagnostics output in the console and log file for badly formed web tags

Thank you, Mark

I eliminated all web tag problems yesterday, thanks to your greatly improved diagnostics in this version. As a result I am now using MX by default, rather than Cumulus 1. The main issue I had when swapping between Cumulus "flavours", was ensuring I copied across files in "data" particularly "today.ini" whenever I swapped.

The final problems solved via this diagnostic were connected with inclusion of text in the output formats, MX allows escaping or quotes. I have experimented with both, I find it works best when using the single quotes method if these are including any spaces ("hh:mm' on 'd/MM" not "hh:mm 'on' d/mm"), although I'm not adding a new rule.

Just as happens other times when I learn something new from experience; I did update the Wiki web tag table dealing with output formats as I found specifying hour on its own did not work as specified in Steve original announcement, it is another single character issue. I hope the improved table will help others.

Post Reply