IMPORTANT! The server may go down soon - possibly permanently. Please read the latest post in Announcements and News

Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Sun Plot

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

Moderators: daj, TNETWeather

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

Re: Sun Plot

Postby steve » Sun Jul 31, 2016 6:12 pm

It deletes the entries older than the interval you specify each time it does an update.
Steve
-----
Hosting available for Cumulus web sites. See http://sandaysoft.com/forum/viewtopic.php?f=2&t=11876

Please read the posts in the Announcements section about the current status of Cumulus development since I have retired from my day job

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

Re: Sun Plot

Postby mcrossley » Sun Jul 31, 2016 6:20 pm

It will keep a 'rolling' 24 hours. I keep 10 days worth, MySQL can cope quite happily with millions of rows in a table.

User avatar
Mapantz
Posts: 493
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Sun Plot

Postby Mapantz » Mon Aug 01, 2016 1:07 pm

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
Image

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

Re: Sun Plot

Postby mcrossley » Sat Aug 20, 2016 5:02 pm

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: 1676
Joined: Sun Sep 28, 2008 11:54 pm
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: Sun Plot

Postby PaulMy » Sat Aug 20, 2016 8:34 pm

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

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

Re: Sun Plot

Postby mcrossley » Sat Aug 20, 2016 9:09 pm

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: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Sun Plot

Postby mcrossley » Sat Aug 20, 2016 9:15 pm

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.

User avatar
Mapantz
Posts: 493
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Sun Plot

Postby Mapantz » Sat Aug 20, 2016 11:44 pm

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
Image

User avatar
PaulMy
Posts: 1676
Joined: Sun Sep 28, 2008 11:54 pm
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: Sun Plot

Postby PaulMy » Sun Aug 21, 2016 1:22 am

@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

User avatar
beteljuice
Posts: 2474
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Sun Plot

Postby beteljuice » Sun Aug 21, 2016 1:54 am

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: 1676
Joined: Sun Sep 28, 2008 11:54 pm
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: Sun Plot

Postby PaulMy » Sun Aug 21, 2016 2:11 am

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.

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

Re: Sun Plot

Postby mcrossley » Sun Aug 21, 2016 12:14 pm

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: 1676
Joined: Sun Sep 28, 2008 11:54 pm
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: Sun Plot

Postby PaulMy » Sun Aug 21, 2016 2:31 pm

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

User avatar
Mapantz
Posts: 493
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Sun Plot

Postby Mapantz » Tue Aug 23, 2016 2:06 pm

The perfect day in England for looking at the Solar graph, and looking like a full house on the sun plot too. :D
Image
Image

User avatar
PaulMy
Posts: 1676
Joined: Sun Sep 28, 2008 11:54 pm
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: Sun Plot

Postby PaulMy » Tue Aug 23, 2016 2:22 pm

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


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 6 guests