WXSIM "EWN-style"

Hi all,

I had the same problems but in one or another way I had it running. :slight_smile:
Very good explanations, Wim thanks.

What I still could not manage is the date at update (bijgewerkt) still 01/01/1970 (cannot find I suppose) see att.
http://www.weersverwachtingen.eu/clientraw/wd-ajax-ml/wxsim_ewn.php

Can you please give me a hint, Wim ?

Thanx so far !


The above postings are based on visible errors (in any browser) and the well known date:minutes-problem already discussed dozens of times in multiple WXSIM threads on this forum

Your problem is different. Your problem comes from somewhere inside the scripts. With this invalid date format (01-01-1970 is a date based on a zero) I can not help as I do not have the scripts myself.

Sorry,
Wim

Ok will search for it.

Thanks anyway !

OK it seems to be another problem.
The path to the lastret.txt in config.php MUST be a full path, not a relative path as it is used by different scripts at different levels in the WXSIM folder/scripts tree. After your last server-switch you probably used relative addressing, but for that “update date/time” full addressing is needed.

I attach a smal program.

<?php
echo getcwd()."/";
?>

Unzip and put it in the same folder as your lastret.txt file, which is the root in your case.
Run it once and it will display the correct full path to the folder where lastret.txt is stored.
Modify config.php to have that exact path, probably

$path_to_lastret = "/var/www/clients/client15257/web8393/web/lastret.txt";

Succes,
Wim


hardpath.php.zip (577 Bytes)

Thanks that works !

Helemaal top, Wim =D>

Thanks for you pm
It works now almost, but there is a problem with the translations. Highcharts needs those. I tested with the standard languages.

For now, check the generated source of your script: http://meteohila2.esy.es/wxsim1/forecast.php nearly at the bottom

<script>
 name="Xert, Valenciana",lang="en",tzabb = "Europe/Madrid",version=2017.03,ewnpath="./wxsim/",latitude=40.52;
  var days = null,months = null;
  var temptxt="TEMP",barotxt="BARO",prectxt="PRECIP",windtxt="WIND",dewtxt="DEWP",snowtxt="SNOB",feeltxt="FEELS",tstxt="TSPROB",humtxt="HUMIDITY",gusttxt="GUST",rratetxt="RRATE",txtgust="GUST",txtmidnightsun="MIDNIGHTSUN",txtpolarnight="POLARNIGHT";
  var snowset="cm",baroset="hPa",wiset="kmh",piset="mm",tiset="c";
</script>

it is missing essential translated texts, this is how it should look

<script>
name="Xert, Valenciana",lang="en",tzabb = "Europe/Madrid",version=2017.03,ewnpath="./wxsim/",latitude=40.52;
  var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
  var temptxt="Temperature",barotxt="Pressure",prectxt="Precipitation",windtxt="Wind",dewtxt="Dewpoint",snowtxt="SNOB",feeltxt="Feels like",tstxt="TS-prob.",humtxt="Humidity",gusttxt="Gust",rratetxt="RRATE",txtgust="Gust",txtmidnightsun="Midnight Sun",txtpolarnight="Polar Night";
  var snowset="cm",baroset="hPa",wiset="kmh",piset="mm",tiset="c";
</script>

Highcharts can not draw the graphs as the array for day-names is empty. These are the errors on the inspect console

ncaught TypeError: Cannot read property '2' of null
    at qa (highcharts-custom-4.2.0.js:29)
    at ra (highcharts-custom-4.2.0.js:18)
    at Object.defaultLabelFormatter (highcharts-custom-4.2.0.js:111)
    at Xa.addLabel (highcharts-custom-4.2.0.js:96)
    at new Xa (highcharts-custom-4.2.0.js:21)
    at highcharts-custom-4.2.0.js:136
    at Array.forEach (<anonymous>)
    at t (highcharts-custom-4.2.0.js:32)
    at L.Axis.getOffset (highcharts-custom-4.2.0.js:136)
    at highcharts-custom-4.2.0.js:209

This is related to the empty names arrays.

