Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.5 (build 3282) - 23 February 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

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 drop-down menus to 2030)

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

Saratoga templates and 3191-3194

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
bduren
Posts: 39
Joined: Tue 21 Jul 2009 8:43 am
Weather Station: WMR928
Operating System: W2012R2, W10, RaspberryPI 3+
Location: Sweden
Contact:

Saratoga templates and 3191-3194

Post by bduren »

Hello
I am using Saratoga templates for my Cumulus website since long time. Everything was working great up to build 3190.
Upgrading to 3191 or 3194 made the web "not finish" loading made it impossible to change menu.
I had to go back to 3190.
I´d like to know if anyone has an idea what may have changed to make this happen

Have a great day.

Cumulus working website https://bastadvader.duren.se
User avatar
saratogaWX
Posts: 1169
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: Saratoga templates and 3191-3194

Post by saratogaWX »

Looking at https://bastadvader.duren.se/check-fetc ... w=versions shows you have some template updates to install. Likely the cause of your issue with 3191+ was your very old CU-defs.php from 2013 -- there was an update in 2020 for that.

Try updating your website with the recommended script updates, then 3191-3194 should work just fine. It's working with my test site at https://cumulusmx.saratoga-weather.org/

Regards,
Ken
bduren
Posts: 39
Joined: Tue 21 Jul 2009 8:43 am
Weather Station: WMR928
Operating System: W2012R2, W10, RaspberryPI 3+
Location: Sweden
Contact:

Re: Saratoga templates and 3191-3194

Post by bduren »

Oops !!
It seems I have some work to do.
Thanks for letting me know.

Be back with the results.
Probably with your skills it will.
bduren
Posts: 39
Joined: Tue 21 Jul 2009 8:43 am
Weather Station: WMR928
Operating System: W2012R2, W10, RaspberryPI 3+
Location: Sweden
Contact:

Re: Saratoga templates and 3191-3194

Post by bduren »

So, it took a while to get things in order.
Maybe upgrade to PHP 8 next.
Thanks for the help.

https://bastadvader.duren.se
bduren
Posts: 39
Joined: Tue 21 Jul 2009 8:43 am
Weather Station: WMR928
Operating System: W2012R2, W10, RaspberryPI 3+
Location: Sweden
Contact:

Re: Saratoga templates and 3191-3194

Post by bduren »

Hello again
PHP 8.1 on webserver
Running CMX 3196 in Windows 10 with all PHP files up to date working great.
Running CMX 3196 in Raspberry not working with latest CU-Defs.php. I had to get back to previous version.
Webpage totally blank with new CU-defs.php.

Running CMX 3196 in Raspberry working with old CU-Defs.php.
With PHP error reporting set to on in webserver and old CU-defs.php gives error

*
Warning: A non-numeric value encountered in /customers/c/f/c/duren.se/httpd.www/cmx/CU-defs.php on line 81 Warning: A non-numeric value encountered in /customers/c/f/c/duren.se/httpd.www/cmx/CU-defs.php on line 81 Warning: A non-numeric value encountered in /customers/c/f/c/duren.se/httpd.www/cmx/CU-defs.php on line 82 Warning: A non-numeric value encountered in /customers/c/f/c/duren.se/httpd.www/cmx/CU-defs.php on line 82
*

Running CMX 3196 in Raspberry working with new CU-Defs.php. (blank screen)
With PHP error reporting set to on in webserver and new CU-defs.php gives error .
*
Warning: A non-numeric value encountered in /customers/c/f/c/duren.se/httpd.www/cmx/CU-defs.php on line 82 Warning: A non-numeric value encountered in /customers/c/f/c/duren.se/httpd.www/cmx/CU-defs.php on line 82 Warning: A non-numeric value encountered in /customers/c/f/c/duren.se/httpd.www/cmx/CU-defs.php on line 83 Warning: A non-numeric value encountered in /customers/c/f/c/duren.se/httpd.www/cmx/CU-defs.php on line 83 Warning: A non-numeric value encountered in /customers/c/f/c/duren.se/httpd.www/cmx/CU-defs.php on line 370 Fatal error: Uncaught DivisionByZeroError: Division by zero in /customers/c/f/c/duren.se/httpd.www/cmx/CU-defs.php:370 Stack trace: #0 /customers/c/f/c/duren.se/httpd.www/cmx/CUtags.php(747): include_once() #1 /customers/c/f/c/duren.se/httpd.www/cmx/top.php(81): include_once('/customers/c/f/...') #2 /customers/c/f/c/duren.se/httpd.www/cmx/index.php(37): include('/customers/c/f/...') #3 {main} thrown in /customers/c/f/c/duren.se/httpd.www/cmx/CU-defs.php on line 370
*
Windows 10 running Swediash language changed to decimal delimiter to full stop is working
Raspberry Running Swedish language with decimal delimiter decimal. I do not think I can change only decimal witout also change the date as well. Tried different changes to no avail.

