Forecast EwnWxsim

Hi friends

I’ve seen a folder on my hosting EwnWxsim that I understand is a Wxsim prediction in a format similar to Ewn. However, I can’t get it to work. I’ve tried to contact the developer but it hasn’t been possible

Does anyone have it working?

Thanks

Strange story. Does it really show up in your hosting environment without you doing anything?
Or did you find a link to the download?

Dozens of topics about this and other “Henkka / nordic Weather” scripts.

A recent EWN/WXSIM/php8 version can be downloaded from this topic on this forum

Also this is an user-example of the EWN script


There is a very strong search function on this forum at the top-right of any page.

They have helped me from the beginning in setting up the website. It is likely that this person put the folder there, I cannot say for sure.

I have downloaded the zip that they indicated and now I have to configure it. I don’t know if I will be able to do it alone, since I am short on knowledge.

For now the only thing I have done is configure these three lines in config.php

$path_to_langfiles = "./wxsim-ewn/lang/";
$path_to_lastret = "../lastret.txt";
$path_to_dataphp = "./wxsim-ewn/";

But it is evident that it still does not work:

https://www.meteoensevilla.es/wxsim-ewn/forecast.php

I am not at all clear on how to make it work. In the readme it mentions wret.jpg but I do not see that image.

Thank you very much

wret.exe is another WxSim application to look at old forecasts and it can probably produce wret.jpg. wret isn’t run by default but I think you’ll need to run it to generate the JPG file and then upload the image.

1 Like

Your first problem to solve: Your lastret.txt file has no data at the hour
This script only accepts data at the full hour11:00 12:00 as.o.
You have to set your WXSIM so that it generates the data on the hour and not 2 minutes after.

You can then ask questions on this forum.
But these scripts are complex, so find “local” same language help if you get stuck.

WXSIM - Retrieved Data for San Juan de Aznal.  37,36  6,03  82  Dec 7   2024 11:02a (local standard time)                                                                                                  
Dec 7  ---------------------------------------------------------------------------------------       
                                          Saturday                                                                                                                                                       
  TIME      WEATHER        AIR   DEW   WET   WCF   850T W.DIR VST  W.SP %RH  S.IR WDIR THK                                                                  TSCD DATE/TIME
 
11:02a CLEAR    HEAVY DEW  55,6  51,9  53,6  55,6  50,1  360   92    1   88  317  N    5606                                                                    0 2024-12-07_10:02_UTC
No shower or thunderstorm activity expected...............................................           
11:32a CLEAR    HEAVY DEW  57,4  52,8  54,8  57,4  51,2  360   91    1   84  365  N    5612                                                                    0 2024-12-07_10:32_UTC
12:02p CLEAR    MOD. DEW   59,5  53,3  56,0  59,5  52,4  360   90    1   80  401  N    5620                                                                    0 2024-12-07_11:02_UTC
12:32p SUNNY               61,9  53,6  57,1  61,9  53,7  360   90    2   74  422  N    5628                                                                    0 2024-12-07_11:32_UTC
 1:02p SUNNY               63,8  53,7  57,9  63,8  55,0  360   89    2   70  430  N    5635                                                                    0 2024-12-07_12:02_UTC
 1:32p M.SUNNY             65,4  53,7  58,6  65,4  54,9  360   88    3   66  424  N    5635                                                                    0 2024-12-07_12:32_UTC

Second problem you have to solve.
You can test in “test-mode” with this link:

https://www.meteoensevilla.es/wxsim-ewn/_test.php
Error returned:

<b>Fatal error</b>:  Uncaught Error: Call to undefined function mb_detect_encoding() in /var/www/html/wxsim-ewn/wxsim/frc.php:254
Stack trace:
#0 /var/www/html/wxsim-ewn/wxsim/frc.php(47): html2utf8()
#1 /var/www/html/wxsim-ewn/wxsim/config.php(292): include('...')
#2 /var/www/html/wxsim-ewn/forecast.php(6): include('...')
#3 /var/www/html/wxsim-ewn/_test.php(5): include('...')
#4 {main}
  thrown in <b>/var/www/html/wxsim-ewn/wxsim/frc.php</b> on line <b>254</b><br />

You have to contact your hosting provider as you are missing mb_detect_encoding which is a PHP-unctionality.

or
You could comment that line for now 254 in wxsim-ewn/wxsim/frc.php It now reads
if(mb_detect_encoding($name, 'UTF-8', true)){$name=utf8_decode($name);}
change it to
# if(mb_detect_encoding($name, 'UTF-8', true)){$name=utf8_decode($name);}

Wim

The wret screenshot shows the items used.
Sadly WXSIM evolves so the image is not “exactly or correct” for recent versions.

Hello again Wim, I know that it can be frustrating to help people with little knowledge, I understand.

In my language there are no forums where this configuration can be discussed, it’s a shame.

I have indeed noticed that the configuration of the wxsim output file always gives me 2 minutes after the time. I don’t think I have modified any wxsim option for this to happen. The execution of wxsimate is 10 minutes after the time and 15 minutes in the case of wxsim.

I think I have fixed the mb_detect_encoding error with sudo apt-get install php8.4-mbstring since the web runs under a VPS with Ubuntu Server. However, now other errors are generated.

I have configured wret. as the screen you attached.

If you have patience with me I think we will succeed.

Greetings

<b>Deprecated</b>: Function utf8_decode() is deprecated since 8.2, visit the php.net documentation for various alternatives in <b>/var/www/html/wxsim-ewn/wxsim/frc.php</b> on line <b>254</b><br />
Those other messages are not errors. Of no importance now, just a message for the script author to adept the php code to remain compatible.

