some problems with php8.1

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

some problems with php8.1

Post by meteoesine » Sun May 01, 2022 2:13 pm

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
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: some problems with php8.1

Post by Dehatter » Tue Jul 19, 2022 12:52 pm

Adding Station Diary and Climate to the list.

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

Tom
www.MeckWeather.com
Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: some problems with php8.1

Post by meteoesine » Mon Aug 15, 2022 4:26 pm

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
Attachments
ScreenShot01099.jpg
ScreenShot01099.jpg (84.87 KiB) Viewed 3095 times
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: some problems with php8.1

Post by davidefa » Mon Aug 15, 2022 10:07 pm

It seems working correctly on your site now

stationstatus01.png
stationstatus01.png (29.17 KiB) Viewed 3088 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 )
Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: some problems with php8.1

Post by meteoesine » Tue Aug 16, 2022 6:02 am

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
Attachments
ScreenShot01106.jpg
ScreenShot01106.jpg (15.27 KiB) Viewed 3083 times
Last edited by meteoesine on Tue Aug 16, 2022 6:35 am, edited 1 time in total.
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: some problems with php8.1

Post by meteoesine » Tue Aug 16, 2022 6:09 am

Another minor anomaly:
I noticed that since I set for php8.1 evapotranspiration does not report the value at 00:00 the next day
Attachments
ScreenShot01104.jpg
ScreenShot01104.jpg (34.29 KiB) Viewed 3082 times
ScreenShot01103.jpg
ScreenShot01103.jpg (53.5 KiB) Viewed 3082 times
ScreenShot01105.jpg
ScreenShot01105.jpg (21.42 KiB) Viewed 3082 times
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: some problems with php8.1

Post by meteoesine » Tue Aug 16, 2022 7:03 am

established that it is not meteobridge that loses data
Attachments
ScreenShot01107.jpg
ScreenShot01107.jpg (13.3 KiB) Viewed 3075 times
ScreenShot01108.jpg
ScreenShot01108.jpg (43.96 KiB) Viewed 3075 times
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

User avatar
lemimi
Advisor
Advisor
Posts: 86
Joined: Wed Dec 12, 2018 3:31 pm
Location: France - Normandie
Station model: Brandson 304557
Contact:

Re: some problems with php8.1

Post by lemimi » Tue Aug 16, 2022 7:04 am

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

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: some problems with php8.1

Post by meteoesine » Tue Aug 16, 2022 7:34 am

why sometimes it displays meteobridge and other times ecowitt plugin?
Help! what is happening? :shock: :shock:
Attachments
ScreenShot01110.jpg
ScreenShot01110.jpg (19.13 KiB) Viewed 3070 times
ScreenShot01106.jpg
ScreenShot01106.jpg (18.93 KiB) Viewed 3070 times
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: some problems with php8.1

Post by davidefa » Tue Aug 16, 2022 8:07 am

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'
Attachments
api_php8.1.zip
(11.92 KiB) Downloaded 61 times
Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: some problems with php8.1

Post by meteoesine » Tue Aug 16, 2022 8:31 am

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
Attachments
ScreenShot01111.jpg
ScreenShot01111.jpg (110.91 KiB) Viewed 3066 times
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: some problems with php8.1

Post by davidefa » Tue Aug 16, 2022 8:34 am

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
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: some problems with php8.1

Post by davidefa » Tue Aug 16, 2022 8:36 am

I mean this logging ( in text form, if possible ): Image

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

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: some problems with php8.1

Post by meteoesine » Tue Aug 16, 2022 8:47 am

in allegato
Attachments
standard-iso-202208160800-202208160840-min5.zip
(477 Bytes) Downloaded 54 times
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: some problems with php8.1

Post by meteoesine » Tue Aug 16, 2022 10:51 am

another hole of 30 min

offline e non manda più i dati a meteobridge
Attachments
ScreenShot01115.jpg
ScreenShot01115.jpg (22.78 KiB) Viewed 3056 times
ScreenShot01114.jpg
ScreenShot01114.jpg (57.54 KiB) Viewed 3057 times
ScreenShot01113.jpg
ScreenShot01113.jpg (4.88 KiB) Viewed 3059 times
Last edited by meteoesine on Tue Aug 16, 2022 11:21 am, edited 1 time in total.
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: some problems with php8.1

Post by meteoesine » Tue Aug 16, 2022 11:21 am

it must be a problem due to php 8.1
as soon as I set to 7.4 everything started working again
Attachments
ScreenShot01117.jpg
ScreenShot01117.jpg (5.92 KiB) Viewed 3055 times
ScreenShot01116.jpg
ScreenShot01116.jpg (18.99 KiB) Viewed 3055 times
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: some problems with php8.1

Post by Dehatter » Tue Aug 16, 2022 12:47 pm

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 3047 times

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

Tom
Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: some problems with php8.1

Post by meteoesine » Tue Aug 16, 2022 1:16 pm

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
Attachments
ScreenShot01118.jpg
ScreenShot01118.jpg (15.88 KiB) Viewed 3044 times
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: some problems with php8.1

Post by Dehatter » Tue Aug 16, 2022 2:39 pm

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 3035 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 3035 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 3035 times

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

Tom
Image

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: some problems with php8.1

Post by Dehatter » Tue Aug 16, 2022 3:12 pm

Additionally, I have determined that rebooting my Meteobridge device dramatically increases the stability of the calls.

Tom
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: some problems with php8.1

Post by davidefa » Tue Aug 16, 2022 4:10 pm

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 )
Attachments
api_php8.1.zip
(12.26 KiB) Downloaded 53 times
Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: some problems with php8.1

Post by meteoesine » Tue Aug 16, 2022 4:20 pm

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
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: some problems with php8.1

Post by meteoesine » Tue Aug 16, 2022 4:53 pm

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
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

hcorrin
Observer
Observer
Posts: 40
Joined: Tue Sep 05, 2017 10:55 am
Location: Ballaugh
Station model: Davis VP2
Software: Weather Display
Contact:

Re: some problems with php8.1

Post by hcorrin » Thu Aug 18, 2022 7:19 pm

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
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: some problems with php8.1

Post by davidefa » Thu Aug 18, 2022 9:03 pm

- 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
Image

Post Reply