Well, I am running out of ideas where to find my misconfiguration.

Windows working site https://bastadvader.duren.se
Raspberry working with old CU-Defs.php https://cmx.duren.se

I would be grateful for help in this matter.
broadstairs
Posts: 731
Joined: Thu 14 Aug 2008 7:17 am
Weather Station: Ecowitt GW1003/GW1103/GW2000
Operating System: Windows 7 and Linux
Location: Broadstairs, Kent, UK
Contact:

Re: Saratoga templates and 3191-3194

Post by broadstairs »

It would be a help if you posted the actual lines giving the errors in the CU-defs file as not everyone may have the same copy as yourself. I checked mine which works fine in linux but not sure if it is the same. It sounds to me like you may have an error in another file.

Stuart
bduren
Posts: 39
Joined: Tue 21 Jul 2009 8:43 am
Weather Station: WMR928
Operating System: W2012R2, W10, RaspberryPI 3+
Location: Sweden
Contact:

Re: Saratoga templates and 3191-3194

Post by bduren »

Coming up.
//Version CU-defs.php - V1.10 - 14-Jan-2013
Line 81-82
if(isset($WX['RecentDewPoint m=60'])){$dewchangelasthour=$WX['dew']-$WX['RecentDewPoint m=60'];} // conditional value
if(isset($WX['RecentPressure m=60'])){$barochangelasthour=$WX['press']-$WX['RecentPressure m=60'];} // conditional value

//Version CU-defs.php - V1.12 - 18-Jan-2022
Line 82-83
if(isset($WX['RecentDewPoint m=60'])){$dewchangelasthour=$WX['dew']-$WX['RecentDewPoint m=60'];} // conditional value
if(isset($WX['RecentPressure m=60'])){$barochangelasthour=$WX['press']-$WX['RecentPressure m=60'];} // conditional value

Line 370 WD ??
$burntime = (0.8/((3/7)*$VPuv))*60; # Weather-Display formula for burn time


CUtags.php (created by gen-CUtags.php - V1.07 - 02-Jan-2013)
Line 370
TapptempL|at 08:36 on 20 januari 2013:|:

Line 747
if(file_exists("CU-defs.php")) { include_once("CU-defs.php"); }

top.php
Line 81
include_once($SITE['WXtags']);

index.php
Line 37
include("top.php");

So there they are.
So same setup in Windows and in Rasp except for decimal point

Thanks for taking a look
User avatar
saratogaWX
Posts: 1169
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: Saratoga templates and 3191-3194

Post by saratogaWX »

If your CUtags.php is using decimal comma, it needs to be changed to decimal period format. PHP can't process (normally) arithmetic on decimal comma numbers. The template uses the Settings.php $SITE['commaDecimal'] = true; to handle conversions and reformat for display in the PHP pages, but the starting point is always decimal period formatted numbers.
bduren
Posts: 39
Joined: Tue 21 Jul 2009 8:43 am
Weather Station: WMR928
Operating System: W2012R2, W10, RaspberryPI 3+
Location: Sweden
Contact:

Re: Saratoga templates and 3191-3194

Post by bduren »

Thank you.
I did not know about that Decimal comma variable.
My finding after updating Settings.php is that

