cloudy cloudy

Author Topic: WXSIM "EWN-style"  (Read 18609 times)

0 Members and 1 Guest are viewing this topic.

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 791
  • Leuven Belgium CEST
  • OS/Browser:
  • Mac OS X 10.13.3
  • Chrome 64.0.3282.119
    • My private weatherstation
Re: WXSIM "EWN-style"
« Reply #150 on: January 29, 2018, 08:41:13 PM »
Quote from: hila private message
. . . shortened . . .
Now I have made the modification in the data.php file and it works !!!
Now I only need one thing, the graphic ..
I think I have some problem with the Highcharts-custom ...
. . . shortened . . .
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
Code: [Select]
<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
Code: [Select]
<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
Code: [Select]
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.
Code: [Select]
{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),YIt 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
Code: [Select]
$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.
Code: [Select]
$lang= "en" ;  

Wim
« Last Edit: January 29, 2018, 09:16:14 PM by wvdkuil »
Vantage VUE with a WLIP used for https://weer.sluispark.be/
Vantage VP2 with a USB logger/Meteobridge for https://www.weerstation-herent.be/

Offline hila

  • Posts: 5
  • OS/Browser:
  • Win XP
  • Chrome 49.0.2623.112
Re: WXSIM "EWN-style"
« Reply #151 on: January 29, 2018, 09:46:08 PM »
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&gt;

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


Offline blainec

  • Global Moderator
  • Posts: 365
  • Calgary, Ab.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 57.0
    • Weather YYC
Re: WXSIM "EWN-style"
« Reply #152 on: January 31, 2018, 04:44:35 AM »
Same type of problem as above,  but with warnings this time, check http://wxcalgary.com/meteotemplate/wxsim/wxsim/data.php?wunit=kmh&lang=en
Use Chrome => right click => choose inspect => tab console => check for errors.
You can use another browser, it will take different steps to get at the errors. After you solved the problem below, set error reporting to false.

In your case the data.php script is not returning data, at the bottom there should be a large chunk of JSON data.
This is the message: 
Warning: file(../wdUpload/plaintext.txt): failed to open stream:
No such file or directory in /home/wxcalg5/public_html/meteotemplate/wxsim/wxsim/plaintext.php on line 86

It tells us that good old plaintext.php could not load the plaintext.txt file.
Check the link to your plaintext.txt file, it probably is now ../wdUpload/plaintext.txt  => "one step back from the executing script" / "folder wdUpload"

You have to add another ../ to that setting as the file is not  one step back from
http://wxcalgary.com/meteotemplate/wxsim/wxsim/plaintext.php in
http://wxcalgary.com/meteotemplate/wxsim/wdUpload/plaintext.txt but two steps back in
http://wxcalgary.com/meteotemplate/wdUpload/plaintext.txt

Hang in for a while more, it will work as with others,
Wim

Thank you, I have it all working now.

Offline blainec

  • Global Moderator
  • Posts: 365
  • Calgary, Ab.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 58.0
    • Weather YYC
Re: WXSIM "EWN-style"
« Reply #153 on: February 04, 2018, 07:03:20 PM »
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.

Offline i_fiorentino

  • Alessandro Bardi
  • Posts: 1,693
  • 150 mls Candeglia (Pt), Tuscany, Italy
  • OS/Browser:
  • Android 7.0
  • Chrome 64.0.3282.137
    • Meteopistoia.it
Re: WXSIM "EWN-style"
« Reply #154 on: February 10, 2018, 08:57:03 AM »
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:

Quote
<iframe src="http://www.meteopistoia.it/short.php" frameBorder="0" style="border: none; overflow: hidden; width:100%; height:221px;"></iframe>

Offline blainec

  • Global Moderator
  • Posts: 365
  • Calgary, Ab.
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 58.0
    • Weather YYC
Re: WXSIM "EWN-style"
« Reply #155 on: February 12, 2018, 06:35:29 AM »
Thanks for the tip, works great

Offline i_fiorentino

  • Alessandro Bardi
  • Posts: 1,693
  • 150 mls Candeglia (Pt), Tuscany, Italy
  • OS/Browser:
  • Android 5.0.2
  • Chrome 64.0.3282.137
    • Meteopistoia.it
