cloudy cloudy

Author Topic: ***closed*** weather34 for WeatherDisplay (clientraw and WDapi)  (Read 23253 times)

0 Members and 1 Guest are viewing this topic.

Offline BWX

  • Posts: 200
  • OS/Browser:
  • Win NT 10.0
  • Chrome 74.0.3729.169
    • Breckland Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #465 on: June 12, 2019, 06:59:21 AM »
Hi, my big temp disappears after a short time for some reason, refresh the page and it comes back,  also in the marked area, its foreign  text.
I am also trying to update the wind speed and direction to every 2 seconds, when i count it appears to be around 40 seconds yet in the settings they were set to 16 which does not match what its doing (40s) i changed them to 2 anyway but i have a feeling it might not even be that file (WD34_settings.php)?

I am using wd clientraw and wxsim

Thanks
« Last Edit: June 12, 2019, 07:24:10 AM by BWX »

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,341
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 74.0.3729.169
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #466 on: June 12, 2019, 07:18:49 AM »
Hi, my big temp disappears after a short time for some reason, refresh the page and it comes back,
Maybe: The temp script fails when there is an incomplete upload.
I could not replicate that. I waited about 10 automatic reloads and the area remains unaffected.
Questions:  What browser do you use? Does it happen with other browsers?  Which provider?
Quote
also in the marked area, its foreign  text.
There are a lot of "regional" languages for the DarkSky forecast. There is a setting nearly at the bottom where you select the language for the DarkSky forecast. After you change that and save the settings, please wait max 1 hour until the cached 9dutch) forecast is replaced  with one with your selected language
Quote
I am using wd clientraw
Thanks
Success, Wim
Support & demo PWS_Dasboard  (HWS_template) http://pwsdashboard.weather-template.com/ 
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline BWX

  • Posts: 200
  • OS/Browser:
  • Win NT 10.0
  • Chrome 74.0.3729.169
    • Breckland Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #467 on: June 12, 2019, 07:35:57 AM »
HI Wim, thank you for the reply, i am using Chrome on 2 laptops both and both do the same with the temp, very strange, when you say provider, i assume you mean, hostgator or 1and1 etc, well its my own Kimsufi server. I still have an older version running here and that temp works ok

Regarding the forecast settings, its set to English (Which is the default) already, i didnt change that, i will wait for the hour to pass :)

I did amend my reply adding the part about the wind speed update times, i will like them at 2s and have adjusted the setting but the default was 16s, yet when i count it they are at about 40s so that does not match the default at 16. I have them at 2 second in the older version as show here, there are 3 pages that have the same settings so i changed all 3, perhaps i missed one :) wd34_settings.php, wd34_settings1.php and wd34_settings copy.php

The big temp appears to disappear after 5 minutes., just loaded MS Edge and IE9 and FF to test those
« Last Edit: June 12, 2019, 07:58:35 AM by BWX »

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,341
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 74.0.3729.169
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #468 on: June 12, 2019, 08:02:43 AM »
HI Wim, thank you for the reply, i am using Chrome on 2 laptops both and both do the same with the temp, very strange, when you say provider, i assume you mean, hostgator or 1and1 etc, well its my own Kimsufi server. I still have an older version running here and that temp works ok
Those are totally different versions, much of the code is changed.

I will investigate deeper / longer. Maybe an incomplete load of the block contents.
Are other blocks affected, or do they look normal?
Quote
Regarding the forecast settings, its set to English (Which is the default) already, i didnt change that, i will wait for the hour to pass :)
http://www.brecklandweather.com/pwsWD/forecastDShourly_popup.php =>The texts are all in Dutch
./jsondata/darksky.txt => all in Dutch
So I think there is a typing error with the DarkSky API-key
You need that to display the bottom part of the current conditions block, that part shows the current/expected conditions for this/coming hour.
Quote
I did amend my reply adding the part about the wind speed update times, i will like them at 2s and have adjusted the setting but the default was 16s, yet when i count it they are at about 40s so that does not match the default at 16. I have them at 2 second in the older version as show here, there are 3 pages that have the same settings so i changed all 3, perhaps i missed one :) wd34_settings.php, wd34_settings1.php and wd34_settings copy.php
The individual refresh-times can be altered in w34_blocks.php
A fast check at http://www.brecklandweather.com/pwsWD/w34_blocks.php?sce=view  shows that the refresh-time is default 40 seconds.  External providers do not like  multiple users refreshing the blocks at 2 seconds as that involes loading multiple .PHP scripts and data-sets.

Wim
Support & demo PWS_Dasboard  (HWS_template) http://pwsdashboard.weather-template.com/ 
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline BWX

  • Posts: 200
  • OS/Browser:
  • Win NT 10.0
  • Chrome 74.0.3729.169
    • Breckland Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #469 on: June 12, 2019, 08:17:50 AM »
