Page 1 of 2

some problems with php8.1

Posted: Sun May 01, 2022 2:13 pm
by meteoesine
hi,
justo for info, I tried to update the site to version 8.1 (with 8.0 MT does not work, boh).
maybe Davide already knows but there are some pages that don't work for me:

/pages/station:
climapeIndices.php
graph.php (monthly averages)
reportDaily.php
all PDF reports (daily/monthly/yearly) - (already fixed for version 8 (but on my side they don't work)
/metar/index.php

thanks in advance

Re: some problems with php8.1

Posted: Tue Jul 19, 2022 12:52 pm
by Dehatter
Adding Station Diary and Climate to the list.

In general, it seems anything associated with a PDF fails.

Tom
www.MeckWeather.com

Re: some problems with php8.1

Posted: Mon Aug 15, 2022 4:26 pm
by meteoesine
Ciao,
today I discovered that I had problems with the meteobridge: it was no longer recording data on the database. (restarted MB and everything restarted regularly)
But the problem arises that the offline notification does not work with php8.1:
The current block continues to show the current time and the icon in the footer is also green "online". (and obviously no notification email has be sent)
I noticed the anomaly from the stationStatus block (lastest version 5.1) which was correctly displaying offline.

to add to the to-do list ;-)
tnx

Re: some problems with php8.1

Posted: Mon Aug 15, 2022 10:07 pm
by davidefa
It seems working correctly on your site now

stationstatus01.png
stationstatus01.png (29.17 KiB) Viewed 29540 times

But the image you posted is indeed strange
After a blackout period, the indication at the bottom of the page goes 'online' after the first update of the meteotemplateLive.txt file while the stationStatus block goes 'online' after the first write in the database.
So it is possible, for a few minutes, to have the first indicator 'online' and the second 'offline'.
But the image you posted shows the stationStatus block 'offline' with the indication that the last database write occurred 4' 23" ago ( and this is not correct )

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 6:02 am
by meteoesine
Yes, it works but...
Note, however, that the image has been modified with paint to show you how at about 14:00 I discovered the problem before I restored everything.

Note the interruptions: from your screenshot of last night at 23:50 to now ,there has been other interruptions for a total of 125 minutes (almost every 2 hours there are holes of 30-45 minutes) VERY STRANGE, and no reports of offline.

it will be necessary to understand what causes these interruptions, whether to php8.1, or to meteobridge (but it never happened) or to something else.
and above all that it notifies the offline

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 6:09 am
by meteoesine
Another minor anomaly:
I noticed that since I set for php8.1 evapotranspiration does not report the value at 00:00 the next day

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 7:03 am
by meteoesine
established that it is not meteobridge that loses data

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 7:04 am
by lemimi
Hi there,
I seem to have had the same kind of problem, see the images below for the last 14,10 and 7 days.
My MeteoTemplate runs in PHP 7.4.
On August 11 in the evening, I reloaded a new WU API key.
It seems to work fine since :-)

Have a nice day everyone... Michel
Image

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 7:34 am
by meteoesine
why sometimes it displays meteobridge and other times ecowitt plugin?
Help! what is happening? :shock: :shock:

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 8:07 am
by davidefa
Try updating the api.php script with the attached one.
On line 47 it has a debug option activated ( logging of all calls in cache/apiReqLog.txt ).
Has also a fix in case meteotemplateLive.txt is malformed.

Please send me the meteobridge log 8:00-8:40 so I can take a look if it contains anything 'suspicious'

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 8:31 am
by meteoesine
now I try it
see the meteobridge log, since I restarted it yesterday afternoon.
last operation around 9:00 when I extrapolated the data to check the last missing 30 min

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 8:34 am
by davidefa
meteoesine wrote: Tue Aug 16, 2022 7:34 am why sometimes it displays meteobridge and other times ecowitt plugin?
Help! what is happening? :shock: :shock:
You are using your meteobridge ( calling api.php script directly ) and the ecowitt plugin ( that feeds only indoor T/H/P, soil moisture and lightning ), the stationData block shows the last software signature it finds, so it is normal

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 8:36 am
by davidefa
I mean this logging ( in text form, if possible ): Image

The other log you posted shows that nothing strange was logged by the meteobridge

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 8:47 am
by meteoesine
in allegato

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 10:51 am
by meteoesine
another hole of 30 min

offline e non manda più i dati a meteobridge

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 11:21 am
by meteoesine
it must be a problem due to php 8.1
as soon as I set to 7.4 everything started working again

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 12:47 pm
by Dehatter
I believe if you are using the Ecowitt Plugin and the 'new' api, you should be using a service call to send a http: call to the api.
Screenshot 2022-08-16 084535.jpg
Screenshot 2022-08-16 084535.jpg (28.47 KiB) Viewed 29499 times

I might be wrong about that, but it does work for me.

Tom

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 1:16 pm
by meteoesine
hello Tom,
I am always open to all alternatives ;-)
could you kindly send me the complete details and instructions of the events to be added in the meteobridge?
have you also set php 8.1?
But in the 'weather nets' I guess meteotemplate has to be removed, isn't it?
many thanks in advance

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 2:39 pm
by Dehatter
Yes, I am using PHP 8.1.

I followed the directions from this thread: https://www.wxforum.net/index.php?topic=40447.0

The complete line to be entered is:

