Page 1 of 1
SOLVED: Recent History Tags question
Posted: Thu 19 Mar 2020 4:19 pm
by sfws
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
Re: Recent History Tags question
Posted: Thu 19 Mar 2020 4:45 pm
by water01
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.
Re: Recent History Tags question
Posted: Thu 19 Mar 2020 5:43 pm
by mcrossley
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...
Rather than say...
Solved: Recent History Tags question
Posted: Thu 19 Mar 2020 6:19 pm
by sfws
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?
Re: Solved: Recent History Tags question
Posted: Thu 19 Mar 2020 6:30 pm
by mcrossley
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...
Cumulus 1 seemed to work
Posted: Thu 19 Mar 2020 6:57 pm
by sfws
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 . '> °<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.
Re: SOLVED: Recent History Tags question
Posted: Thu 19 Mar 2020 7:26 pm
by water01
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.
Re: SOLVED: Recent History Tags question
Posted: Thu 19 Mar 2020 8:07 pm
by sfws
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/.
Re: SOLVED: Recent History Tags question
Posted: Thu 19 Mar 2020 8:14 pm
by water01
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 .
Re: SOLVED: Recent History Tags question
Posted: Thu 19 Mar 2020 8:41 pm
by sfws
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
Re: SOLVED: Recent History Tags question
Posted: Thu 19 Mar 2020 9:05 pm
by water01
My pleasure, glad to be of help.