Page 16 of 17

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 6:05 pm
by RayProudfoot
steve wrote:You have some garbage on the front of your realtime.log:

$SITE['home'] = "./";
$SITE['datafile'] = "realtime.log";
$SITE['source'] = "realtime.txt";2011-05-28 00:34:12 10.4 87 8.3 7.0 4.0 189 0.00 0.01 1013.79 S 2 mph C hPa in 4.0 -0.56 2.23 10.97 0.00 20.9 53 8.9 -0.4 11.1 00:00 10.4 00:31 9.0 00:03 18.0 00:25 1014.06 00:10 1013.79 00:33 1.9.1 989 18.0 10.4 10.9 0 0.000 0 205 0.01 0 0 0 SSW 847 ft 7.8 0.0 0 0

But I don't think that's actually the problem; I think the problem is that you don't have any data in your realtime.log file with suitable timestamps. I think the code looks for particular minutes and only plots those.
Yes, I spotted that and mentioned it in my earlier message to Jason. I'm also concerned that I'm not getting regular data loaded to realtime.log. Is this something Cumulus takes care or do I need to upload a file? I see references to cron but haven't a clue what it does.

Footie getting close. Replies will be later this evening.

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 6:06 pm
by RayProudfoot
6719jason wrote:
RayProudfoot wrote:Hi Jason,

Thanks for sight of your GraphSettings.php. Mine is exactly the same except for the Station Name...

$SITE['version'] = "3.1";
$SITE['hloc'] = "../";
$SITE['jpgraphloc'] = "../jpgraph/src/";
$SITE['datafile'] = "realtime.log";
$SITE['sitename'] = "Cheadle Hulme Weather";
$SITE['bgncolor'] = "#EFEFEF";
$SITE['txtcolor'] = "#22464F";
$SITE['tz'] = "Europe/London";
#---------------------------------------------------------------------------
$SITE['infopass'] = "";
$SITE['debugpass'] = "";
$SITE['datapass'] = "sce";
$SITE['viewpass'] = "sce";
$SITE['debug'] = 0; # Adjustable via debug
$SITE['info'] = 1; # Adjustable via info

However, I was looking back through this thread and on Page 3 arthur posted a link to his realtime.log http://chh-p.dyndns.org/realtime.log

Now if you look at mine it's quite different and I suspect this is the reason JpGraph can't read it...

http://www.cheadlehulmeweather.co.uk/gr ... altime.log

Does that look like a kosha file to you?
I see what you mean - when you created the realtime.log file.... was it empty? Or did you insert the first 3 lines of code?

Mine starts like this....

2011-04-29 22:14:52 13.5 76 9.3 2.3 0.9 90 0.0 0.0 1009.5 E 1 mph C hPa mm 35.2 0.0 3.6 117.4 0.5 21.7 53 13.5

I created mine as an empty text file and uploaded it as realtime.log.....

It might be worth deleting everything from realtime.log in a text editor and then call 'realtimelog.php' and then checking your graphs...

Hope that makes sense?
Yes, it does. Thanks Jason. I'll try that later tonight.

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 6:10 pm
by 6719jason
RayProudfoot wrote:
Yes, I spotted that and mentioned it in my earlier message to Jason. I'm also concerned that I'm not getting regular data loaded to realtime.log. Is this something Cumulus takes care or do I need to upload a file? I see references to cron but haven't a clue what it does.

Footie getting close. Replies will be later this evening.
You could setup Cumulus Toolbox to Regularly 'Call' realtimelog.php so it stores data at regular intervals?

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 8:58 pm
by RayProudfoot
6719jason wrote:You could setup Cumulus Toolbox to Regularly 'Call' realtimelog.php so it stores data at regular intervals?
If I understand the process correctly each time you call realtimelog.php it writes a record to realtime.log. Is that right?

And once realtime.log has enough entries it can create a graph.

I must have missed all this in the instructions! :shock:

So Jason, could you step me through the process of setting up Toolbox to 'call' realtimelog.php please?

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 9:15 pm
by 6719jason
RayProudfoot wrote:
6719jason wrote:You could setup Cumulus Toolbox to Regularly 'Call' realtimelog.php so it stores data at regular intervals?
If I understand the process correctly each time you call realtimelog.php it writes a record to realtime.log. Is that right?

And once realtime.log has enough entries it can create a graph.