http://YOUR-SITE/yourpath-to-the-templa ... api.php?U=[epoch.1:]&T=[th0temp-lastval.1:]&TMX=[th0temp-max5:]&TMN=[th0temp-min5:]&H=[th0hum-lastval.1:]&P=[thb0seapress-lastval:1]&W=[wind0avgwind-lastval=kmh:1]&G=[wind0wind-lastval=kmh:1]&B=[wind0dir-lastval:1]&R=[rain0total-daysum:--]&RR=[rain0rate-lastval:1]&S=[sol0rad-lastval:2]&UV=[uv0index-lastval:1]&TIN=[thb0temp-lastval.1:]&HIN=[thb0hum-lastval.1:]&T1=[th1temp-lastval.1:]&H1=[th1hum-lastval.1:]&SM1=[th20hum-lastval.0:]&SM2=[th21hum-lastval.0:]&SM3=[th22hum-lastval.0:]&SM4=[th23hum-lastval.0:]&SM5=[th24hum-lastval.0:]&L=[lgt0energy-lastval.0:]&PP1=[air0pm-lastval:2]&PP2=[air1pm-lastval:2]&PASS=yourpassword

You have to remove any sensors you do not have.

At the bottom of the "Services" tab, you need to add a service. Select 'HTTP Request' then select 'Periodical" then click add service event.
Screenshot 2022-08-16 101730.jpg
Screenshot 2022-08-16 101730.jpg (11.42 KiB) Viewed 29487 times
You will now see a blank service event.
Screenshot 2022-08-16 102012.jpg
Screenshot 2022-08-16 102012.jpg (21.86 KiB) Viewed 29487 times
You need to pick your frequency to send and add your api call, then click save.

For your reference, this is mine.

http://www.meckweather.com/template/api.php?U=[epoch.1:]&T=[th0temp-lastval.1:]&TMX=[th0temp-max5:]&TMN=[th0temp-min5:]&H=[th0hum-lastval.1:]&P=[thb0seapress-lastval:1]&W=[wind0avgwind-lastval=kmh:1]&G=[wind0wind-lastval=kmh:1]&B=[wind0dir-lastval:1]&R=[rain0total-daysum:--]&RR=[rain0rate-lastval:1]&S=[sol0rad-lastval:2]&UV=[uv0index-lastval:1]&TIN=[thb0temp-lastval.1:]&HIN=[thb0hum-lastval.1:]&SM1=[th20hum-lastval.0:]&L=[lgt0total-dmax.0:]&LD=[lgt0dist-lastval.1:]&LT=[lgt0total-nonzerotime=epoch:]&PASS='password" <-Use your update password

Just so you know, there seems to be a bit a lag using this method as I do not think the MB device places as high a priority on these events - sometimes it will not report for a few seconds and then I get 3 in 10 secs - but overall, I am happy with the results.

Additionally, you are correct to remove Meteotemplate from the "Weather Networks" tab by clicking 'No Upload' and then save.

I do not see the api viewer plugin on your site, but if you use it - the software description would show EcowittNet not Meteobridge.

Screenshot 2022-08-16 103318.jpg
Screenshot 2022-08-16 103318.jpg (41.94 KiB) Viewed 29487 times

Good luck and ask any more question if you need to.

Tom

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 3:12 pm
by Dehatter
Additionally, I have determined that rebooting my Meteobridge device dramatically increases the stability of the calls.

Tom

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 4:10 pm
by davidefa
The logging shows 'ERROR 500 internal server error'.
It could be useful, if you have access to the error log on your server, if you could verify if there is any error in the script api.php
( access to the error log varies, depending on server, on one server of mine every directory has an 'error_log' file, on another there is an entry in the control panel ).

You may also try this version of api.php ( which has additional logging and also error logging in file cache/apiErrorLog.txt, I tested this feature in the last block I wrote )

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 4:20 pm
by meteoesine
thank you very much Tom,
I followed your instructions and you have to say that it works, but...
most probably as I have a lot (maybe too much) events/FTP/and scripts, and as you say, it has a certain (strong) delay, with the execution of this additional event, there is more time when Meteotemplate is offline than the time it is operational.
This is not good for me
I'll go back to the old API with stable php 7.4 waiting for a solution

thanks again for your contribution

Re: some problems with php8.1

Posted: Tue Aug 16, 2022 4:53 pm
by meteoesine
grazie Davide per il tuo 'sbattimento'. grazie davvero.
l'ultima api che mi hai inviato non contiene gli extra sensori quindi ho ripristinato quella precedente
ho rimesso php 8.1 e ho attivato il log degli errori che era disabilitato.
stiamo a vedere

Re: some problems with php8.1

Posted: Thu Aug 18, 2022 7:19 pm
by hcorrin
my host has 8.1.9 on https://www.hc-iom.co.uk/template/indexDesktop.php
the summary block just has the spinning icon
on the forecast block the wxsim fails to load
i have the php8.0 updates on
when i tried to change the default forecast from wxsim to noyr via block setup in admin i got error 504 so that's not working the plugin setup ran ok
i had to do it by editing the settings file in that block manually
these run ok on php8.0.17 running on my synology unit http://ballaugh.no-ip.biz:59202/templat ... esktop.php
there are other issues but these will do to start with

Re: some problems with php8.1

Posted: Thu Aug 18, 2022 9:03 pm
by davidefa
- regarding the summary block here is an updated version (uses yr.no api v2, it is compatible with php 8.1, at leat on my test ): viewtopic.php?f=54&t=2278&p=11393&hilit ... ock#p11431
- regarding the forecast block try rerunning the setup, set 'field separator in latest.csv' and save