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

Error in processed cumuluswebtags.php

Discussion and questions about Cumulus weather station software version 1. This section is the main place to get help with Cumulus 1 software developed by Steve Loft that ceased development in November 2014.
Post Reply
ninendal
Posts: 14
Joined: Sun 04 Jul 2010 7:29 pm
Weather Station: Davis vantage pro2
Operating System: Windows 7

Error in processed cumuluswebtags.php

Post by ninendal »

Hi,

With the latest versions of Cumuluswebtags.txt the processed PHP file gives an error;

Parse error: syntax error, unexpected ',' in /../cumuluswebtags.php on line 48

I had to go back to a couple versions ago to actually process and read the PHP file. For some reasons somethings changed with the interpretation with "," Or am I missing the big picture here?


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

Re: Error in processed cumuluswebtags.php

Post by mcrossley »

I think we'd need to see a copy of line 48 (and a few surrounding lines) to see what the problem is.
ninendal
Posts: 14
Joined: Sun 04 Jul 2010 7:29 pm
Weather Station: Davis vantage pro2
Operating System: Windows 7

Re: Error in processed cumuluswebtags.php

Post by ninendal »

mcrossley wrote:I think we'd need to see a copy of line 48 (and a few surrounding lines) to see what the problem is.
Hi, not able to reproduce this atm. I was wondering if this was usable to get some more info then the realtime.txt file and reuse it on my site in combination with some ajax rotation. I didn't succeed in it. Now searching for other ways ;)
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Error in processed cumuluswebtags.php

Post by beteljuice »

I was wondering if this was usable to get some more info then the realtime.txt file and reuse it on my site in combination with some ajax rotation.
That's its entire purpose !
Image
......................Imagine, what you will KNOW tomorrow !
ninendal
Posts: 14
Joined: Sun 04 Jul 2010 7:29 pm
Weather Station: Davis vantage pro2
Operating System: Windows 7

Re: Error in processed cumuluswebtags.php

Post by ninendal »

mcrossley wrote:I think we'd need to see a copy of line 48 (and a few surrounding lines) to see what the problem is.
Hi Marc,

This is the output of the processed file. The error is Parse error: syntax error, unexpected ',' in /../cumuluswebtags.php on line 52

50 # List of all Cumulus web tags assigned as PHP variables
51 $AllocatedMemory='98,99 MB';
52 $altimeterpressure=1022,59;
53 $altitude='2 m';
..$apptemp=16,8;
..$apptempH=20,7;
..$apptempL=2,2;
..$apptempTH=19,8;
..$apptempTL=4,4;
..$apptempYH=13,0;
..$apptempYL=3,5;
..$avgbearing=243;
..$avgtemp=12,3;
..$avgtempY=9,8;
..$battery='4,75v'; // does not apply to all weather station types
..$bearing=229;
..$BearingRangeFrom=99;
..$BearingRangeFrom10=090;
..$BearingRangeTo=12;
..$BearingRangeTo10=020;
..$bearingTM=289;
..$bearingYM=53;
..$beaudesc='zwakke wind';
..$beaufort='F2';
..$beaufortnumber=2;
..$build=1099;

This is a snippet from the original text file;

# List of all Cumulus web tags assigned as PHP variables
$AllocatedMemory='<#AllocatedMemory>';
$altimeterpressure=<#altimeterpressure>;
$altitude='<#altitude>';
$apptemp=<#apptemp>;
$apptempH=<#apptempH>;
$apptempL=<#apptempL>;

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

Re: Error in processed cumuluswebtags.php

Post by mcrossley »

OK, so you cannot use a comma as a decimal in PHP, so you will have to make all he values strings rather than numeric by enclosing them in quotes...
$altimeterpressure='<#altimeterpressure>';

You will then be able to print them out to a web page, but if you want to manipulate the value you will have to it into a 'dot' decimal...
$altimeterpressure=str_replace(',','.','<#altimeterpressure>');
ninendal
Posts: 14
Joined: Sun 04 Jul 2010 7:29 pm
Weather Station: Davis vantage pro2
Operating System: Windows 7

Re: Error in processed cumuluswebtags.php

Post by ninendal »

mcrossley wrote:OK, so you cannot use a comma as a decimal in PHP, so you will have to make all he values strings rather than numeric by enclosing them in quotes...
$altimeterpressure='<#altimeterpressure>';

You will then be able to print them out to a web page, but if you want to manipulate the value you will have to it into a 'dot' decimal...
$altimeterpressure=str_replace(',','.','<#altimeterpressure>');
Thx Mark :D
Post Reply