Thank you Wim, thats sorted the refresh times, i have no issues with my server and refresh times, for y clients at add them to a white list that prevents them from being affected by the firewall and cphulk, i/they could use 1 seconds (if wanted) and we wouldnt be affected. But yes, many providers do not like this but this is the benefit of having your own server, you can set it to how you like :)

Re the temp, all the browser return the same issue, thats FF, Chrome, IE and Edge

Re the dark sky side of things, i have just checked the api and the code is totally different to what it was when i used it for the previous script, very strange, i have updated it to the new api code and now awaiting any change, all the other blocks appear ok...

I have just clicked on the Nearby link and that opens the METAR, i have changed the airport in the settings and just double checked yet its still showing your default METAR (EBBR Brussels) perhaps ths has not cached yet?

Offline BWX

  • Posts: 200
  • OS/Browser:
  • Win NT 10.0
  • Chrome 74.0.3729.169
    • Breckland Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #470 on: June 12, 2019, 08:24:49 AM »
Sorry wim, just noticed that the temp for the coming hour in that current conditions block (now its working) is about 16C too high

Offline BWX

  • Posts: 200
  • OS/Browser:
  • Win NT 10.0
  • Chrome 74.0.3729.169
    • Breckland Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #471 on: June 12, 2019, 08:50:15 AM »
Best to do a new reply in case you miss it, i left it on the light theme and the temp is still there after 12 minutes, so its just on the dark theme

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,341
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 74.0.3729.169
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #472 on: June 12, 2019, 08:51:54 AM »
Sorry wim, just noticed that the temp for the coming hour in that current conditions block (now its working) is about 16C too high
http://www.brecklandweather.com/pwsWD/_test.php?test=forecastDShourly_popup.php
Shows those "to high" temps.

Question: This is the data received from DarkSky: http://www.brecklandweather.com/pwsWD/jsondata/darksky.txt

Where are you located?  This is the latitude / longitude you used, according to DarkSky?
    [latitude] => 0.6136
    [longitude] => 52.4636
This is the answer from DarkSky in your browser: https://darksky.net/forecast/0.6136,52.4636/ca12/en
Middle of Nowhere

If you are in the UK somewhere near Brandon it should be switched.

Please do not use this type of timezone:  [timezone] => Etc/GMT-3
Use one of these https://www.php.net/manual/en/timezones.europe.php as they will switch automatically for daylight savings time.

Wim
« Last Edit: June 12, 2019, 09:04:18 AM by wvdkuil »
Support & demo PWS_Dasboard  (HWS_template) http://pwsdashboard.weather-template.com/ 
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,341
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 74.0.3729.169
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #473 on: June 12, 2019, 09:03:39 AM »
. . . shortened . .
I have just clicked on the Nearby link and that opens the METAR, i have changed the airport in the settings and just double checked yet its still showing your default METAR (EBBR Brussels) perhaps ths has not cached yet?
As others can not inspect your settings, did you enter the METAR api code in your settings?

You can check yourself all contents of the files
http://www.brecklandweather.com/pwsWD/w34_module_test.php
=> bottom left select "jsondata/metar34.txt"
==> click "List contents"
Code: [Select]
contents of "./jsondata/metar34.txt", processed as filetype "text file"
Filetime (UTC): 2019-03-29T16:40:44+00:00 which an age of 16 hrs 18 min 34 seconds
The filetimes show that the data is never refreshed.
==> click "Load files" at the bottom
Code: [Select]
w34_load_files.php (59) METAR not loaded API=ADD YOUR API KEYThe metar-api key was not entered as it still contains the default value.

Wim
Support & demo PWS_Dasboard  (HWS_template) http://pwsdashboard.weather-template.com/ 
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline BWX

  • Posts: 200
  • OS/Browser:
  • Win NT 10.0
  • Chrome 74.0.3729.169
    • Breckland Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #474 on: June 12, 2019, 09:20:03 AM »
http://www.brecklandweather.com/pwsWD/_test.php?test=forecastDShourly_popup.php
Shows those "to high" temps.

Question: This is the data received from DarkSky: http://www.brecklandweather.com/pwsWD/jsondata/darksky.txt

Where are you located?  This is the latitude / longitude you used, according to DarkSky?
    [latitude] => 0.6136
    [longitude] => 52.4636
This is the answer from DarkSky in your browser: https://darksky.net/forecast/0.6136,52.4636/ca12/en
Middle of Nowhere

If you are in the UK somewhere near Brandon it should be switched.

Please do not use this type of timezone:  [timezone] => Etc/GMT-3
Use one of these https://www.php.net/manual/en/timezones.europe.php as they will switch automatically for daylight savings time.

Wim

