Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 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

SQL dayfile data Viewer

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
PaulMy
Posts: 3775
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: SQL dayfile data Viewer

Post by PaulMy »

Hi Kocher,
I changed my webserver at GoDaddy to cPanel a couple weeks ago and that included changing my MySQL database. Everything seemed to have worked eventually, except that http://www.komokaweather.com/mysql/dayf ... le-sql.php only goes back to Dec 10. The previous database Dayfile table has data up to Dec 10. The new database Dayfile table is populated to current (Dec 18) so it appears the script is looking in the old database Dayfile table. I've looked in the various files that make up dayfile-sql but have not found where I might need to edit. Any suggestion?

Thanks,
Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm

Image
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: SQL dayfile data Viewer

Post by sfws »

Paul
In server_processing.php, presumably you have changed the database reference in this code found near the end of that file?

Code: Select all

// SQL server connection information
$sql_details = array(
	'user' => $dbuser,
	'pass' => $dbpassword,
	'db'   => theDatabase,
	'host' => $dbhost
);
I'm busy doing a massive rewrite of my METAR decoder to try to speed it up at the moment, so I have not looked through other scripts making up dayfile-sql but I think this is what you were unable to find. I did notice on your page that a couple of entries in the summary line are not showing figures, I solved that when I implemented the dayfile-sql script on my PC, I think it was something to do with whether units are added or not, but I can't recall exactly. Maybe I will have a look later.

I note that the download in the first post of this thread is no longer available, but fortuently I use the script so have it on my PC.
This is my 350th post, I hope that means I have made a small but significant contribution to the community on this forum!
User avatar
PaulMy
Posts: 3775
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: SQL dayfile data Viewer

Post by PaulMy »

Paul
In server_processing.php, presumably you have changed the database reference in this code found near the end of that file?
Thanks sfws, I had not gone in that folder or file. After editing now the table shows to current http://www.komokaweather.com/mysql/dayf ... le-sql.php.

Enjoy,
Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm

Image
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: SQL dayfile data Viewer

Post by sfws »

Paul
I have now checked, and find I amended "dayfile-sql.???" file where the original had

Code: Select all

 "footerCallback": function ( row, data, start, end, display ) {
            var api = this.api(), data; 
            // Remove the formatting to get integer data for summation
            var intVal = function ( i ) {
                return typeof i === 'string' ?
                    i.replace(/[\mm,\Km,\hPa,]/g, '')*1 :
                    typeof i === 'number' ?
                        i : 0;
            };
My amendment was to add to the list of units in line 255 so it also included the units for the columns where the max/min/average/total was not appearing. From a very quick inspection, it appears that is all I changed to add the missing figures to my footer, the equivalent of your
Date -19.5 °C 34.0 °C 12.2 °C 263.0 mm Bmin Bmax Wgust 5827 Km
Put as simply as I can that is a pattern replacement instruction within the demiiters, it looks for any one of the expressions separated by a comma in the square brackets and replaces it by an empty string (delimited by the pair of single quotes). I'm very new to pattern specifying and had to look up the significance of the 'g' flag for javascript, apparently it gives the expression a global applicability.
If I am correct, then you are missing the \hPa and \km/H units (or for you latter is Km/h apparently). You may have problems with '/' as it appears that character is used as start and end delimiter outside the square brackets. I believe you also need to escape the '/' i.e. '//'. As I said, I am a novice with these expressions, and just starting to learn the PERL ones used with PHP, and the javascript ones might be different.

It is possible I also amended the code snippet dealing with reading from the database and adding the figures to the table but I can't at a quick glance see any other relevant changes.
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: SQL dayfile data Viewer

Post by kocher »

Greetings to all.

The download link for this script is already working again:

    http://kocher.es/cajon/DataTables-cumulus-dayfile.rar

You can see the installation instructions at:

          https://cumulus.hosiene.co.uk/viewtopic.p ... 83#p122552


Saludos desde San Sebastian :D
Image
User avatar
vpokroglo
Posts: 101
Joined: Thu 24 Feb 2011 7:45 pm
Weather Station: WS-2350
Operating System: Raspberry Pi 2
Location: Slovenija
Contact:

Re: SQL dayfile data Viewer

Post by vpokroglo »

Great script!
Do anyone know some script to show data from monthly files- monthly mysql?
Image
User avatar
vpokroglo
Posts: 101
Joined: Thu 24 Feb 2011 7:45 pm
Weather Station: WS-2350
Operating System: Raspberry Pi 2
Location: Slovenija
Contact:

Re: SQL dayfile data Viewer

Post by vpokroglo »

What does the bottom line (circled-red color) show?
Image
Image
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: SQL dayfile data Viewer

Post by sfws »

sfws wrote:where the max/min/average/total was
What you ringed in red is supposed to show summary for column. I have just quoted an extract from my earlier post where I mention for my own version I tried to sort out that output line. I will leave it to the author of the script to add any further comment.
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: SQL dayfile data Viewer

Post by kocher »

Effectively

The foot of the table, contains the summary of each column after conducting a search;

1): Get the minimum temperature of all filtered dates
2): Get the maximum temperature all of the filtered dates.
3): Get the mean value of the average temperature of all the filtered dates.
4): Obtain the sum of the precipitation of the filtered dates.

And so on: Minimum pressure, Maximum pressure, Maximum windgust and the Total kilometers traveled by the wind:


http://kocher.es/central.php

Saludos desde San Sebastian, Spain
Image
User avatar
vpokroglo
Posts: 101
Joined: Thu 24 Feb 2011 7:45 pm
Weather Station: WS-2350
Operating System: Raspberry Pi 2
Location: Slovenija
Contact:

Re: SQL dayfile data Viewer

Post by vpokroglo »

kocher wrote:Effectively

The foot of the table, contains the summary of each column after conducting a search;

1): Get the minimum temperature of all filtered dates
2): Get the maximum temperature all of the filtered dates.
3): Get the mean value of the average temperature of all the filtered dates.
4): Obtain the sum of the precipitation of the filtered dates.

And so on: Minimum pressure, Maximum pressure, Maximum windgust and the Total kilometers traveled by the wind:


http://kocher.es/central.php

Saludos desde San Sebastian, Spain

I am not sure if this is correct,

If I set filter to 2017 (year only), I get different values when scrolling down, so data shown in the bottom row is unusable in this way.
If I set year and month, it is OK.
Image
User avatar
ConligWX
Posts: 1570
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: SQL dayfile data Viewer

Post by ConligWX »

Does anyone have the full archive handy to download? links provided are dead.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: SQL dayfile data Viewer

Post by kocher »

I am sorry

The link is now active again:

http://kocher.es/cajon/DataTables-cumulus-dayfile.rar
Image
typiod
Posts: 12
Joined: Thu 21 Sep 2017 9:21 pm
Weather Station: aercus WS2083
Operating System: RPI stretch

Re: SQL dayfile data Viewer

Post by typiod »

Hi any chance of a working link to the file thanks.
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: SQL dayfile data Viewer

Post by dazza1223 »

i cant zip one up for you
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
typiod
Posts: 12
Joined: Thu 21 Sep 2017 9:21 pm
Weather Station: aercus WS2083
Operating System: RPI stretch

Re: SQL dayfile data Viewer

Post by typiod »

Hello dazza that would be great if you could.
Post Reply