Page 2 of 28
Re: Highcharts Graphs
Posted: Sat 24 Nov 2012 6:28 pm
by nitrx
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

Re: Highcharts Graphs
Posted: Sat 24 Nov 2012 6:30 pm
by steve
Looks good. If you want to see how it looks with a Davis, just let me know.
Re: Highcharts Graphs
Posted: Sat 24 Nov 2012 6:45 pm
by mcrossley
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.
Re: Highcharts Graphs
Posted: Sat 24 Nov 2012 11:13 pm
by tomcatuk
Like the graphs Mark....

Re: Highcharts Graphs
Posted: Sun 25 Nov 2012 12:25 am
by mcrossley
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...
Re: Highcharts Graphs
Posted: Sun 25 Nov 2012 9:11 am
by nitrx
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 ?
Re: Highcharts Graphs
Posted: Sun 25 Nov 2012 11:19 am
by mcrossley
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
Re: Highcharts Graphs
Posted: Sun 25 Nov 2012 11:38 am
by nitrx
Hmmmz
Note: The Windows Server 2003 Resource Kit Tools are not supported on 64-bit platforms.
Re: Highcharts Graphs
Posted: Sun 25 Nov 2012 12:23 pm
by mcrossley
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

But the simple 'user' type utilities are fine.
Re: Highcharts Graphs
Posted: Sun 25 Nov 2012 2:50 pm
by nitrx
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

Re: Highcharts Graphs
Posted: Sun 25 Nov 2012 3:03 pm
by mcrossley
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!
Re: Highcharts Graphs
Posted: Sun 25 Nov 2012 3:11 pm
by steve
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.
Re: Highcharts Graphs
Posted: Sun 25 Nov 2012 4:08 pm
by nitrx
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 ...

Re: Highcharts Graphs
Posted: Sun 25 Nov 2012 4:41 pm
by nitrx
Thank Mark I've done a make-over from the php file it was complete corrupted

seems to work now but the time axis don't match .
Re: Highcharts Graphs
Posted: Sun 25 Nov 2012 6:29 pm
by mcrossley
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