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

graphWindRose.php

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

richard_newberry
Posts: 500
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Raspbian Bookworm & Debian 12
Location: Leicester
Contact:

graphWindRose.php

Post by richard_newberry »

I am getting the following error message when im accessing this link:-

http://desford-weather.co.uk/images/graphWindRose.php

When graphWindRose.php is uncommented in graphSettings.php the error message happens on all graph images.

Any ideas please?

Thanks.
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
freddie
Posts: 2870
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 24.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: graphWindRose.php

Post by freddie »

Comma after "AS time" in your SQL query?
Freddie
Image
Mapantz
Posts: 1992
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: graphWindRose.php

Post by Mapantz »

INTERVAL 24 HOUR ORDE'

*John Bercow voice*

ORDER
Image
richard_newberry
Posts: 500
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Raspbian Bookworm & Debian 12
Location: Leicester
Contact:

Re: graphWindRose.php

Post by richard_newberry »

the code is as follows in graphSettings.php

$query = "SELECT unix_timestamp(LogDateTime) AS time, $cols
FROM Realtime
WHERE LogDateTime >= now() - INTERVAL " .$GRAPH['hours']. " HOUR
ORDER BY time";

#include $GRAPH['jpgraphloc'] . 'jpgraph_windrose.php'; when I uncomment this out my graph images don't work and display the following message.

ERROR - Bad Select Statement: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM Realtime WHERE LogDateTime >= now() - INTERVAL 24 HOUR ORDE' at line 2

SELECT unix_timestamp(LogDateTime) AS time, FROM Realtime WHERE LogDateTime >= now() - INTERVAL 24 HOUR ORDER BY time

when I remove the after "AS Time, as advised this message occurs below

HTTP 500 error
That’s odd… the website can’t display this page
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
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: graphWindRose.php

Post by mcrossley »

Your SQL select is wrong, it is missing the column name..

Code: Select all

SELECT unix_timestamp(LogDateTime) AS time, FROM Realtime WHERE LogDateTime >= now() - INTERVAL 24 HOUR ORDER BY time
Should be...

Code: Select all

SELECT unix_timestamp(LogDateTime) AS time, bearing, wspeed FROM Realtime WHERE LogDateTime >= now() - INTERVAL 24 HOUR ORDER BY time
The columns are defined in graphWindRose.php at line 22...

Code: Select all

$w1 = get_data(array('bearing', 'wspeed'));
richard_newberry
Posts: 500
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Raspbian Bookworm & Debian 12
Location: Leicester
Contact:

Re: graphWindRose.php

Post by richard_newberry »

Thanks Mark,

Do I need ; at the end of the line $query = SELECT unix_timestamp(LogDateTime) AS time, bearing, wspeed FROM Realtime WHERE LogDateTime >= now() - INTERVAL 24 HOUR ORDER BY time

PHP Parse error: syntax error, unexpected 'unix_timestamp' (T_STRING) in /var/www/images/graphSettings.php on line 140

PHP Parse error: syntax error, unexpected ']', expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /var/www/images/graphSettings.php on line 151

line 151 is code:- $keys[] = $flds[$i]->name;

in file WindRose.php is this code ok now?

//fetch the data
$w1 = get_data(array('bearing', 'wspeed'));
$w2 = get_data('wind');

$datay = $w1['bearing'];
//$datay1 =$w2['wspeed'];
$datay1 =$w2['wgust'];

Any ideas cheers.
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
richard_newberry
Posts: 500
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Raspbian Bookworm & Debian 12
Location: Leicester
Contact:

Re: graphWindRose.php

Post by richard_newberry »

I am so close, http://desford-weather.co.uk/gauges-ss.htm

following errors in apache2/error.log

PHP Warning: Division by zero in /var/www/jpgraph/jpgraph_windrose.php on line 140

PHP Fatal error: Uncaught Error: Class 'WindroseGraph' not found in /var/www/jpgraph/jpgraph_windrose.php:149\nStack trace:\n#0 /var/www/images/graphSettings.php(42): include()\n#1 /var/www/images/graphSolar.php(14): require_once('/var/www/images...')\n#2 {main}\n thrown in /var/www/jpgraph/jpgraph_windrose.php on line 149

Invalid argument supplied for foreach() in /var/www/images/graphSettings.php on line 131, referer: http://desford-weather.co.uk/images/
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
richard_newberry
Posts: 500
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Raspbian Bookworm & Debian 12
Location: Leicester
Contact:

Re: graphWindRose.php

Post by richard_newberry »

I have included the files and the apache2 error file which could fix this problem?

I had to rename the jpgraph_windrose.php to txt because the extension isn't allowed on this forum.

please upload a fix if anyone knows how to fix the Windrose I would really would like to fix this problem.

I have no idea why the 2 temperature gauges have a ? before C

http://desford-weather.co.uk/gauges-ss.htm
You do not have the required permissions to view the files attached to this post.
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
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: graphWindRose.php

Post by beteljuice »

I have no idea why the 2 temperature gauges have a ? before C
At some point gauges.js has been edited and saved but NOT in UTF-8 format.

Best to get a fresh copy to edit ....

EDIT: Your posted jpgraph_windrose.php is nothing like what it should be :o
Image
......................Imagine, what you will KNOW tomorrow !
richard_newberry
Posts: 500
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Raspbian Bookworm & Debian 12
Location: Leicester
Contact:

Re: graphWindRose.php

Post by richard_newberry »

I copied it from Marks github site then pasted it.
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: graphWindRose.php

Post by sfws »

Yes but into what did you paste?

I am guessing it was not a file set up with UTF-8 encoding.
Use notepad++ or similar editor that lets you choose encoding before you paste in.
richard_newberry
Posts: 500
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Raspbian Bookworm & Debian 12
Location: Leicester
Contact:

Re: graphWindRose.php

Post by richard_newberry »

I used winscp on windows
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
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: graphWindRose.php

Post by beteljuice »

One thing at a time ...

Here's the correct jpgraph_windrose.php file.
jpgraph_windrose.zip
Note it is 'zipped', any file that is not a native .txt file or graphic you should zip before posting as an attachment
(Usually 'browse' your file folder, select, and <right-click> - send to ... zip)

I haven't got an 'unspoilt' gauges.js to donate - sorry :?

For editing files the weapon of choice is Notepad++
It will usually auto detect the script language, and the encoding (ANSI / UTF-8 etc.)
'Ordinary' notepad, or cut'n'paste from view-source can create all sorts of problems for the unwary - so always look for a zip download or 'raw' file (noting charset with the later)

If you still have problems will the degree symbol (after ensuring gauges.js is OK), then check the method it is being UPloaded to your web space.
You do not have the required permissions to view the files attached to this post.
Image
......................Imagine, what you will KNOW tomorrow !
richard_newberry
Posts: 500
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Raspbian Bookworm & Debian 12
Location: Leicester
Contact:

Re: graphWindRose.php

Post by richard_newberry »

Thank you
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
richard_newberry
Posts: 500
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Raspbian Bookworm & Debian 12
Location: Leicester
Contact:

Re: graphWindRose.php

Post by richard_newberry »

Hi beteljuice,

Thank you very much for sorting the jpgraph_windrose.php file out for me.

I have done the gauges.js and saved it under notepad++ as advised and it works thank you.

However now I have this problem.

I have Verdana.ttf under /var/www/jpgraph/fonts/ on permission 0644 like the other files in the folder.

Any idea, nearly there.
Desford Weather (at parents)
https://desford-weather.co.uk

Countesthorpe Weather (at mine)
https://countesthorpe-weather.co.uk
Post Reply