{a:q[g].substr(0,3),A:q[g],d:Ta(h),e:h,w:g,b:m.shortMonths[k],B:m.months[k],m:Ta(k+1),y:l.toString().substr(2,2),Y

It is getting late so i will check tomorrow. Somewhere the link tothe correct langs is lost, need a clear head to find it.

SUCCES: I think I found it.
Your webserver is set to probably Es as language.
The script detects that and set the language to whatever the server has in config.php

$query=$_SERVER["QUERY_STRING"];
$q=explode("|",$query);
if(preg_match("|\||",$query)){
  $lang=$q[0];
}

But that language is not supported in the rest of the script lines 71-280, so the arrays are not filled with the month-names as they are for fi, sv,se,da,dk,de,nl,it and en.

So add the following text at the empty line 70 and test for the next problem, if there is any.

 $lang= "en" ; 

Wim

Perfect, working !!!

Thank you very much Wim !!! For all your patience and explanations, it has been of great help to me, if it had not been for you I would not have achieved it … =D>

http://meteohila2.esy.es/wxsim1/forecast.php

Thank you, I have it all working now.

Just curious. Has anyone actually put the short.php in a Meteotemplate block? I have been trying for a while now but can’t seem to get it to work.

Yes sure!
Take a look here: http://www.meteopistoia.it

Just put an iframe on default block page like this:

Thanks for the tip, works great

You’re welcome :slight_smile:

Hi Henkka,

Hope you are well.
I have had a NaN issue displaying Precip an the Overview page this week, rainfall forecast has changed daily per run from over 200 mm to now over 60 mm.
However Overview page continues to show NaN mm. https://southfranklinweather.com/wxsim/forecast.php

I’ve search the files for a culprit, though can’t find the cause. Would you have any ideas. ?

Below screenshots of old 3 in 1 workin fine and EWN-Style in NaN mm.
Also below is excerpt of same period in plaintext.txt

Tonight: Dense overcast. Rain likely. Breezy. Low 7, but temperatures rising after midnight. Wind south-southeast around 23 kph, gusting to 35 kph. Chance of precipitation 80 percent. Precipitation mostly over 60 mm. Minimum snow level 150 meters above sea level.

I feel it maybe something to do with the “over 60 mm”.

Kind regards,
Tony


Same thing here Tony.
I’ve sent an email to Henrik about this issue but without lucky :frowning:

Hi all,
I’ve downloaded the EWN-style script on to my website, read the “README.txt” file and configured the wxsim/config.php file to link to my folders as indicated.

But the forecast.php script is absolutely filled with errors, and doesn’t load any data. Setting error reporting off on my scripts results in an “internal server error” if I try to load any of the pages.

Forecast page is listed here:
http://aspgweather.com/townsville/wxsim/v5/forecast.php

As you can see, all I’m getting is all of this:
Notice: Use of undefined constant lang - assumed ‘lang’ in /home/aspgweat/public_html/townsville/wxsim/v5/wxsim/config.php on line 62

Notice: Use of undefined constant ewnwunit - assumed ‘ewnwunit’ in /home/aspgweat/public_html/townsville/wxsim/v5/wxsim/config.php on line 285

Notice: Undefined variable: uploadupdate in /home/aspgweat/public_html/townsville/wxsim/v5/wxsim/frc.php on line 24

Notice: Use of undefined constant lang - assumed ‘lang’ in /home/aspgweat/public_html/townsville/wxsim/v5/wxsim/frc.php on line 43

Notice: Use of undefined constant ewnwunit - assumed ‘ewnwunit’ in /home/aspgweat/public_html/townsville/wxsim/v5/wxsim/frc.php on line 56

Notice: Undefined variable: ewnfooter in /home/aspgweat/public_html/townsville/wxsim/v5/wxsim/frc.php on line 73

Notice: Use of undefined constant SNOB - assumed ‘SNOB’ in /home/aspgweat/public_html/townsville/wxsim/v5/wxsim/frc.php on line 90

Notice: Use of undefined constant RRATE - assumed ‘RRATE’ in /home/aspgweat/public_html/townsville/wxsim/v5/wxsim/frc.php on line 90

Notice: Undefined variable: alt in /home/aspgweat/public_html/townsville/wxsim/v5/wxsim/frc.php on line 99

Notice: Use of undefined constant COMPAREDESC - assumed ‘COMPAREDESC’ in /home/aspgweat/public_html/townsville/wxsim/v5/wxsim/frc.php on line 236

Not sure why the script is filled with so many errors straight out of the box! It looks great, but it seems poorly designed to have so many errors when you first download it.

@dwa128

But the forecast.php script is absolutely filled with errors, . . . Not sure why the script is filled with so many errors
First of all, I am not the script writer. Second these are not [b]errors[/b] but notices, they should be switched off in your webserver by default.

The wxsim script finished all init stuff. => OK
The javascript wxsim_frc_2017.js?2017.03 starts to load the data http://aspgweather.com/townsville/wxsim/v5/wxsim//data.php?wunit=kmh&lang=en => OK
data.php script loads your config.php => OK
Again a few notices, same as with the forecast.php script. => OK, but we should switch off the “notice” reporting also in data.php
The sunmoon.php is loaded and then there is a new error (at least to me):

<b>Parse error</b>:  syntax error, unexpected T_OBJECT_OPERATOR in 
<b>/home/aspgweat/public_html/townsville/wxsim/v5/wxsim/sunmoon.php</b> on line <b>32</b>

I can not check why this happens as I have no access to the contents of that config.php so please zip it and attach it to your post.
Also this error sometimes occurs when running a old version of PHP, what is your version?

===

Your http://aspgweather.com/townsville/wxsim/v5/forecast.php displays Updated: 14.03.2017 04:08
That lastret.txt which is used by the script is not yours, it is the test version in the wxsim downloaded folder.

Wim

Hi Wim,

Long speak no time, hope you are well.

Maybe :

The https://southfranklinweather.com/wxsim/forecast.php displays Updated: 14.03.2017 04:08 That lastret.txt which is used by the script is not yours, it is the test version in the wxsim downloaded folder.

Was meant to be :

The http://aspgweather.com/townsville/wxsim/v5/forecast.php displays Updated: 14.03.2017 04:08 That lastret.txt which is used by the script is not yours, it is the test version in the wxsim downloaded folder.

Kind regards,

@BeaumarisWX
Thank you =D>, I adapted the post for that error. I was looking for users in the same region to find the cause of the error. And I left your and mine forecast wide open to compare to the Burdell, QLD one. And then I copied the wrong URL. Must be a very good eyesight, to catch the DST WXSIM errors and this wrong link.

The error must be something with the user settings / location-specific settings as I tested with similar cities/timezones for the east of AU but the error did not occur.

Will wait to see if @dwa128 find time to post the settings.

Wim

Hi Wim,

:lol: The eyes are getting worse as the years drag on matey.

I sent @dwa128 a PM on Sunday thought not had a reply, I suspect he’s busy with work.

Yes the main issue is with the paths, they do that if they are not correct, took me a while ages ago to fix.

It becomes confusing if I post mine as they would differ greatly, so hopefully he gets back to you.

kind regards,

Spot on! Very hard to find any free time at the moment

Thank you all for the help!
I updated the version of my PHP, and disabled error reporting on the data.php file and everything is now working as I had hoped!