HA HA, yep, definitely not there, i wish, i took the long/lat from google, i will have another look at that, thanks,
(from Your location to 52.4633865, 0.6601383) i got it from the link in the settings, but i think i had them the wrong way round and missed off the - so corrected both, so must be a waiting game for it to cache now as the popup is still the same.

I didnt notice anything about a METAR api, just adding the airport code, so i will have another look at that too, (just done it and now working) thank you

Did you see the part about the temp disappearing being only on the Dark theme? no rush as the Light theme is ok :) thanks again for your time Wim

Offline BWX

  • Posts: 200
  • OS/Browser:
  • Win NT 10.0
  • Chrome 74.0.3729.169
    • Breckland Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #475 on: June 12, 2019, 09:35:16 AM »
OK, looking good so far Wim, that erronous forecast temp is now down from 29C to a more UK realistic summer figure of 14C, yeah i know, go figure, it 30C+ most of last  years summer lol


I did test the temperature_small.php and when i 1st did so there was an error, but not since and i didnt record it, typical, it think it said line 480, i will monitor that, but if you ever need access to test this last big temp issue, i have no issues with that, just shout me and i will let ya know the password.

PS, love that test script, great addition :)

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,341
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 74.0.3729.169
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #476 on: June 12, 2019, 09:39:17 AM »
Best to do a new reply in case you miss it, i left it on the light theme and the temp is still there after 12 minutes, so its just on the dark theme
It seems that when running the dark theme. it sometimes happens that a global variable $theme does not keep its value.
It switches from "dark" to "???" => the scripts use "light" then
So when you start with dark the css for dark is loaded and the classes used in the code are correct in the css
Code: [Select]
<div class="circleOut">
<div class="temperaturecircle"></div>
<div class="temptextmild">12.1<suptemp>&deg;</suptemp></div>
</div><!-- end circleOut -->
When the change to "???" occurs the CSS loaded is still the dark one but the code now changes to
Code: [Select]
<div class="circleOut">
<div class="mild">  </div>
<div class="temptext">12.1<suptemp>&deg;</suptemp></div>
</div><!-- end circleOut -->
Those classes are not in the light-css so the colors are not displayed.

When starting with "light" light theme the light css is loaded.
When $theme changes to "???" there is no problem as the generated code remains the same.

===
I have multiple windows open on my test servers for over 30 minutes but the changes do not occur at my test-site.

Wim




Support & demo PWS_Dasboard  (HWS_template) http://pwsdashboard.weather-template.com/ 
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline bitsostring

  • Posts: 970
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #477 on: June 12, 2019, 09:48:43 AM »
I have multiple windows open on my test servers for over 30 minutes but the changes do not occur at my test-site.

Happens a lot on the Calgary, Alberta test site. I presumed it was because you don't like to upload other people's data too often.
It's meant to be fun. . .

Offline BWX

  • Posts: 200
  • OS/Browser:
  • Win NT 10.0
  • Chrome 74.0.3729.169
    • Breckland Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #478 on: June 12, 2019, 09:52:53 AM »
For me, it shows when starting with dark or light and starting with light and then switch to dark, i only know this for sure because ive only just done that with my tablet using Chrome browser, i have to nip off for a couple of hours so if i dont reply im not being rude.

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,341
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 74.0.3729.169
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #479 on: June 12, 2019, 09:54:53 AM »
Happens a lot on the Calgary, Alberta test site. I presumed it was because you don't like to upload other people's data too often.
But that one is default light-theme, I will switch it to dark and check.

I am checking if you override the default theme, how long the server remembers it.
After that the default switches in.
FOUND IT:
Code: [Select]
if (array_key_exists('theme', $_GET)
    && ($_GET['theme'] == 'dark' || $_GET['theme'] == 'light'))
     {  $theme = $_GET['theme'];
        SetCookie('theme', $theme, time()+ 600); }

The blocks are loaded without the theme,
Code: [Select]
http://wd34.weather-template.com/pwsWD/temperature_block.php?_=1560333164161so after 600 seconds without a refresh, the $theme switches back to the default.

Solution: For now set the line 158 of w34_settings.php from
Code: [Select]
        SetCookie('theme', $theme, time()+ 600); } to any value you see appropriate for "camping" visitors, example 10 hours
Code: [Select]
        SetCookie('theme', $theme, time()+ 36000); } Normal visitors who visit your site in the theme you choose yourself, do not have any problems.

I checked your avatar at the left of your post.
This whole problem occurs while you yourself set the avatar-globe to "http://www.brecklandweather.com/pwsWD/?theme=dark", but your settings to light.
Never occurred to me that your settings were default "light"
Wim
« Last Edit: June 12, 2019, 11:15:14 AM by wvdkuil »
Support & demo PWS_Dasboard  (HWS_template) http://pwsdashboard.weather-template.com/ 
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/