Weather sticker for PWS Dashboard

The setup.php you sent me is OK.
I only replaced the link for the fontFace with the correct path.
I tested it with PHP 8.2.0 (internal server) and PHP 8.2.14 (public website)
Works OK

https://pwswd.be/stickersPWS/stickerdigit.php


Now please check the permissions of the icons in the stickersPWS/station-icon/ folder
Set those to 777 or similar


If it is not working in your setup you have to find the PHP error log.
Often logs are in wwwroot or public_html, often in a separate folder.
They have a name like xxxphp_8.2-error.log

Try to find the lines with PHP Fatal error

Succes,
Wim

I have all the folder and files in 777.
I donā€™t have any php error log. Modify .htaccess
for error logs and they still do not appear

I donā€™t understand anything
htaccess.zip (248 Bytes)

Something similar happens to me here too. 95% of my results are blank with error 500.

All the others work:

Thanks that helped
These are the last lines of your error-log https://meteodosrius.es/stickersPWS/error_log.txt

[23-Apr-2024 17:21:12 Europe/Madrid] PHP Warning:  imagecreatefrompng(flags/sp.png): Failed to open stream: No such file or directory in /home/u797566621/domains/meteodosrius.es/public_html/stickersPWS/sticker.php on line 163
[23-Apr-2024 17:21:12 Europe/Madrid] PHP Stack trace:
[23-Apr-2024 17:21:12 Europe/Madrid] PHP   1. {main}() /home/u797566621/domains/meteodosrius.es/public_html/stickersPWS/sticker.php:0
[23-Apr-2024 17:21:12 Europe/Madrid] PHP   2. imagecreatefrompng($filename = 'flags/sp.png') /home/u797566621/domains/meteodosrius.es/public_html/stickersPWS/sticker.php:163
[23-Apr-2024 17:21:12 Europe/Madrid] PHP Fatal error:  Uncaught TypeError: imagealphablending(): Argument #1 ($image) must be of type GdImage, bool given in /home/u797566621/domains/meteodosrius.es/public_html/stickersPWS/sticker.php:164
Stack trace:
#0 /home/u797566621/domains/meteodosrius.es/public_html/stickersPWS/sticker.php(164): imagealphablending()
#1 {main}
  thrown in /home/u797566621/domains/meteodosrius.es/public_html/stickersPWS/sticker.php on line 164

There is a missing sp.png in the . . /stickersPWS/flags/ folder
Generates a PHP Fatal error:

Uncaught TypeError: imagealphablending() Argument #1 ($image) must be of type GdImage, bool given

For test.
Copy just another flag and rename that to sp.png.
Lets see if that is the final error.

Wim

Error-log: https://meteodosrius.es/dosrius/error_log.txt
33 similar fatal errors

PHP Fatal error:  Uncaught DivisionByZeroError: 
Division by zero in /home/u797566621/domains/meteodosrius.es/public_html/dosrius/CU-defs.php:370

Yes, now the error_logs have appeared.
I put the ā€œlittle flagā€ and it works.
You are a machine (Spanish means that you are very professional).
:wink:

Hi,
Iā€™m very sorry that I wasnā€™t able to take part in the conversation to resolve this issue, unfortunately Iā€™m very busy and canā€™t access my PC often. Luckily we have the great Wim. Thanks so much Wim

1 Like

tried this again tonight after some months https://www.hc-iom.co.uk/stickersPWS/stickerdigit.php worked first go after reload on to server but now all i get is after a while is error 500 and this from server log

[Tue Apr 23 22:09:39.874690 2024] [fcgid:warn] [pid 80836] [client 92.39.196.63:42451] mod_fcgid: read data timeout in 60 seconds
[Tue Apr 23 22:09:39.874731 2024] [core:error] [pid 80836] [client 92.39.196.63:42451] End of script output before headers: php82-cgi
appears to do the same on all 3

does the same on local server but no logs i can see, but appears to shoe compact ok stickercompact.php (350Ɨ170) (ballaugh.no-ip.biz)
undated to latest version as well
both servers are running versions of 8.2 php

Maybe because there is no iom flag in your flags folder.
You set your language in PWS_Dashboard ā†’ _my_settings/languages.txt
to ā€œen-iomā€
The flag used will be ā€œiomā€
There is an im flag ā†’ https://www.hc-iom.co.uk/stickersPWS/flags/im.png

Copy and rename the im.flag in stickersPWS/flags/ to iom.png and all will work.

Succes,
Wim

1 Like

Ok that got my local working http://ballaugh.no-ip.biz:59202/stickersPWS/stickerdigit.php
Needs a few tweaks but will sort this evening once laptop is wound up and then sort main site
Thanks Wim

updated the flag but also had to update file permissions to 755 for the folder and contents
first run still gives internal server error but now if the page is refreshed after the error shows the sticker shows up

the error log is still showing the same error as posted before

Hello!
Iā€™m trying to get the stickers up and running and I canā€™t, Iā€™ve followed the instructions exactly but they donā€™t work. The PWS dashboard works without a problem and the background and sky state appear in the stikercompact, but no data. I donā€™t know what Iā€™m doing wrongā€¦ itā€™s installed at the same level as pwsWD but I donā€™t know what Iā€™m doing wrongā€¦ you can see it at https://www.meteobellvei.cat/stickersPWS/stickercompact.php
Thanks in advance!!

It takes the live data from the ā€˜PWS_livedata.phpā€™ script; so even this script must work in your site.

and how do I activate this script? or how can i know if it is working?

There seems tio be an essential font missing

https://www.meteobellvei.cat/stickersPWS/stickercompact.php?de=test

Returns

Path_pwswd set: ../pwsWD
Settings OK
Weather data OK
GD info:
Array
(
    [GD Version] => 2.3.3
    [FreeType Support] => 1
    [FreeType Linkage] => with freetype
    [GIF Read Support] => 1
    [GIF Create Support] => 1
    [JPEG Support] => 1
    [PNG Support] => 1
    [WBMP Support] => 1
    [XPM Support] => 1
    [XBM Support] => 1
    [WebP Support] => 1
    [BMP Support] => 1
    [AVIF Support] => 1
    [TGA Read Support] => 1
    [JIS-mapped Japanese Font Support] => 
)
Font FAILED
Current PHP version: 8.3.14
allow_url_fopen is enabled. OK

Without a font the sticker can not draw the texts.

Ok, uooo yes, font problem solved; stickercompact and synamic-sticker works well, but sticker.php causes error 500

That is a PHP error
Please unzip test-script and upload it to the stickersPWS/ folder
Run it with

https://www.meteobellvei.cat/stickersPWS/_test.php

Probably it will display the error or at least an image we can analyze.

Wim

_test.php.zip (1.4 KB)

Hi
The clientraw.txt file at what point exactly is it created, because I canā€™t locate it (if of course it has been created !!)

Thanks

Hi, yes, I think that the problem of 500 error is due to php version, as Wim said. Sticker is not testing yet for Manel_Sastre php version that is 8.3.14.
The simplest and easiest way to fix it is downgrade your php version to 8.2; otherwise you should find what error create your 500 responce.
Iā€™m using and testing the sticker with 8.2.26 php version and I see that there is some warning on phpdial_gauge.php on line 67, sticker.php on line 163 and 169. Maybe this is no longer allowed in later versions of php.
Iā€™m going to try to fix this issue, in the meanwhile.
Regards
Antonio

1 Like

Hi!
no image at test.phpā€¦