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 4018) - 28 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

Top 10 Records Page

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

Moderator: daj

User avatar
N0BGS
Posts: 205
Joined: Sat 10 Nov 2012 2:26 am
Weather Station: Davis Vantage Pro 2
Operating System: Win10vm,VMWare ESXi 7.0
Location: Hermon, Maine USA
Contact:

Re: Top 10 Records Page

Post by N0BGS »

Yes, I can DL the zip file.

Thanks!
Blitzortung Station 1809
User avatar
rogerthn
Posts: 489
Joined: Thu 11 Apr 2013 6:31 pm
Weather Station: Ecowitt GW1000/GW1003
Operating System: Raspberry Pi OS bullseye aarch64
Location: Trollhättan Sweden
Contact:

Re: Top 10 Records Page

Post by rogerthn »

mcrossley wrote:
N0BGS wrote: the source link returns a blank page.
--Kurt
Same here, response header = Content-Length: 0
No idea why but I guess that my php file shouldn't be used as it is.

Edit: Opera do show the source for me.
Image
User avatar
mikechristelow
Posts: 165
Joined: Wed 01 Feb 2012 9:33 pm
Weather Station: Watson W8681 (solar)
Operating System: Windows XP SP3
Location: Crewe, Cheshire
Contact:

Re: Top 10 Records Page

Post by mikechristelow »

Ha! Is this do-able with javascript?
http://www.christelow.co.uk
“It's snowing still," said Eeyore gloomily.
"So it is."
"And freezing."
"Is it?"
"Yes," said Eeyore. "However," he said, brightening up a little, "we haven't had an earthquake lately.”

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

Re: Top 10 Records Page

Post by mcrossley »

mikechristelow wrote:Ha! Is this do-able with javascript?
Sure, but it wouldn't be easy! :lol: You would have to download the dayfile.txt file and parse it in the browser to extract the data you want.
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Post by mcrossley »

Slight update to my page, I have added the highlighting of entries within the last 7 days, this month, or this year.

http://weather.wilmslowastro.com/top10s.php
Bridger
Posts: 60
Joined: Fri 01 Jun 2012 4:58 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 11 Home
Location: New Forest. UK
Contact:

Re: Top 10 Records Page

Post by Bridger »

I now have a Top10s page working on my local server - thanks for the code, Mark.
However, due to a transmitter battery failure in November when I was away from home (Sod's Law!) and a seized anemometer this time last year, some of the recorded data for these periods didn't change and is now filling up some of the Top 10 "Smallest" tables eg. Daily Temp Range, Daily Humidity Range, Lowest Max Wind Gust & Min Daily Wind Run. Screen shot attached.
Is there any way I can remove the relevant data in the log files for the affected days? Are spaces allowed in the data fields and if so, what effect might any changes have when writing to or reading from the SQL database?
Thanks .......... Peter
You do not have the required permissions to view the files attached to this post.
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Post by mcrossley »

Peter, I would have said that easiset way would be to set the relevant field values for those days to 'null', they will then be ignored by the queries. However the table structure I have inherited is such that the first 17 fields have a null values not allowed flag set. The affected fields are (excluding LogDate which has to be present) HighWindGust HWindGBear THWindG MinTemp TMinTemp MaxTemp TMaxTemp MinPress TMinPress MaxPress TMaxPress MaxRainRate TMaxRR TotRainFall AvgTemp TotWindRun

So if you have invalid data in any of those fields, I can only suggest that you change the table structure to allow nulls on the affected fields, then null out bad values.

To change a field to null, either use the phpMyAdmin console, or run the following command on each column (I have used TotWindRun as an example, you will have to get the data type for each affected column).

ALTER TABLE `TABLENAME` CHANGE `TotWindRun` `TotWindRun` DECIMAL( 5, 1 ) NULL
Bridger
Posts: 60
Joined: Fri 01 Jun 2012 4:58 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 11 Home
Location: New Forest. UK
Contact:

Re: Top 10 Records Page

Post by Bridger »

That seems to have worked a treat Mark, thanks. :clap:

While I am testing I am not using ImportCumulusFile on my local server - just imported my web database one time- so cannot check the dayfile upload yet.
I am not very familiar with SQL so this is probably a very basic question - Is it the case that, when the field is set to Null it will not be overwritten by the dayfile uploads?

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

Re: Top 10 Records Page

Post by mcrossley »

Only data for missing days will be inserted into the table. If you want to replace data you have to delete those rows before running the import again.
Richard Horton
Posts: 3
Joined: Sun 05 Jan 2014 2:10 pm
Weather Station: Fine Offset
Operating System: Windows 8.1
Location: Woodhall Spa, Lincolnshire
Contact:

Re: Top 10 Records Page

Post by Richard Horton »

Would love to add this to my site, Is there an idiots guide on how to do it, or have I missed one somewhere. Or just a few pointers

I'm quite happy faffing about with web stuff, but this one has left me stumbling around in the dark a bit

Cheers

Richard
Richard

If it ain't broke, you're not trying hard enough.

www.martin-weather.co.uk
weerstationmenaldum
Posts: 4
Joined: Mon 11 Nov 2013 8:19 pm
Weather Station: Davis vantage vue
Operating System: windows 7
Location: Menaldum

Re: Top 10 Records Page

Post by weerstationmenaldum »

I m also very interesting implanting this top10 script into my website.

Could someone please make guide?
Thanks :D
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Post by mcrossley »

I don't have a guide, but some pointers...

1. Setup your MySQL instance on your web server.
2. Schedule uploads of the dayfile to your web server.
3. Create the dayfile data SQL table and import your data from Cumulus using the PHP scripts in the Wiki
4. Schedule daily imports of the dayfile into MySQL on your web server.
5. Use the Top10 PHP script in this thread to create your new records page.

[6. Think of all the other possible things you can do with the data now you have it in an easily queried form!]
weerstationmenaldum
Posts: 4
Joined: Mon 11 Nov 2013 8:19 pm
Weather Station: Davis vantage vue
Operating System: windows 7
Location: Menaldum

Re: Top 10 Records Page

Post by weerstationmenaldum »

Thank you very much for this information, very happy with this. :D

I m gonna try this tonight en will let you of its works.
weerstationmenaldum
Posts: 4
Joined: Mon 11 Nov 2013 8:19 pm
Weather Station: Davis vantage vue
Operating System: windows 7
Location: Menaldum

Re: Top 10 Records Page

Post by weerstationmenaldum »

Almost work.

Only in the top10s.php i have to put some info for connection with the database but don't know how:

---------------------------------------------------------------------------------
<?php
// Connect to the database
$con = @mysql_connect($dbhost, $dbuser, $dbpassword);
if (!$con) {
die('Failed to connect to the database server - ' . mysql_error());
}
if (!mysql_select_db($database, $con))
{
die('Failed to connect to the database on the server - ' . mysql_error());
}

----------------------------------------------------------------------------------

Someone a sample for me?
With beste regards
KLaas
User avatar
rogerthn
Posts: 489
Joined: Thu 11 Apr 2013 6:31 pm
Weather Station: Ecowitt GW1000/GW1003
Operating System: Raspberry Pi OS bullseye aarch64
Location: Trollhättan Sweden
Contact:

Re: Top 10 Records Page

Post by rogerthn »

Have a look at page 1 in this thread, reply 2 and 3.
Image
Post Reply