WxSim Temperature Forecast Comparison Script

Ok, done!!

I’ve already changed the forecast-compare-include.php file to the new one

http://meteohila2.esy.es/forecast-compare-include.php

I have configured 2 crons, one to run at am (after calculating the wxsim) and the other at pm (after calculating the wxsim in the afternoon)

tomorrow as soon as they are executed we will see how it works, and we will observe if we obtain any result

One last query that I do not have clear, to see the script, what template I have to consult the forecast-compare-include. php or the file test-fc.php ??

You would look at test-fc.php. Or if you want, you can make your own page for your site and set it up like test-fc but don’t forget the css or it’ll look bad.

  • Jim

ok Jim,

thank you very much for your great help, without you it would not have been possible to make the script work, thanks !!!

Yesterday, I realized that the forecast script has not been working for a while!
It runs without errors via cronjobs, but all I get, is the weather station’s temperature! According to the log files, it has been working until last February. :?

http://www.meteothes.gr/wxfcastcomp.php?lang=en#

I emptied the log files, to get a more clear view of the results. The scripts are at the latest version released. If there are any Date() errors on page, that happens because some log files are still empty.

The only thing I changed at the server recently, is PHP version from 5.6 to 7.1, a few months ago.
I haven’t found any issues so far, concerning PHP versions… Rolled back to 5.6 temporarily, but no change.

Here’s the content of today’s forecastAM.log file:

1541044800,n/a,~,22,n/a,~,18,n/a,~,22,n/a,~,17,n/a,~,22,n/a,~,16,n/a,~,23,n/a,~,15,n/a,~,22,n/a,~,14,

All other files (testtags, etc) have not changed.

Any ideas how to resolve this?

Thanos

Thanos,

To me it looks like the script is working correctly. It’s logging the WxSim forecast temps, and tomorrow you should see the temps that actually happened at your station. Let’s give it a day or two to see it work.

  • Jim

Thanks Jim, you’re probably right! I’ve checked the scripts many times and they look alright. The next morning forecast will run at 06:15 tomorrow local time, uploaded to the site at 06:30
and the cronjob for the comparison scripts 15 mins later, at 06:45. We’ll find out in a few hours! :roll:

Thanos

I just tried to install this script. I am getting a ton of errors

here are a few when I run https://weatheryyc.com/alt/test-fc.php

Notice: Undefined offset: 1 in C:\Abyss Web Server\htdocs\alt\forecast-compare-include.php on line 683

Notice: Undefined offset: 2 in C:\Abyss Web Server\htdocs\alt\forecast-compare-include.php on line 689

Notice: Undefined offset: 3 in C:\Abyss Web Server\htdocs\alt\forecast-compare-include.php on line 695

Notice: Undefined offset: 4 in C:\Abyss Web Server\htdocs\alt\forecast-compare-include.php on line 683

Notice: Undefined offset: 5 in C:\Abyss Web Server\htdocs\alt\forecast-compare-include.php on line 689

Notice: Undefined offset: 6 in C:\Abyss Web Server\htdocs\alt\forecast-compare-include.php on line 695

Notice: Undefined offset: 7 in C:\Abyss Web Server\htdocs\alt\forecast-compare-include.php on line 683

Notice: Undefined offset: 8 in C:\Abyss Web Server\htdocs\alt\forecast-compare-include.php on line 689

Notice: Undefined offset: 9 in C:\Abyss Web Server\htdocs\alt\forecast-compare-include.php on line 695

This is something I haven’t seen before. Paths to the various files get kind of messy with this script when everything isn’t all in the same folder, and I think that is part of our problem here. Is this /alt/ folder going to be the final destination for this comparison script? I’d hate to do a bunch of mods and then find we need it elsewhere.

  • Jim

Try the attached config where I’ve added some path info that hopefully will work for you.

  • Jim

sorry Jim, I have more errors now
/htdocs is root
/alt is where the template is located as well as all scripts

weather data - ie testtags is uploaded to htdocs/wx_data

I hope this info will help

Aha, we’re on a Microsoft server I see. I modified the attached to indicate that and changed the forward slashes to the backslashes that MS needs. There are two backslashes because the first escapes the second so that it is recognized correctly. I have no way of testing this, but I believe this will get us closer if not all the way there.

  • Jim

fc-config.php.txt (6.78 KB)

no joy with that one

Two more paths to fix and hopefully it will run now with the attached. Note the comment on line 66 for the future if this script needs updating.

If you ever decide to run the script from your root directory as part of your weather site, we’ll need a different setup … similar to the one I use.

  • Jim

forecast-compare-include.php.txt (44.9 KB)

still more errors…
https://weatheryyc.com/alt/test-fc.php

Yes there sure are, at least we have all the path errors fixed now. I’m not sure what could be causing the errors that we have now. Do you know what version PHP you’re running?

Not a cause of these errors, but you have an extra blank line in your PM log that you can remove using notepad or similar. Meanwhile I need to do some thinking.

  • Jim

Added: Let’s try the attached where I have error reporting turned off. Some newer versions of PHP throw notices etc. that didn’t exist when this code was written.


test-fc.php.txt (2 KB)

that seems to work.

thnak you

You’re very welcome, sorry it took so long. - Jim

I have just one more question.
Where do I change “NW” in the tables to “EC”?

ooops found more errors.

When I try to manually run the cron jobs, I get a ton of errors again

Duh, I should have realized that the error reporting should have been placed in the forecast-compare-include.php file. :oops: Please try the attached which has that now. I did a test on your EV log so you’ll want to clear that out.

Changing any of the text such as “EC” in the display code can be done in the fc-language.php file.

  • Jim

forecast-compare-include.php.txt (45 KB)