I must have missed all this in the instructions! :shock:

So Jason, could you step me through the process of setting up Toolbox to 'call' realtimelog.php please?
That is correct - Every time realtimelog.php is called, it creates a new line of data collected from realtime.txt and writes it in realtime.log

That too is correct :)

I don't see why not ;) :lol:

Right... First things first, here's a link to the toolbox http://wiki.sandaysoft.com/a/Toolbox

Once downloaded, Install on your PC running Cumulus

Once installed.... Post back here please :)

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 9:33 pm
by RayProudfoot
I'm back. I already have Toolbox running. I upload dayfile.txt each day for the ICCP service on my main page.

But I'm still confused because my realtime.txt only contains one entry timed at 21:50 tonight and that appears twice in realtime.log.

What is going on? Jason, I hope you can sort me out because despite being reasonably proficient at programming this lot has got me pretty confused.

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 9:37 pm
by 6719jason
RayProudfoot wrote:I'm back. I already have Toolbox running. I upload dayfile.txt each day for the ICCP service on my main page.

But I'm still confused because my realtime.txt only contains one entry timed at 21:50 tonight and that appears twice in realtime.log.

What is going on? Jason, I hope you can sort me out because despite being reasonably proficient at programming this lot has got me pretty confused.
Thats good to hear! :)

I have found the problem, that is occurring because although there is a copy of realtime.txt in the /graphs folder, it hasn't been updated since 21:50 - Ideally you want it reading from your ./realtime.txt file which is updated at your realtime interval.

Unless of course.... you schedule Cumulus to manually ftp a realtime.txt to /graphs and tick the 'Realtime' box which should upload realtime.txt to your /graphs folder....

Hope that makes sense?

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 9:52 pm
by RayProudfoot
6719jason wrote:I have found the problem, that is occurring because although there is a copy of realtime.txt in the /graphs folder, it hasn't been updated since 21:50 - Ideally you want it reading from your ./realtime.txt file which is updated at your realtime interval.

Unless of course.... you schedule Cumulus to manually ftp a realtime.txt to /graphs and tick the 'Realtime' box which should upload realtime.txt to your /graphs folder....

Hope that makes sense?
Perfect sense, thanks. The realtime.txt on the Cumulus PC contains a single entry and each time it's updated the new entry replaces the old one. When that is FTP'd to the server I'm guessing a call to realtimelog.php is needed to update realtime.log.

And it's that log file that the graphs read. Yes?

So can you talk me through setting up a 'call' to realtimelog.php please?

This is fun isn't it? Just like pulling teeth! :lol:

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 10:30 pm
by 6719jason
RayProudfoot wrote:
6719jason wrote: Hope that makes sense?
Perfect sense, thanks. The realtime.txt on the Cumulus PC contains a single entry and each time it's updated the new entry replaces the old one. When that is FTP'd to the server I'm guessing a call to realtimelog.php is needed to update realtime.log.

And it's that log file that the graphs read. Yes?

So can you talk me through setting up a 'call' to realtimelog.php please?

This is fun isn't it? Just like pulling teeth! :lol:
That is correct :)

Yup

Ah slight hickup..... I've just realised that the Toolbox only lets you call things hourly or at a set time.... this is no good for the Graphs....

We will need to use a piece of software and a .vbs file. I have attached a .vbs file all reconfigured for your website.

You will need to download and save the .vbs file to your computer.

We will need to use a piece of software called 'Ka Firetask' you can get it from here http://www.konradp.com/products/firetask/

Once you have downloaded and installed it... you will need to run the program.

Once you have, you will need to do the following....

Once the Ka Firetask Window appears, Click on 'Tasks' and click 'New Task' you will see this....
kafiretask.JPG
You will need to set it up as I have done. Ensuring that the file path is correct to your system setup.

Once you have entered all the correct details, click OK and it should start running!

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 10:59 pm
by RayProudfoot
Okay Jason. That's all installed and running. textfile.log is being updated every minute. There were a couple of blank rows but I managed to copy the file to my desktop, edit out the blanks and drop it back on the server before the next update.

My only concern now is the frequency of these updates. The bandwidth could increase quite a bit. How often would you say realtime.txt needs FTPing? Does JpGraph have an optimum period?

And how soon do you think I'll be able to get a working graph? 1 hour? 6 hours?

