Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

CUtags.php

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

CUtags.php

Post by gluepack »

Sometimes, it is just the simplest things...
$SITE['WXtags'] = 'CUtags.php';
This setting specifies the filename of the Cumulus weather tags file. This file is uploaded through Cumulus and contains the current weather data associated with Cumulus HTML tags. The data is loaded in a $WX[] array with the Cumulus tag names used as the key to access the data in the associative array.
CUtags.php? Is this the typical cumuluswebtags.php file that is generated by Cumulus or is it some other file that should be generated for these templates? If it is the cumuluswebtags.php file, why not say that?
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: CUtags.php

Post by saratogaWX »

The CUtags.php file is not the same as the cumuluswebtags.php

The CUtags.php (with the companion CU-defs.php) provide the variable mapping needed for the Saratoga AJAX/PHP templates to run. The mapping is to $variables named as Weather-Display names them (since the templates started using Weather-Display). The weather station software Plugin set adapts the native tag naming to the naming needed for the template set.

The cumuluswebtags.php maps the Cumulus webtags to PHP variables with Cumulus names for the variables and will not work correctly with the Saratoga templates, but work fine in a custom-made website environment.

Best regards,
Ken
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: CUtags.php

Post by gluepack »

Thanks
NOTE: you may want to delete the following two lines from your chosen file:
wdirdata|<#wdirdata>:|:
wspddata|<#wspddata>:|:
as they result in a much larger CUtags.php file. They contain 3600 data points for
wind direction and wind speed which are not used by the templates. I recommend you
just delete those lines and save your FTP upload bandwidth.
Neither of the two lines appear in either file. There is a reference to them in a comment in the comments file, immediately prior to a "beaufort" oriented tag.
Oh, and, btw, the .txt template file (and the resulting .php) appear to be condensed (i.e. no eol's) as opposed to the .php file in the main directory, which is much more readable, apart from the fact that, ahhhhhh, it contains the two lines suggested for removal.
Check the Process? box.
Leave the Realtime? box unchecked.
Check the FTP? box.
Why is the Realtime? box unchecked?
and, btw, Cumulus doesn't support SFTP so the FTP? box shouldn't (necessarily) be checked.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: CUtags.php

Post by saratogaWX »

As I remember, I'd already deleted the two lines in the CUtags.txt/CUtags-comments.txt in the distribution, so they don't appear.
The comment was for folks who might add them later (as a caveat about the size and the 'not used by the template set').

The realtime box is unchecked for the CUtags since they are only needed once every 5 minutes, and are processed just before upload.

The FTP box is checked to make sure that Cumulus knows to upload the file to the website .. if unchecked, the website will not receive any updates (the file will only be available on the local disk).

Best regards,
Ken
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: CUtags.php

Post by gluepack »

the file will only be available on the local disk
which, as I implied, is all that is required when using SFTP.

ok, so I have done a barebones mod and set it up in the saratoga subdirectory on my website, which is where I place the CUtags file. I invoke it using http://www.jerbils.info/saratoga/wxindex.php

It starts fine (Chrome) and does at least one update but then, usually after 40+ seconds, I get "Updates paused - reload page to start". Firefox and IE are essentially the same.

At one stage, in Firefox, to restart, I just marquee selected the URL content and hit enter and I got...
Parse error: syntax error, unexpected $end, expecting T_VARIABLE or T_END_HEREDOC or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN in /misc/4/000/114/400/2/user/web/jerbils.info/saratoga/CUtags.php on line 364

I'll figure out the other problems, like why the thermometer doesn't display, but why does it "pause"? I did a search on here for "Updates paused" but there doesn't appear to be a resolution.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
BCJKiwi
Posts: 1259
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: CUtags.php

Post by BCJKiwi »

If you have errors in php, the site will not load properly.
I have just tried loading your site and it takes forever so is not loading properly.

You are not getting the thermometer as the graphic files cannot be found.
In Chrome, press F12 once the site loads and select console - I don't use Firefox so am not sure of the equivalent option but it should be on a menu somewhere in Firefox. Many of any errors you have will show up there.

The updates paused - reload page to start is what happens by default. To keep the 'realtime' data refreshing you need to change a setting in ajaxCUwx.js

Code: Select all

var reloadTime = 15000;       // reload AJAX conditions every x seconds (1 second = 1000 ms)
var maxupdates = 0;	          // Maximum Number of updates allowed (set to zero for unlimited)
                              // maxupdates * reloadTime / 1000 = number of seconds to update
change the reload time to suit the frequency of the realtime uploads.
There are a number of places you need to make configuration settings;
ajaxCUwx.js
settngs.php
settings-weather.php
are the main ones. Make sure all the directory settings match the names you have - all are case sensitive! - and that you have the right files in place to make everything work.
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: CUtags.php

Post by gluepack »

Oh, the site loads pretty quickly for me.

I have modified the maxupdates to 0 (the other param was at 5000 so I didn't bother) and I don't appear to get the message any longer. However, given the reLoad time of 5000, it seems strange that it gets to 30/40 secs before updating.

Thanks for the heads up re. the console. The first two things that come up are...
Failed to load resource: the server responded with a status of 404 (Not Found)
http://jerbils.info/saratoga/forecast/i ... _shwrs.jpg
Failed to load resource: the server responded with a status of 404 (Not Found)
http://jerbils.info/saratoga/forecast/i ... nshwrs.jpg
...and that is because they are supplied as gifs not jpgs. I guess I can sort that out, if I can find where they are referenced.

Ahhhh, now perhaps this is what you mean by taking some time to load as, after quite a while messages about the thermometer start to appear...
Resource interpreted as Image but transferred with MIME type text/html: "http://jerbils.info/saratoga/thermometer.php?t=15.8". ajaxCUwx.js:247
... and I can take a guess at that but I'll google it to confirm why it is occurring.
Actually, it is around this area but I don't have line numbers in notepad....
// this function will set an ID= to visible or hidden by setting the style="display: "
// from 'inline' or 'none'

var element = document.getElementById(name);
if (! element ) { return; }
if (onoroff) {
element.style.display='inline';
} else {
element.style.display='none';
}
}
I'm just guessing here but is that why the box for the thermometer disappears after a while and leaves just a blank space?

There are no other errors occurring.

As far as the other two files you mention are concerned, I thought I had modified them as per instructions on the Saratoga website before I uploaded them. I assumed, perhaps erroneously, that if I maintained the directory structure everything would be ok. I'll go through them again.

And... talking about directory structure... why does the forecast.rar contain the forecast directory, which in turn contains both forecast and images directories, the former including an identical images directory?
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: CUtags.php

Post by saratogaWX »

The problem with the thermometer display is related to the missing realtime.txt file

Your http://www.jerbils.info/saratoga/wxstatus.php page shows:
Cumulus realtime NOT Current unknown > 0:00:15 file not found
Your Settings-weather.php has

Code: Select all

$SITE['realtimefile']   = './realtime.txt';  // directory and name of Cumulus realtime.txt file
and should be

Code: Select all

$SITE['realtimefile']   = '../realtime.txt';  // directory and name of Cumulus realtime.txt file
since you are uploading your realtime.txt to the document root and not the ./saratoga/ directory where your template set resides.

When thermometer.php can load your realtime.txt, the thermometer will show correctly.

You may also need to adjust the Settings-weather entries of

Code: Select all

$SITE['graphImageDir']  = './images/';     // directory location for graph images with trailing /
#---------------------------------------------------------------------------
# For NOAA reports
$SITE['NOAAdir']        = './Reports/';   // relative location of the NOAA report files
for the relative locations of those directories on your site. These issues are caused by having your data from Cumulus not uploaded in the expected locations.

You can use http://www.jerbils.info/saratoga/check- ... ?show=info to display some checks about the template setup.
It currently shows
Directories/files status for Base-World, CU-Plugin

Status of needed subdirectories
Settings.php Cache file directory in $SITE['cacheFileDir']='./cache/' exists, with permissions=drwxr-xr-x [0755]
..Wrote 104 bytes to ./cache/test.txt successfully, then deleted test file. Cache directory is fully functional.
Settings.php ajax-images file directory in $SITE['imagesDir']='./ajax-images/' exists; and appears to have contents.
Settings.php forecast images file directory in $SITE['fcsticonsdir']='./forecast/images/' exists; and appears to have .gif image contents.
Settings-weather.php $SITE['graphImageDir']='./images/' is not on website. Set CU software to upload contents for proper template operation.
Settings-weather.php $SITE['NOAAdir']='./Reports/' is not on website. Set CU software to upload contents for proper template operation.
Likely, your $SITE['graphImageDir']='../images/'; would fix the graph display issue. I don't know if you are uploading NOAA reports, but
you should do that and fix the $SITE['NOAAdir'] entry to point to the relative file location of that directory.

As I'd said on my installation page for the templates
Note: As distributed, the template files are expected to be located in the document root of your website and the required subdirectories located below the document root. It is possible to use the templates from a subdirectory if the identical directory substructure is maintained and you continue to have URL and FILE relative addressing consistent (as it is now). You may be required to make additional changes that are not documented in the instructions if you wish to use the templates in a subdirectory.
and so far, all your issues are related to the installation in a subdirectory with the Cumulus files not also in the same directory.

Best regards,
Ken
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: CUtags.php

Post by gluepack »

Appreciate the patience in providing responses. It has cleaned up a lot. I'll continue working on it until it looks good enough to incorporate it into my existing website somehow.

I did waste a bit of time with meteoalarm, trying to get rid of Denmark, including deleting all the cache files, until I realised that a comment in one of the associated php files to "add" the appropriate URL statement to the settings.php file meant "replace" an existing one. So, mine was being overridden by the default one further down. One of the problems with working backwards, having seen that something isn't working to your satisfaction, as opposed to knowing up-front everything that is required.

One thing I hadn't realised was that, if you want graphs for example, you have to upload the Cumulus set, which is a pity as I was hoping that any templates I used created/maintained them server side to avoid having to ship all that data every time. I was hoping to get away with just CUtags.php. I'm even surprised, although I have done no analysis in that respect, that you use realtime.txt because I assumed any data in there would be included in CUtags.

Thanks again for your help.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: CUtags.php

Post by saratogaWX »

You're very welcome ;)

In the Cumulus, Configuration, Internet, Files panel, you can un-tick the 'Include Standard Files' and tick the 'Include Standard Images'.
That way, the graphs will be produced/uploaded, but the Standard HTML template files won't be uploaded (AFAIK) thereby saving some bandwidth.

For the Saratoga template, the only files that need routine uploads are:

CUtags.php (uploads at 5 minute intervals)
realtime.txt
./images/*.png (standard graphs, uploads at 5 minute intervals)
./Reports/NOAA*.txt (NOAA-style reports, uploaded once daily)

Yes, PHP does use the LAST occurrence of a variable definition as the one received by following code processing so replacement of a value in Settings.php/Settings-weather.php is the correct method to use.

The template set comes with a default/sample set of settings installed as examples of what goes where and to allow the function of the PHP website to work as a demo while you are customizing the settings for your particular location/weather station.

Don't forget to use the find-metar tool to get a nearby METAR to use for your conditions reporting -- you are currently using my nearby metar (KSJC) which likely does not reflect your conditions :)
It also gives a list to use in the wxmetar.php page for display of conditions at multiple nearby metar stations.

Best regards,
Ken
BCJKiwi
Posts: 1259
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: CUtags.php

Post by BCJKiwi »

Xpost with Ken's latest!

The idea of realtime.txt is that is has all the dynamic data and is uploaded by some every 5 secs (I upload every 15). This enable the ajax-dashboard via ajaxCUwx.js to refresh the changing data in 'realtime'

The CUtags are typically only loaded every 5, 10, or 15 minutes. This file is much bigger than realtime.txt.

So by this method, dynamic data is updated on the site in semi realtime whereas the slow changing and more bulky data is uploaded less often.

As to the graphs, they would normally be loaded at the same time as CUtags.
Alternatively (once you have everything working properly ;) ) you could look at some of the alternatives such as setting up SQL on the webserver and uploading data to that, and using highcharts or similar to generate the graphs from SQL.
Much info on this forum on these options.
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: CUtags.php

Post by gluepack »

Thanks.
you are currently using my nearby metar (KSJC) which likely does not reflect your conditions
I'm working my way through the screens. I noticed it but haven't had a chance to do anything yet.
In the Cumulus, Configuration, Internet, Files panel, you can un-tick the 'Include Standard Files' and tick the 'Include Standard Images'. That way, the graphs will be produced/uploaded, but the Standard HTML template files won't be uploaded (AFAIK) thereby saving some bandwidth.
The idea of realtime.txt is that is has all the dynamic data and is uploaded by some every 5 secs (I upload every 15). This enable the ajax-dashboard via ajaxCUwx.js to refresh the changing data in 'realtime'. The CUtags are typically only loaded every 5, 10, or 15 minutes. This file is much bigger than realtime.txt.
Remember, I have to use SFTP so I am uploading manually (well, invoking WinSCP as opposed to native Cumulus) so I have to specify each file that has to be shipped and, effectively, they are all shipped at the same time. I produce CUtags with realtime and cumuluswebtags every 60 seconds and upload them with WinSCP as they are produced. I don't really need to ship the last of those and only did so when I was considering writing my own scripts. The only reason I produce it is because I can't get the alarm to work so I test the lost sensor variable using Toolbox and send myself an email if there is a problem. Realtime and CUtags are less than 20k between them and could be sent every 5 seconds (about 10mb per month). So, that is what I will do.

Also, while looking through the "links" I see that there are scripts available to incorporate my WU graphs, so I will take that route.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
BCJKiwi
Posts: 1259
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: CUtags.php

Post by BCJKiwi »

You don't have to send them all at once.

What I have is two separate batch files to invoke the separate FTP sessions - one for daily files, and one for the tags and graphs.

under configuration - Internet Settings - Sites/Options - External Programs(bottom Left corner of screen) you will see 3 separate boxes;
Program - This fires on the 'FTP' timer
Realtime Program - This fires on the 'Realtime' Timer
Daily - This fires around midnight (timestamp on the webserver is midnight exactly??)

I have my FTP scripts in an FTP folder under Cumulus
in the left box I have the C:\cumulus\ftp\batchfilename.cmd and leave the Params box empty.

So you can send stuff via separate FTP scripts at those three separate times (one external program per timer but the external program could spawn more then one ftp script if required).
In my case I use cumulus to send the realtime and the tags but not the graphs
I use the separate FTP to send a subset of the graphs at the tag time and another to send the dayfile at night.
I also copy all the data at the same three intervals to a local test bed webserver on the local Lan using either the standard 'Files' timer or by adding additional copy commands to the batch files that do the FTP.
So with that in mind you can see the relevant settings I have in the internet settings screens images attached.

Sounds more complicated to describe than to action.
You do not have the required permissions to view the files attached to this post.
Post Reply