Re: WXSIM "EWN-style"
« Reply #156 on: February 13, 2018, 12:04:59 AM »
Thanks for the tip, works great

You're welcome  :)

Offline hrvistaweather

  • Posts: 263
  • Franklin, Huon Valley Southern Tasmania
  • OS/Browser:
  • Win NT 6.3
  • Chrome 66.0.3359.139
    • Huon River Vista Weather - South Franklin - Tasmania
Re: WXSIM "EWN-style"
« Reply #157 on: May 09, 2018, 11:57:14 PM »
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
Quote
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
« Last Edit: May 10, 2018, 12:40:21 AM by hrvistaweather »
Tony

Davis Vantage Pro 2 Plus - FARS, Cumulus MX, 2 Soil Temp/Moist Solar/Rad.
Back Online : 2017-11-01

Offline i_fiorentino

  • Alessandro Bardi
  • Posts: 1,693
  • 150 mls Candeglia (Pt), Tuscany, Italy
  • OS/Browser:
  • Win NT 10.0
  • Chrome 66.0.3359.181
    • Meteopistoia.it
Re: WXSIM "EWN-style"
« Reply #158 on: May 21, 2018, 08:52:22 PM »
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
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 :(

Offline dwa128

  • Posts: 3
  • OS/Browser:
  • Mac OS X 10.12.0
  • Chrome 67.0.3396.99
Re: WXSIM "EWN-style"
« Reply #159 on: July 29, 2018, 04:24:58 AM »
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.

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 791
  • Leuven Belgium CEST
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 67.0.3396.99
    • My private weatherstation
Re: WXSIM "EWN-style"
« Reply #160 on: July 29, 2018, 07:41:57 AM »
@dwa128
Quote
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 errors 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):
Code: [Select]
<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><br />
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
« Last Edit: July 30, 2018, 06:37:51 AM by wvdkuil »
Vantage VUE with a WLIP used for https://weer.sluispark.be/
Vantage VP2 with a USB logger/Meteobridge for https://www.weerstation-herent.be/

Offline hrvistaweather

  • Posts: 263
  • Franklin, Huon Valley Southern Tasmania
  • OS/Browser:
  • Win NT 6.3
  • Chrome 67.0.3396.99
    • Huon River Vista Weather - South Franklin - Tasmania
Re: WXSIM "EWN-style"
« Reply #161 on: July 30, 2018, 03:01:04 AM »
Hi Wim,

Long speak no time, hope you are well.

Maybe :
Quote
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 :
Quote
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,
Tony

Davis Vantage Pro 2 Plus - FARS, Cumulus MX, 2 Soil Temp/Moist Solar/Rad.
Back Online : 2017-11-01

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 791
  • Leuven Belgium CEST
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 67.0.3396.99
    • My private weatherstation
Re: WXSIM "EWN-style"
« Reply #162 on: July 30, 2018, 06:46:09 AM »
@hrvistaweather
Thank you  =D&gt;, 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
Vantage VUE with a WLIP used for https://weer.sluispark.be/
Vantage VP2 with a USB logger/Meteobridge for https://www.weerstation-herent.be/

Offline hrvistaweather

  • Posts: 263
  • Franklin, Huon Valley Southern Tasmania
  • OS/Browser:
  • Win NT 6.3
  • Chrome 67.0.3396.99
    • Huon River Vista Weather - South Franklin - Tasmania
Re: WXSIM "EWN-style"
« Reply #163 on: July 30, 2018, 07:38:58 AM »
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,
Tony

Davis Vantage Pro 2 Plus - FARS, Cumulus MX, 2 Soil Temp/Moist Solar/Rad.
Back Online : 2017-11-01

Offline dwa128

  • Posts: 3
  • OS/Browser:
  • Mac OS X 10.12.0
  • Chrome 67.0.3396.99
Re: WXSIM "EWN-style"
« Reply #164 on: July 30, 2018, 12:14:11 PM »
I suspect he's busy with work.
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!