The error //Version CU-defs.php - V1.10 - 14-Jan-2013
Line 81-82
if(isset($WX['RecentDewPoint m=60'])){$dewchangelasthour=$WX['dew']-$WX['RecentDewPoint m=60'];} // conditional value
if(isset($WX['RecentPressure m=60'])){$barochangelasthour=$WX['press']-$WX['RecentPressure m=60'];} // conditional value
is still there and website is working (of course wxstatus wants me to upgrade CU-ddefs.php)
https://pi.duren.se

When using the newer //Version CU-defs.php - V1.12 - 18-Jan-2022
The screen is totally blank, no errors reported. UPDATE In chrome it was not in Edge needed empty cache)
https://cmx.duren.se
This is something beyond my understanding.

I should probably startup a new Raspberry and install it with en_US and get use to the formatting of the date.
I believe converting old files can take some time.

There should be a way to setup locale in Linux for date and numeric separately.
If there is I have not found it.

Thank you
User avatar
saratogaWX
Posts: 1169
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: Saratoga templates and 3191-3194

Post by saratogaWX »

Looking at https://pi.duren.se/CUtags.php?sce=dump shows

Code: Select all

$WX['temp'] = '15,9';
$WX['intemp'] = '23,3';
$WX['temptrend'] = '-1,3';
so the variables uploaded by Cumulus are in decimal comma format -- that is what causes the error in lines 82-83 as PHP can't do direct arithmetic with decimal comma numbers by default. You need to change to using decimal period for uploads from Cumulus to mitigate that error.

Looking at https://cmx.duren.se/CUtags.php?sce=dump shows the same decimal comma format for numbers, and so the expected errata on lines 82-83.

The Fatal error (divide by zero) in line 369-370 of CU-defs.php is in

Code: Select all

if(isset($VPuv) and $VPuv > 0.0) {
    $burntime = (0.8/((3/7)*$VPuv))*60; # Weather-Display formula for burn time
where earlier in CU-defs.php at line 103 is

Code: Select all

$VPuv = $WX['UV']; 
In CUtags.php?sce=dump, it shows that as

Code: Select all

$WX['UV'] = '0,0';
Again, the issue is using decimal comma for the uploaded data .. it has to be in decimal period format to work properly.
bduren
Posts: 39
Joined: Tue 21 Jul 2009 8:43 am
Weather Station: WMR928
Operating System: W2012R2, W10, RaspberryPI 3+
Location: Sweden
Contact:

Re: Saratoga templates and 3191-3194

Post by bduren »

Hello
Decimal comma yes. Is there a way to change that in Cumulus or is it just the system settings in Linux.
I have run CMX in Raspberry for years. With comma. Now after the latest updates >3190 and newer CU-Defs the issue is shown.
Or maybe the upgrade i did to PHP 8.1.

I would like to have decimal point together with date YYYY-MM-DD. :o

Thanks
User avatar
mcrossley
Posts: 12641
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Saratoga templates and 3191-3194

Post by mcrossley »

You would have to change your source tag file and add the parameter "rc=y" to all your decimal values.
e.g. <#temp rc=y>

For your date/times you can format them how you wish, you have to add a format parameter to the tags you want to change.
e.g. <#TtempH format="yyyy-MM-dd HH:mm">

See the documentation here: https://cumuluswiki.org/a/Webtags/Param ... parameters
User avatar
saratogaWX
Posts: 1169
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: Saratoga templates and 3191-3194

Post by saratogaWX »

So rather than reworking ALL the tags to be decimal period, try this V1.13 of CU-defs.php which should handle conversion of decimal comma to decimal period for arithmetic, then back to decimal comma.
You do not have the required permissions to view the files attached to this post.
User avatar
mcrossley
Posts: 12641
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Saratoga templates and 3191-3194

Post by mcrossley »

Sounds like a better solution, and the tags retain comma decimals is they are used elsewhere as text.
bduren
Posts: 39
Joined: Tue 21 Jul 2009 8:43 am
Weather Station: WMR928
Operating System: W2012R2, W10, RaspberryPI 3+
Location: Sweden
Contact:

Re: Saratoga templates and 3191-3194

Post by bduren »

Hello
Back after a short trip I updated my websites with the changed CU-defs.php.
And yes, the error was no more.
So now you have created a new CU-defs.php not depending of decimal comma or decimal point.

Thank you very much.
:D :D :D
Post Reply