How to setup jpgraphs and wxgraphs

Thanks, Niko…I had done the “hard path” but neglected to put the rest of it in.

On the different graphs that are labelled “last whole hour” I have a question. My local time is 18:53. On each of the different types of graphs that I have running so far the ones that are for the time period “last whole hour” are showing 16:xx. Why would they not show 17:xx?

Do you have a link to the graph?

http://www.luvretirement.com/graphtemp.php My time now is 9:30PM. The graph shows that the “last whole hour” was 7:00 PM to 7:59 PM. I’m not questioning the operation of the script at all, I’m just curious about the terminology.

Also another time question: The “last whole hour” time is in 12hr format; the “last 60 minutes” time is in 24hr format; the “indoor temperature” time is in 12hr format but doesn’t specify AM or PM. Just curious.

It appears to calculate the times for the last hour from the filedate/time that it sees on clientrawhour.txt file (not in the file, the actual file creation/update date/time) on the server. So if you look at that file with your ftp client, what time does it show? And is that GMT/UTC or somehow related to your local clock time?

The time is calculated from the file modified time because, at least on my server, it is not created each time but modified. The clientrawhour.txt is the file and it is created at 59 minutes past each hour and the data contained in it represents the data for the hour which is just about to end, and in my testing I found that mine was always uploaded on the hour or just after the hour so I take the time and reduce the hour value by one. Now it is just possible that your weather PC creates this file say at 16:59:00 and uploads it so the time stamp is 16:59:59 in which case my calculation will fail because it should be the hour ending at 16:59:59 but the graph will display hour 15. The problem here is that this data file does not have a timestamp so I have to calculate the time represented somehow. WDL gets round it be only showing the minutes as a negative value. I decided on this way to make it the same as the other graphs and I think the data may well be uploaded more than once per hour as well in which case the second time it uploads the time will display correctly.

If someone can suggest a more reliable way then I can change it, or maybe we could ask Brian to add the timestamp to the file showing when the data is created which would be the best way to do it.

Stuart

EDIT: I do think in retrospect we need a time stamp in the file because if your server is in a different timezone it will also show wrong since I’m using the server file time. Yes I know I could get PHP to work with the correct timezone but I think the best way is to ask Brian to add the time stamp.

I think the way you are doing it is fine. If you just add a user entered (at install) variable in the code for an offset between server time and station time it should be almost bulletproof.

GoDaddy offices are located in Scottsdale, AZ but how would you find out where their server farm is?

Setting a timezone on PHP requires PHP V5.1.0 as a minimum which would mean that these graphs would require that level of PHP.

To answer the other point it would be your station timezone which would be used and therefore it would not matter where the server was located or what timezone it worked on.

I guess the other point would be daylight saving as well.

I still think it would be best to ask Brian to add a field which represented perhaps just the hour value that the data represented. That would work universally and not require PHP V5.1.0 either.

Stuart

It certainly would be easier if there was a timestamp. I’m not sure how lulu’s graph is working at all, her server responds that it’s set to GMT so I would have thought that’s what the file time would be in.

One of the questions during domain set up pertains to what time zone you are in if that makes any difference. :dontknow:

As to servers I guess it may well be possible for them to be set to the users timezone, perhaps someone who knows could confirm this.

As to the mixed time styles 12 vs 24 hour format. All my graphs show in 24 hour format, but I run WD in 24hr mode. Any graphs which have time values (the 24 hour ones all have time stamps in the appropriate clientraw file) will show in whatever mode you run WD in, all the others are coded in 24 hour mode which was the way I coded it.

I probably think right now that the graphs need some cleaning up and sorting out a bit to perhaps externalise some more stuff to the config file. As to the timing of the last whole hour graphs I still would like Brian to consider adding a time stap of the hour the data represents which makes that part fireproof. The other time formats could then be externalised to the config file.

Right now I probably dont have the time to do this, I will consider it but it will be a while before it happens.

Stuart

I have been looking again at the graphs and thanks to Jim (aka jmcmurray) I now have two more graphs to add which contain a calculated dew point, they are last whole hour and 24 hour temperature+dewpoint+humidity graphs. I have also, again thats to Jim’s file, got a better way to find the hour being processed for the clientrawhour (last whole hour) graphs which does not rely on finding file modified times and does not worry about timezones etc. So the graphs will continue to work with both PHP4 and PHP5, at least for now. I will no longer test any graphs on PHP4 after the next update which will probably be out in the next week or so.

I would recommend people going to PHP5 if at all possible because PHP4 will no longer be enhanced after 31 Dec 2007 and no longer get critical security fixes after 08 August 2008. See www.php.net

Stuart

If the domain provider is not planning on using PHP5 I don’t think there’s any way an individual can make that happen is there?

I really cannot see any hosting provider worth being with not being able to at least install PHP5 along side PHP4 so folks can migrate by August this year, they have to understand that after August this year there will be no security holes patched in PHP4 and therefore leave themselves open to any problem. This is not new news, its was announced on 13th July 2007.

If my provider had not indicated that PHP5 was to be made available I’d email them demanding it. There is probably very little PHP4 code out there today which will not run under V5. I should point out that my provider has both available and the user can switch it over themselves.

Stuart

Interesting…I sent GoDaddy an email earlier today asking them about this…I should hear back soon. Anyway, if they should upgrade to PHP 5 can they also maintain PHP4 if they want to and/or how would a person with a websitesite indicate to them that the website was using code for 5 and not 4? I am not knowlegable about these things and am really interested in knowing. It’s a curiousity thing :oops:

It depends on how they install it but yes they can have and support both. My provider allows you to specify via an entry in the .htaccess file if you want PHP5, currently PHP4 is the default. It could also be done by them when you sign up or request either 4 or 5 to be your default at a later stage. In fact my provider will switch it for people who dont feel confident in doing it themselves.

Stuart

From the godaddy hosting features table, looks like you can have 4 or 5 (but how that’s determined is a good question):


godaddyphp.gif

From GoDaddy:

[color=green][b]"Support Staff Response
Dear Linda McElwee,
Thank you for contacting online support.

At this time you can upgrade to php5 through your Hosting Control Center or through your php.ini file"[/b][/color]

Looking at the FAQ it appears you may be able to run things under php5 by changing the suffix to that, so you could try test.php renamed test.php5 and see what it returns. If that works then it would be a way to test your scripts under 5 without switching over.