Welcome to the new home of the Cumulus Support forum.

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

Highcharts Graphs

Discussion and support for 3rd-party (non-Sandaysoft) tools for Cumulus
User avatar
nitrx
Posts: 1292
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Highcharts Graphs

Post by nitrx » Sat 24 Nov 2012 6:28 pm

mcrossley wrote:maybe I was still 'fiddling' with it - I'm leaving it now to go out for the evening so is should be stable, and updating ;)
see my update above :D

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

Re: Highcharts Graphs

Post by steve » Sat 24 Nov 2012 6:30 pm

Looks good. If you want to see how it looks with a Davis, just let me know.
Steve

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

Re: Highcharts Graphs

Post by mcrossley » Sat 24 Nov 2012 6:45 pm

You're welcome to all the source Steve, the 'hard' part is creating the real time.txt log file. I think it was Kevin who created a PHP based archived, but it also does the day file. As I run on a Windows box I created a simple batch script to just keep a log file with the last 60 minutes of data in it. The PHP above then parses this file and returns JSON formatted data for the web tags you request as params.

Getting ready to go out now, so I'll zip everything up tomorrow.

User avatar
tomcatuk
Posts: 312
Joined: Fri 26 Dec 2008 4:41 pm
Weather Station: ----> Davis Vantage Vue
Operating System: Windows 10 v1809
Location: Buckingham

Re: Highcharts Graphs

Post by tomcatuk » Sat 24 Nov 2012 11:13 pm

Like the graphs Mark.... :)
Regards Steve

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

Re: Highcharts Graphs

Post by mcrossley » Sun 25 Nov 2012 12:25 am

Here is the realtime, stripped to the basics so you can adapt and include in another page if you wish...

http://weather.wilmslowastro.com/realtimeCumulus.htm

The batch file I am using to create the 1 hour realtime.log file is dead simple...

Code: Select all

:start
copy realtime.log+realtime.txt realtime.tmp
tail -60 realtime.tmp > realtime.log
sleep 60
goto start
EDIT: Though I see there will be problems with this if you are not in the UK time zone :(, a little more code required to fix that tomorrow...

User avatar
nitrx
Posts: 1292
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Highcharts Graphs

Post by nitrx » Sun 25 Nov 2012 9:11 am

mcrossley wrote:Here is the realtime, stripped to the basics so you can adapt and include in another page if you wish...

Code: Select all

:start
copy realtime.log+realtime.txt realtime.tmp
tail -60 realtime.tmp > realtime.log
sleep 60
goto start
Win 7 doesn't recognise the tail command ?

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

Re: Highcharts Graphs

Post by mcrossley » Sun 25 Nov 2012 11:19 am

Ah, yes, my XP box has the Windows 2003 Resource Kit tools installed on it - you can download it for free, and most of the tools still work on Win 7 x64. I think 'sleep' is a RK tool as well?

PS: The script is now updated to avoid TZ issues.
http://weather.wilmslowastro.com/realtimeCumulus.htm

User avatar
nitrx
Posts: 1292
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Highcharts Graphs

Post by nitrx » Sun 25 Nov 2012 11:38 am

Hmmmz
Note: The Windows Server 2003 Resource Kit Tools are not supported on 64-bit platforms.

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

Re: Highcharts Graphs

Post by mcrossley » Sun 25 Nov 2012 12:23 pm

Some of the tools in the RK no longer work on Win x64, but sleep and tail are definitely fine. Windows will popup a compatibility warning when you run the installer, you can ignore that, let the RK install, then copy off the sleep & tail utilities and uninstall the RK again if you have concerns.

Sleep 60 could be substituted with the built-in 'choice' command...

choice /T 60 /D y

Edit: you don't want to go fiddling around with the W2K3 RK tools that delve into kernel flags for instance on Windows 7 x64 :shock: But the simple 'user' type utilities are fine.

User avatar
nitrx
Posts: 1292
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Highcharts Graphs

Post by nitrx » Sun 25 Nov 2012 2:50 pm

I'm not going to try this, I tried cumulstoolbox but this creates huge logfiles minimum is 1 day, but I had no succes maybe because I've another dateformat I changed the datedelimiter / to - in all the files but no succes http://www.apeldoorn.tk/weer/realtimecumulus.htm I give up :(

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

Re: Highcharts Graphs

Post by mcrossley » Sun 25 Nov 2012 3:03 pm

Ron

The problem is your "realtimeLogParser.php" is not executing as PHP, it is just returning the script file rather than the data. try it...
http://www.apeldoorn.tk/weer/realtimeLo ... .php?rfall

If you are running on Linux web server, then I think you have to mark the php file as 'executable' with chmod(?) in order for it to run.

The realtime.txt parser part is running OK, with the date delimiter changed to '-'. I thought Cumulus used as standard format for realtime.txt - wrong!

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

Re: Highcharts Graphs

Post by steve » Sun 25 Nov 2012 3:11 pm

mcrossley wrote:The realtime.txt parser part is running OK, with the date delimiter changed to '-'. I thought Cumulus used as standard format for realtime.txt - wrong!
I think all of the date separators in dates created by Cumulus uses the configured system data separator. As I've mentioned before, the explanation is that while the code says "use a slash", the underlying system routines take that to mean "use the date separator configured in Windows". I had no idea that was going to happen. Cumulus was never intended to run on non-UK systems - or even on anyone else's PC but mine.
Steve

User avatar
nitrx
Posts: 1292
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Highcharts Graphs

Post by nitrx » Sun 25 Nov 2012 4:08 pm

I've chmodded the php file to 777 but no result this is my logfile http://www.apeldoorn.tk/weer/realtimelog.txt (I just started the ftp again)

Hmm if I look at the sourcecode of the php file it looks really weird ... :shock:

User avatar
nitrx
Posts: 1292
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Highcharts Graphs

Post by nitrx » Sun 25 Nov 2012 4:41 pm

Thank Mark I've done a make-over from the php file it was complete corrupted :mrgreen: seems to work now but the time axis don't match .

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

Re: Highcharts Graphs

Post by mcrossley » Sun 25 Nov 2012 6:29 pm

Hmm, the PHP is now returning data, but the first entry has a time stamp of '0' for some reason. What does the first line of your realtime.log file look like?

Code: Select all

[[[0,10.1],[1353865628000,10.1],[1353865728000,10.2],....
Edit: You also need to remove the following line from the PHP script - It is a left over from my experiments :(

Code: Select all

date_default_timezone_set('UTC');

Post Reply