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

Sun Plot

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

Moderator: daj

User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Sun Plot

Post by steve »

It deletes the entries older than the interval you specify each time it does an update.
Steve
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post by mcrossley »

It will keep a 'rolling' 24 hours. I keep 10 days worth, MySQL can cope quite happily with millions of rows in a table.
Mapantz
Posts: 1777
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Sun Plot

Post by Mapantz »

Sorry for the late reply, I ended up going beach fishing yesterday evening.

Thank you for the help and pointers guys, all is working well! I'll be making a separate page for all the credits. :)
Image
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post by mcrossley »

Version 1.2 of Sun Plot is now available. It adds the option to put hourly ticks on the plot and numbers every 3 hours.
sunplot-1.2.png
It also uses a True Type font (arial.ttf by default), so you will need that font file on your web server somewhere - and don't forget to set the path/filename in the script. If it can't find the font you will get the tick marks but no numbers.

(1.1 in case you missed it fixed undeclared variable $sunShineRaw that manifested itself just after midnight).
You do not have the required permissions to view the files attached to this post.
User avatar
PaulMy
Posts: 3777
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: Sun Plot

Post by PaulMy »

I have uploaded Sun Plot http://www.komokaweather.com/weather/sunplot.php without sunhours as have not yet figured out how I can get that sata from my B-L Sunrecorder.

However having difficulty in getting it to work in http://www.komokaweather.com home page. I have inserted

Code: Select all

					<td>
						<span id="sunplot" style="width:400px; height:150px; margin: 0px 5px; border:0">
						<p>Sun Plot: Charting Sunrise, Current Sun Position, Sunset.
						<?php include "sunplot.php"; ?></p>
						</span>
					</td>
I must be missing something :oops:

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
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post by mcrossley »

Ah, yes, you don't "include" the script. It returns a PNG image, so just put an <img> tag in your HTML where you want it and let the browser pull it down. That way you can refresh it periodically too.

<img src="path/sunplot.php" alt="sun plot" width="xxx" height="yyy">
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post by mcrossley »

An example of another users implementation, he is using WeatherCat not Cumulus and doesn't have sun shine data either, but his pages are quite stylish. You may notice that he has changed the sun plot to use different colours, and the same font as the rest of his data, a nice touch.

http://wetter.unterwurzacher.at/wetterwerte.html

You need to scroll down a bit, or use the 'sonne' link.
Mapantz
Posts: 1777
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Sun Plot

Post by Mapantz »

Nice work, I really like it! Updated it on my page, the image isn't as big as others, but I like it. I use Source Sans Pro as my main font, so I used the bold version for the numbers. Very pleased with it! :)
Image
User avatar
PaulMy
Posts: 3777
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: Sun Plot

Post by PaulMy »

@Mapantz your http://www.warehamwx.co.uk/cumulus/ really well done and looks professional.
@http://wetter.unterwurzacher.at/wetterwerte.html is a nice image for sun plot, and going well with that page.

I have been able to get it added http://www.komokaweather.com but whenever I set
$showHours = true; // Plot the hours 0-24 along the horizon axis
the image fails.

There is a mention of arial.ttf and I likely don't have that uploaded or don't know where. I have searched my computer, website and Google but haven't been able to find or understand. Where/what would I need to have the hours show on the axis?

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
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: Sun Plot

Post by beteljuice »

There is a mention of arial.ttf and I likely don't have that uploaded or don't know where. I have searched my computer, website and Google but haven't been able to find or understand.
In order for the graphic to be constructed with your font of choice, the font needs to be available to it.

font files end with extension .ttf (or more correctly TrueTypeFont format - different scaled heights available)
On your PC they are most likely situated in C:/WINDOWS/fonts

Just do a search for .ttf and the worlds your oyster - after you have uploaded the one you want to your webspace and referenced properly. :D
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
PaulMy
Posts: 3777
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: Sun Plot

Post by PaulMy »

Thanks beteljuice,
ThatWasEasy.png
once I looked in the most obvious folder :oops: (I had searched arial.ttf and nothing showed up and missed the fonts subfolder in Windows).

I've now added a fonts folder on my webserver in root and all is set. Another lesson learned!

Paul
You do not have the required permissions to view the files attached to this post.
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
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Post by mcrossley »

Paul, is your B-L sun recorder feeding in to Cumulus? Do you have a MySQL database?
If yes to both then you should be able to get the sun shine option on the sun plot working.
Or do you have a file on the server that provides the "sun shining" data, we could maybe do a B-L specific version of the script to read that file.
User avatar
PaulMy
Posts: 3777
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: Sun Plot

Post by PaulMy »

Hi Mark,
Yes the B-L sunshine data is picked up by Cumulus once a minute from a B-L txt file, and then Cumulus includes it in current condition, the log files, and graphs.

I upload dayfile.txt to my dayfile MySQL at day end, but not realtime. However I could upload to a realtime MySQL, would just have to go back to my notes and forum posts on how to.

The B-L has a daily txt log file with ongoing entries for the times of when the sun is shining or not, so this can have zero records or hundreds depending on the day's ongoing sun/cloud condition - i.e. part of today's:

Code: Select all

LAT  42.9539
LON  81.4352
TZ  -5
DST True
SRS 06:38:49 20:17:50 
TOT 01:55:37 00:00:00
SUN 07:39:25 07:44:55 
SUN 07:45:52 08:03:23 
SUN 08:03:45 08:04:37 
SUN 08:04:44 08:07:34 
SUN 08:08:05 08:12:27 
SUN 08:13:11 08:13:38 
SUN 08:16:48 08:17:29 
SUN 08:18:29 08:18:46 
SUN 08:19:19 08:19:48 
...etc
The B-L also has a second daily ongoing system monitoring txt file with an entry every 1 second during sunrise-sundown. But it is not in a form I understand - i.e. part of today's:

Code: Select all

SerialNo,10013
Lat, 42.9539
Lon, 81.4352
Max,36.0
Min,13.1
TC,5.9
Win,4.6
Gain,1.000
Dawn,06:08:48
Rise,06:38:49
Noon,13:28:43
Set,20:17:50
Dusk,20:47:48
TempLow,0.0
TempHigh,26.8
VoltLow,0.00
VoltHigh,5.07
0567000007785
0567100007786
0567200007787
0567300007788
0567400007789
056750000778A
056760000778B
056770000778C
056780000778D
056790000778E
0567A0000778F
0567B00007790
...etc
I had asked Ole if it is possible to extract any useful data from this but don't have the reply.

p.s. there has to be an easier/quicker way to see the results after editing indexT.txt rather than wait for the 5-min Cumulus update, or try to sneak in a manual Web Update :cry:

Regards,
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
Mapantz
Posts: 1777
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Sun Plot

Post by Mapantz »

The perfect day in England for looking at the Solar graph, and looking like a full house on the sun plot too. :D
Image
User avatar
PaulMy
Posts: 3777
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: Sun Plot

Post by PaulMy »

I got the sunplot on http://www.komokaweather.com using MySQL realtime data.

Also had it working using the B-L Sunrecorder data, just need to overcome how to update the B-L Sun_20160823.dat file.

Enjoying, and thanks Mark for all your help.

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
Post Reply