Thanks for all your help. I hope it helps others to try these excellent graphs too.

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 11:07 pm
by 6719jason
RayProudfoot wrote:Okay Jason. That's all installed and running. textfile.log is being updated every minute. There were a couple of blank rows but I managed to copy the file to my desktop, edit out the blanks and drop it back on the server before the next update.

My only concern now is the frequency of these updates. The bandwidth could increase quite a bit. How often would you say realtime.txt needs FTPing? Does JpGraph have an optimum period?

And how soon do you think I'll be able to get a working graph? 1 hour? 6 hours?

Thanks for all your help. I hope it helps others to try these excellent graphs too.
Excellent!

Yeah, I mean you could get away with updating the realtime.txt /graphs one to 1min and the call every 2mins?

You should get one after 5mins or 1hr if I remember rightly?

If in the morning we are still getting this error, I'll try and see what else there is that we can do to find out whats going wrong and where....

Your more than welcome! :)

Been a pleasure

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 11:10 pm
by RayProudfoot
Jason,

I'm getting multiple errors being written to error_log each time this update occurs. Are they caused by running your script? Here's an example...

[29-May-2011 00:03:43] PHP Warning: array_reverse() [<a href='function.array-reverse'>function.array-reverse</a>]: The argument should be an array in /home/admin4/public_html/graphs/intemp.php on line 129
[29-May-2011 00:03:43] PHP Warning: array_reverse() [<a href='function.array-reverse'>function.array-reverse</a>]: The argument should be an array in /home/admin4/public_html/graphs/intemp.php on line 130
[29-May-2011 00:03:43] PHP Warning: array_reverse() [<a href='function.array-reverse'>function.array-reverse</a>]: The argument should be an array in /home/admin4/public_html/graphs/intemp.php on line 131

I fear that by the time I wake up tomorrow there will be a huge error file on my server. What to do? :(

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 11:13 pm
by 6719jason
I think this sheds some light...
http://www.cheadlehulmeweather.co.uk/gr ... .php?debug

DEBUG> DEBUG TURNED ON
DEBUG> Script is running in: cgi-fcgi mode
DEBUG> Server Path: /home/admin4/public_html
DEBUG> Request URI: /graphs/intemp.php?debug
DEBUG> Server Name: http://www.cheadlehulmeweather.co.uk
DEBUG> PHP Self: /graphs/intemp.php
DEBUG> Path is set to: /home/admin4/public_html/graphs
DEBUG> JpGraph is set to: ../jpgraph/src/
DEBUG> obtaining data from: ../realtime.log
DEBUG> Obtained 25
DEBUG> Want to obtain 24
DEBUG> Starting Array Sweep
DEBUG> Collected 0 records.
DEBUG> TempUnit =
DEBUG> PressUnit =
DEBUG> RainUnit =
DEBUG> WindUnit =
DEBUG> Completed Array Sweep. Reversing Data
DEBUG> Output of Xaxis Array
DEBUG> Output of Y1axis Array
DEBUG> Output of Y2axis Array
DEBUG> Starting Graph Creation
JpGraph Error: 25121 Empty input data array specified for plot. Must have at least one data point.

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 11:22 pm
by RayProudfoot
I'm still lost. Obtained 25. Wanted to obtain 24.?

Huh? It's not exactly user-friendly is it? I've edited out some duplicated records and uploaded a modified file.

I've also changed the program to run every 5 minutes.

I've left RealTime period at 30 secs as I want to keep the wind data as up-to-date as possible. It used to be 5 secs but my bandwidth was excessive.

Re: Cumulus Server Sided JpGraph Graphs

Posted: Sat 28 May 2011 11:27 pm
by 6719jason
RayProudfoot wrote:I'm still lost. Obtained 25. Wanted to obtain 24.?

Huh? It's not exactly user-friendly is it? I've edited out some duplicated records and uploaded a modified file.

I've also changed the program to run every 5 minutes.

I've left RealTime period at 30 secs as I want to keep the wind data as up-to-date as possible. It used to be 5 secs but my bandwidth was excessive.
Yeah your right there....

I wonder.... have you set an interval for the Graphs in temp.php, intemp.php etc?

As in....

#######################################
$SITE['hrs'] = 24; # Adjustable via level
$SITE['tick'] = 2; # Adjustable via level
$SITE['freq'] = 0; # Adjustable via freq
#######################################

I only ask as I can't see the source of the file this end?