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
laulau
Posts: 520
Joined: Tue Oct 13, 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Sun Plot

Postby laulau » Thu Jul 28, 2016 1:56 pm

mcrossley wrote:
Any interest in me releasing this script?


YES! :D
Laurent

Image

f4phlyer
Posts: 30
Joined: Sun Feb 13, 2011 7:12 pm
Weather Station: Davis Vantage Pro 2
Operating System: RaspBerry Pi Win 10 OSx
Location: Gulf Breeze, Fl., USA
Contact:

Re: Sun Plot

Postby f4phlyer » Thu Jul 28, 2016 2:21 pm

That would be simply delightful!
Steve
The Squeaky Sands Inn
CumulusMX on Raspberry π 3
WeatherUnderground KFLGULFB1
http://www.squeakysands-inn.net/index.php

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 » Thu Jul 28, 2016 7:45 pm

Mark, your suggestions and scripts are ALWAYS well received :P
Image
......................Imagine, what you will KNOW tomorrow !

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 » Fri Jul 29, 2016 4:05 pm

beteljuice wrote:Mark, your suggestions and scripts are ALWAYS well received :P

:oops: Not sure about that, some are more trouble than they are worth! :lol:

Anyway, I've put a new page on my site to start collecting some of these scripts together. The sunplot should now be downloadable from there (if I've got the .htaccess file right!).
http://weather.wilmslowastro.com/scripts.php

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 Jul 30, 2016 10:30 pm

Does the sunshine have to come from the realtime sql upload, or can the monthly one be used?

Edit: I see 'IsSunny' in the file, so I guess that is in the realtime?!

I don't upload that at the moment, but I will do it now. I'm not sure about the retention string bit - after reading a post by Steve, I see it is optional?
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 Jul 30, 2016 11:00 pm

Sunshine has to come from a real time table, you need the minute by minute state, the daily value is just the total hours for the day and isn't created until midnight (or 9am).

The plot will work without the sunshine data though.

User avatar
jdc
Posts: 134
Joined: Tue Jun 19, 2012 8:51 pm
Weather Station: Davis VP2 : Instromet
Operating System: Win 10 : Win XP
Location: Berwick-upon-Tweed, England.
Contact:

Re: Sun Plot

Postby jdc » Sun Jul 31, 2016 8:39 am

Another very clever & useful script, Mark. ;)

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 » Sun Jul 31, 2016 11:23 am

I've got it up and running without the sunshine enabled. :D

It seems my server doesn't like 'Europe/London' in the timezone setting when dealing with sql, it comes up with an error. I tried +00:00 and +01:00 but it makes the plot go a bit strange.
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 » Sun Jul 31, 2016 1:25 pm

Sounds like your MySQL instance doesn't have the time zone information imported.

http://dev.mysql.com/doc/refman/5.7/en/ ... o-sql.html

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 1:28 pm

jdc wrote:Another very clever & useful script, Mark. ;)

Thanks John.

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 » Sun Jul 31, 2016 4:11 pm

I'm also one of those who can import the timezones, due to restrictions. :?

I did this instead: $tz = '+1:00';

I don't know if this is making the graphs odd, or whether it is correct?

http://www.warehamwx.co.uk/cumulus/sunplot.php
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 » Sun Jul 31, 2016 4:18 pm

Try just commenting out the setting of the time zone in MySQL

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 » Sun Jul 31, 2016 5:55 pm

I've got that solved. I sent a ticket explaining that I'm unable to load the timezones myself, and they have done it for me!

Now that's working, I need to add a retention string to CMX, so that it deletes the realtime data every 24hrs, otherwise it'll just fill up too quickly.

I though this would work: DELETE * FROM Realtime WHERE LogDateTime >= now() + INTERVAL 1 DAY;

I get an error though..
Image
Image

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 5:59 pm

Are you using the standard realtime.txt MySQL update? If so, you just need to specify the interval - see the announcement for build 3025 where I give some examples.
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
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 » Sun Jul 31, 2016 6:10 pm

steve wrote:Are you using the standard realtime.txt MySQL update? If so, you just need to specify the interval - see the announcement for build 3025 where I give some examples.


Ah bingo! Thank you Steve!
I tested it at 1 minute, and it did the job! I should've realised that, there was me trying to add in full syntax :oops:

So if I make it delete the table every 24 hours, will it be from time I click save in CMX?
Image
Image


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 3 guests