Please post a new topic with the heading
“How to set WXSIM to generate the data at a full hour”
Probably someone will tell you which setting to adept in wxsim.

Otherwise ask the author of wxsim. You paid good money for that product and I am sure the author can help you.

As soon as the data is correct and available we can make the HENKKA scripts run OK.

Step 1: The settings in config.php should be changed to

$path_to_langfiles = "./wxsim/lang/";
$path_to_lastret = "../lastret.txt";    # need to check this one later
$path_to_dataphp = "./wxsim/";

Succes,
Wim

I’ve just looked through the settings and don’t see anything that can adjust the output times. I’ve only ever known them to be on the hour, or at 30 minute intervals (on the hour and 30 minutes past the hour) if you have that option selected.

OK, the data is now available “on the hour”

Sadly a new fatal error in wxsim/data.php

Fatal error: Uncaught ValueError: max(): Argument #1 ($value) must contain at least one element in /var/www/html/wxsim-ewn/wxsim/data.php:218 
Stack trace: 
#0 /var/www/html/wxsim-ewn/wxsim/data.php(218): max() 
#1 /var/www/html/wxsim-ewn/wxsim/data.php(184): getdaily() 
#2 /var/www/html/wxsim-ewn/wxsim/_test.php(5): include('...') 
#3 {main} thrown in /var/www/html/wxsim-ewn/wxsim/data.php on line 218

EDIT Dec 8 - 11:30 UTC removed fake error

I will copy your data files and see if I can find a cause for this.

Wim

When using your data at my own site, all works OK.
Check screenshot.

It is not working on your site, there can be at least two causes for that.

  1. You are running PHP 8.4.1 , maybe there are new modifications necessary
  2. Your version of the EWN scripts is not “up-to-date” as you seem to have found those scripts, you did not not download them recently.
  3. The lastret setting in wxsim/config.php sometimes needs a full path similar to $path_to_lastret = "/Users/willemva. . . . ther230/lastret.txt";
  4. or something we currently do not know.

To further dig into this, you have to ask yourself if it is worth the time to do so.
You already have a running and supported wxsim forecast

To get the path to lastret correct:
path.txt (27 Bytes)
It is a line script <?php echo realpath('./');

  1. Copy this file to the root of your website where you uploaded the lastret.txt files a.s.o.
  2. Change the name from path.txt to path.php
  3. Execute this script https://www.meteoensevilla.es/path.php
  4. copy the displayed text to the setting $path_to_lastret in config.php

That should look as

$path_to_lastret = “/all kind / of / text/lastret.txt”;

Wim

Hi Wim

Well, all those errors may have a cause, yesterday I was messing around with the configuration of WXSIM and WXSIMATE to see if I could set the hour to the hour as you indicated. I discovered that when I set the option to import data from weather display wxsimate indicated “effective time” at the hour.

Paradoxically this morning wxsimate had generated an exception error, it does this occasionally when working with the WD database. That is why I had to re-set it with the Weatherlink database with which it never fails.

I recently downloaded the script from the link you indicated. I just copied and ran the script and modified config.php to

$path_to_lastret = “/var/www/html/lastret.txt”;

Although I understand that as it was by default it was also correct.

The problem is that I have to solve the time issue. I’ve seen something on the forum that might help me

I’d like to keep trying, I have other WXSIM predictions as you mentioned, but I like EWN’s style.

Thanks for your help

1 Like

I don’t understand it, it’s apparently working:

https://www.meteoensevilla.es/wxsim-ewn/_test.php

We’ll keep watching it in the next update

Yes, because you have uploaded the latest version.
The :02 minutes are replaced by a modification I inserted in the latest version you downloaded.
Line 21-22 in wxsim/data.php removes the most common minutes around the full-hour with a :00 value

$wxd = file_get_contents($path_to_lastret);  
$from1= array (':51',':52',':53',':54',':55',':56',':57',':58',':59',':01',':02',':03',':04',':05',':06',':07',':08',':09');
$wxd =  str_replace ( $from1,':00',$wxd);   #echo __LINE__.$wxd; exit;

So it will work without much problems, just the PHP 8.x notices/warnings

I attach two updated scripts to remove those notices and warnings.
Make a copy of the two scripts in the wxsim folder and replace them with the new versions.
move_to_wxsim-ewn-wxsim_folder2024-12-08.zip (11.8 KB)

Then using _test.php should not list any errors.

Wim

1 Like

Indeed, the error is no longer generated. Apart from having uploaded the latest version, I suspect that the correct path to lastret is now also indicated, I’m not sure that it was correctly indicated before.

The next step is the translation. In the root I have plaintext-parser-lang-es.txt so I think the correct thing would be in config.php

$path_to_langfiles = “/var/www/html”;

I’m not sure that by including it in the template saratoga will do the translation.

You should copy the language file to the other language files in wxsim-ewn/wxsim/ folder.
Than you should test with https://www.meteoensevilla.es/wxsim-ewn/_test.php?lang=es
It works for french, german, dutch, finish also

Your es language should work OK also.

The translations are done by scripts. So the wxsim-ewn scripts will do it for every language file they can find.

Wim

Jumm, strange, I copied plaintext-parser-lang-es.txt as is and errors are generated in that instruction, however the test works fine with other languages. The lines in my file say:

lang|Hot|Calor|
lang|Very hot|Mucho calor
lang|Cloudy in the morning|Nuboso por la mañana|

And in the other language files langlookup instead of lang.

Could that be why? It would be strange since it works in other predictions on my website.

Thanks

Is that line missing the final | character?

1 Like