Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.2.4 build 3060 - 10 December 2019.
    Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

    See the Wiki for downloading either version.

    Highcharts 'Recent' graphs

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

    Moderator: daj

    thekow
    Posts: 53
    Joined: Wed 05 Dec 2012 8:39 am
    Weather Station: w1080
    Operating System: Virtualbox XP environment
    Location: Australia
    Contact:

    Re: Highcharts 'Recent' graphs

    Post by thekow » Sat 22 Dec 2012 5:39 am

    I got the recent Charts Running. Just got to wait until my DB gets at least 48 hours of data now. I was getting ERROR - TZ Statement. For now i commented the lines out. The charts show a different time a few hours behind. How to fix that error, i'm not sure. I had trouble last time with the TZ statement as well.

    IE : current time is 3:51pm , the chart is showing 8:51pm

    water01
    Posts: 1558
    Joined: Sat 13 Aug 2011 9:33 am
    Weather Station: WH1081
    Operating System: Windows 7 64bit HP SP1
    Location: Somewhere in the USA
    Contact:

    Re: Highcharts 'Recent' graphs

    Post by water01 » Sat 22 Dec 2012 9:00 am

    That is because the Time Zone function is causing a problem.

    I changed mine to

    Code: Select all

    $result = mysql_query("SET time_zone='+0:00'");  
    in order to get it to work,
    but in Australia I presume that will be

    Code: Select all

    $result = mysql_query("SET time_zone='+9:00'");  

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

    Re: Highcharts 'Recent' graphs

    Post by mcrossley » Sat 22 Dec 2012 10:26 am

    Which TZ statement works seems to depend on the version of MySQL, the hours version seems to be more universal, I will change the code to use that . Whichever, you should use UTC, otherwise bad things may start happening.

    User avatar
    meteotortosa
    Posts: 323
    Joined: Thu 04 Dec 2008 12:15 am
    Weather Station: Davis Vantage Pro2 Plus
    Operating System: Windows XP SP3
    Location: Tortosa-Baix Ebre- Catalonia
    Contact:

    Re: Highcharts 'Recent' graphs

    Post by meteotortosa » Sat 22 Dec 2012 2:49 pm

    Any instruccions for install on my webserver?

    For dummies, please :oops:
    Weather in Tortosa (NE Spain), updated every 15'
    Image Image

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

    Re: Highcharts 'Recent' graphs

    Post by mcrossley » Sat 22 Dec 2012 3:00 pm

    Not yet, a Wiki page to follow (sometime), too busy now.

    User avatar
    meteotortosa
    Posts: 323
    Joined: Thu 04 Dec 2008 12:15 am
    Weather Station: Davis Vantage Pro2 Plus
    Operating System: Windows XP SP3
    Location: Tortosa-Baix Ebre- Catalonia
    Contact:

    Re: Highcharts 'Recent' graphs

    Post by meteotortosa » Sat 22 Dec 2012 3:42 pm

    mcrossley wrote:Not yet, a Wiki page to follow (sometime), too busy now.
    Thanks :clap:
    Weather in Tortosa (NE Spain), updated every 15'
    Image Image

    thekow
    Posts: 53
    Joined: Wed 05 Dec 2012 8:39 am
    Weather Station: w1080
    Operating System: Virtualbox XP environment
    Location: Australia
    Contact:

    Re: Highcharts 'Recent' graphs

    Post by thekow » Sat 22 Dec 2012 7:53 pm

    Set to UTC (+00:00) Works perfect :)

    Site is nearly there - http://weatherstation.seqstorms.com/trends.php

    User avatar
    BeaumarisWX
    Posts: 197
    Joined: Mon 09 Apr 2012 2:38 pm
    Weather Station: Davis VP2 Plus - 24hr FARS
    Operating System: Windows 10 Home (64bit)
    Location: Beaumaris Tasmania
    Contact:

    Re: Highcharts 'Recent' graphs

    Post by BeaumarisWX » Sun 05 May 2013 1:21 am

    Hi Mark and TheKow,

    I finally got around to converting to ImportCumulusv2 and upgraded all sql tables etc.

    1: Now have 48 hr Recent Trends http://hrvistaweather.com/wxrecentChartsSQL.php converted, I noted on the original script and on (both your sites) that they are not true 48hr progressive periods so I modified mine to be exact 48hr (well within 1 minute of.

    Changed :

    Code: Select all

    realtimeLogSqlv.php?recordAge=38&recordUnit=hour&press&nth=1
    Note: the age = 38 and the nth=1 (my data roughly in 1 min incidents.

    2: Now have the HistoricCharts http://hrvistaweather.com/wxhistoricCharts.php converted and modified.

    3: Have tried on many occasions to convert the original "Rolling 12hr Charts" http://hrvistaweather.com/wxhistoricCharts12hr.php which used Reltime/realtimeLog.txt, however completely stuck with that one, can't get it running.
    Any tips on the above using MySql would be greatly appreciated, as there is no wiki as yet.

    regards
    Tony

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

    Re: Highcharts 'Recent' graphs

    Post by mcrossley » Sun 05 May 2013 10:56 am


    User avatar
    BeaumarisWX
    Posts: 197
    Joined: Mon 09 Apr 2012 2:38 pm
    Weather Station: Davis VP2 Plus - 24hr FARS
    Operating System: Windows 10 Home (64bit)
    Location: Beaumaris Tasmania
    Contact:

    Re: Highcharts 'Recent' graphs

    Post by BeaumarisWX » Sun 05 May 2013 1:14 pm

    Hi Mark,

    Thanks but no, already had that running and returning data for weeks now.
    My problem is working out how to re'script the "realtimeCumulus.js" file to use the "realtimeLogTable.php".
    I run a cron job every 30 secs to import / update the Realtime table in MySql (even though FineOffset only produces 45 sec data I always do that as over/underlap ensures I get latest data as soon as available - works fine no issues there.
    So can't figure out how to just use the "realtimeLogTable.php" to update the container every 30 secs ? (can't see point in looking at "realtime.txt) if that makes sense.
    Anyway the old one still works and it's too late here now - will put back on shelf again till next weekend.

    Thanks again.
    Regards
    Tony

    User avatar
    BeaumarisWX
    Posts: 197
    Joined: Mon 09 Apr 2012 2:38 pm
    Weather Station: Davis VP2 Plus - 24hr FARS
    Operating System: Windows 10 Home (64bit)
    Location: Beaumaris Tasmania
    Contact:

    Re: Highcharts 'Recent' graphs

    Post by BeaumarisWX » Sun 05 May 2013 1:22 pm

    Hi Mark,

    Forgot to ask - did you find the 48hr recordAge mod of any use.
    ooh and just noticed your 12/24/48hr radio buttons - very nice - will have to pick your brains on those - will you be adding that to the wiki ?
    Have a good week,
    Cheers
    Tony

    kapo
    Posts: 247
    Joined: Thu 03 Jan 2013 1:59 pm
    Weather Station: Davis VP2
    Operating System: Windows 10
    Location: Vihtavuori, Laukaa, Finland

    Re: Highcharts 'Recent' graphs

    Post by kapo » Tue 14 May 2013 11:24 pm

    Hi Mark!

    With best regards:

    -kapo-

    User avatar
    laulau
    Posts: 524
    Joined: Tue 13 Oct 2009 10:52 pm
    Weather Station: WeatherDuino Pro2
    Operating System: Win 7
    Location: Meyenheim, Alsace, FR
    Contact:

    Re: Highcharts 'Recent' graphs

    Post by laulau » Sun 26 May 2013 9:07 am

    Hi,
    I started to use this script yesterday, it's working but i have a little time zone problem :oops: (like in ImportCumulusFile http://sandaysoft.com/forum/viewtopic.p ... ile#p82245
    If i let time zone to +0:00 the last datas in the graph shows 2 hours earlier.
    I set time zone to +2:00 (French time zone) the last datas shown are ok.
    In my test i can select 1,4, 8 hours (instead the 12,24,48) because my reltime database is a little too 'young'.
    When i select 1 hours the graph shows 3 hours of data, with 4 hours selection i have 6 hours of data and with 8 hours selection i can see 10 hours of data.
    There are always 2 hours more datas than the selection. 2 hours is my time zone difference from UTC! :o
    I think Mark will answer this :
    I need to look at the tz again, I thought that forcing the time zone to UTC would avoid these sorts of problems - obviously not.
    ;)
    Laurent

    Image

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

    Re: Highcharts 'Recent' graphs

    Post by mcrossley » Mon 27 May 2013 4:36 pm

    OK, I see what is going wrong.

    EDIT: Removed bit about commenting out the TZ it doesn't work!

    What I was trying to do was make the scripts TZ independent - so your station could be in Europe and your server in the USA say. The idea was to force MySQL into using UTC (but still storing the date/time using your local time), the problem is that the NOW() statement respects the TZ statement and converts the current system time into UTC which of course does not match the stored data in local time.

    The only solution I can think of at the moment where the browser client, weather station, and back-end server could all be in different TZs is to first query the table for the latest value and use that as the reference. That of course fails if the table hasn't been updated recently.

    so...

    Code: Select all

    SELECT UNIX_TIMESTAMP(LogDateTime), [flds...]
    FROM $logtable
    WHERE LogDateTime > (SELECT MAX(LogDateTime) - INTERVAL $recordAge $recordUnit FROM $logtable)
    ORDER BY LogDateTime ASC"
    
    http://weather.wilmslowastro.com/realti ... p?view=sce

    Anyone else got any bright ideas? Kerry? ;-)

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

    Re: Highcharts 'Recent' graphs

    Post by mcrossley » Mon 27 May 2013 8:37 pm

    Edited my post above, because there is one other factor in play - Highcharts is expecting the time stamp values to be in UTC, so altering the TZ in the MySQL queries means that you also have to alter the TZ in HighCharts away from default as well. :(

    Post Reply