cloudy cloudy

Author Topic: weather34 for WeatherDisplay (clientraw and WDapi)  (Read 17140 times)

0 Members and 2 Guests are viewing this topic.

Offline GW400

  • Posts: 81
  • Klepp, Norway
  • OS/Browser:
  • Win NT 10.0
  • Chrome 72.0.3626.119
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #405 on: March 04, 2019, 03:11:38 PM »
Cronjobs are started from somewhere else and only executed on your weather34/ website.
WeatherPrograms such as WeatherDisplay  or Meteobridge are able to function as a cron-server themselves.
Small linux computers such as RaspBerry have built in cron-servers also.

Or you can use a free (or almost free) con-provider.
There are multiple discussions on the weather-fora about which providers can be used. 
Sometimes your website provider has a free cron service also.
Some of the names I got when using Google   https://cron-job.org/en/  https://www.cronjob.de/  https://www.setcron.com/

But this topic/discussion is not the right place and by hiding it here in this topic you will get far less answers than starting a topic such as" Which (free) cronjob server should I use?"

Wim

This states why the script is not executed when not using programs like WeatherDisplay.
It was not very clear anywhere that I need to create a cron job myself. At least could not find it anywhere.
With this knowledge I'm able to move forward.
Thank's again for helping!
Regards G400

Offline GW400

  • Posts: 81
  • Klepp, Norway
  • OS/Browser:
  • Win NT 10.0
  • Chrome 72.0.3626.119
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #406 on: March 04, 2019, 03:55:12 PM »
This states why the script is not executed when not using programs like WeatherDisplay.
It was not very clear anywhere that I need to create a cron job myself. At least could not find it anywhere.
With this knowledge I'm able to move forward.
Thank's again for helping!

Ended up defining this cron task:
*/1 * * * * /usr/bin/php -q /home/weather/public_html/w34_cron_stationcron.php

I verified it is running once every minute and updates MYSQL db and csv file as expected

I assume I will also need two additional jobs running w34_cron_addtoyear.php and w34_cron_empty.php.
Correct?
« Last Edit: March 04, 2019, 03:58:31 PM by GW400 »
Regards G400

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 1,128
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 72.0.3626.119
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #407 on: March 04, 2019, 04:05:32 PM »
Ended up defining this cron task:
*/1 * * * * /usr/bin/php -q /home/weather/public_html/w34_cron_stationcron.php

I verified it is running once every minute and updates MYSQL db and csv file as expected

I assume I will also need two additional jobs running w34_cron_addtoyear.php and w34_cron_empty.php.
Correct?
1. You should only use the SQL table if you do not  upload to WeatherUnderground.  The data from WeatherUnderground is more extensive (more fields) and can be used for other fine scripts also.
2. Only if you do not upload to WU you need the 5 minutes before midnight en 5 minutes after midnight cron-jobs also.

Wim


Offline GW400

  • Posts: 81
  • Klepp, Norway
  • OS/Browser:
  • Win NT 10.0
  • Chrome 72.0.3626.119
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #408 on: March 04, 2019, 04:10:43 PM »
1. You should only use the SQL table if you do not  upload to WeatherUnderground.  The data from WeatherUnderground is more extensive (more fields) and can be used for other fine scripts also.
2. Only if you do not upload to WU you need the 5 minutes before midnight en 5 minutes after midnight cron-jobs also.

Wim

Confirming that I do not upload to WeatherUnderground.
I should be good to go then.
G400
Regards G400

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 1,128
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 72.0.3626.119
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #409 on: March 04, 2019, 04:19:35 PM »
Confirming that I do not upload to WeatherUnderground.
I should be good to go then.
G400
Yes, you need the two other cron-jobs also.  Wim

Offline Weather Display

  • Posts: 86,736
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 72.0.3626.119
    • Weather Display
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #410 on: March 04, 2019, 08:52:05 PM »
I updated to your new template Wim today
good job Wim
was relatively easy :)

I do see one error, might be that my php version 5.5.38   is a bit below minimum, and that is the moon phase script
http://weather-display.com/pwsWD/

Fatal error: Class 'Moon' not found in /homepages/22/d75034112/htdocs/weather-display/english/pwsWD/moon_block.php on line 42

I also see Overwegend bewolkt  in the current conditions ( I set to use clientraw for that)
:)

Offline bitsostring

  • Posts: 796
  • 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 #411 on: March 04, 2019, 10:26:20 PM »
Another Metar problem in production version: is this related to the one posted on the beta site or is it CheckWX again?

P.S. Same error on the 2220Z Metar.
« Last Edit: March 04, 2019, 10:43:14 PM by bitsostring »
It's meant to be fun. . .

Offline hcorrin

  • Posts: 1,241
  • Ballaugh Isle of Man GB
  • OS/Browser:
  • Win NT 10.0
  • Mozilla compatible
    • Ballaugh Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #412 on: March 04, 2019, 11:07:18 PM »
I got the following on my production site http://www.hc-iom.co.uk/pwsWD/index.php
metar popup gave error 500 in IE11 and
PHP Notice: Undefined index: name in E:\xxxxxxx\x\hc-iom.co.uk-xxxxxxxxxx\xxxx\htdocs\pwsWD\metar_load_funct.php on line 61
PHP Notice: Undefined offset: 1 in E:\xxxxxxx\x\hc-iom.co.uk-xxxxxxxxxx\xxxx\htdocs\pwsWD\metar_popup.php on line 286
PHP Notice: Undefined offset: 1 in E:\xxxxxxx\x\hc-iom.co.uk-xxxxxxxxxx\xxxx\htdocs\pwsWD\metar_popup.php on line 288

in MS edge
this is the text from the metar34 file
{"results":1,"data":[{"wind":{"degrees":240,"speed_kts":16,"speed_mph":18,"speed_mps":8},"temperature":{"celsius":6,"fahrenheit":43},"dewpoint":{"celsius":2,"fahrenheit":36},"humidity":{"percent":76},"barometer":{"mb":992.92,"hg":29.32,"kpa":99.29},"visibility":{"miles":"Greater than 6","miles_float":6.21,"meters":"10,000+","meters_float":10000},"ceiling":{"code":"BKN","text":"Broken","feet_agl":2000,"meters_agl":609.6},"elevation":{"feet":55.77,"meters":17},"location":{"coordinates":[-4.62389,54.083302],"type":"Point"},"icao":"EGNS","observed":"2019-03-04T21:50:00.000Z","raw_text":"EGNS 042150Z 24016KT 210V270 9999 BKN020 06/02 Q0993","clouds":[{"code":"BKN","text":"Broken","base_feet_agl":2000,"base_meters_agl":2000}],"flight_category":"MVFR"}]}


looks like things have altered again, I think CheckWX need to get there act together

Offline Harry

  • Posts: 761
  • Union City, CA USA
  • OS/Browser:
  • Win NT 10.0
  • Firefox 65.0
    • Union City, CA Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #413 on: March 05, 2019, 05:50:48 AM »
I got the following on my production site http://www.hc-iom.co.uk/pwsWD/index.php
metar popup gave error 500 in IE11 and
PHP Notice: Undefined index: name in E:\xxxxxxx\x\hc-iom.co.uk-xxxxxxxxxx\xxxx\htdocs\pwsWD\metar_load_funct.php on line 61


I'm getting that error too in Firefox and Edge.

http://ucweather.org/pwsWD/

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 1,128
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 72.0.3626.119
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #414 on: March 05, 2019, 06:21:57 AM »
@ALL
The format of the JSON file from the METAR provider has changed again.
Sorry, this should not have been visible for the production version. But because I knew that not all errors are removed I left full debugging code switched on. Therefor we get those errors.  As I am "off the grid" for at least 3 weeks after tomorrow I have very little time left to find a solution.

FOR NOW: Start easyweather and select nearly at the bottom at the question
"Where do we get our current conditions from?"  => "Use Darksky for current conditions (needs API key)."
That way your main window will not load the METAR scripts.
And do not use the "nearby" pop-up for now until i have had a chance to find out why they removed the airport name and others from the .JSON

Wim

Offline Weather Display

  • Posts: 86,736
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 72.0.3626.119
    • Weather Display
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #415 on: March 05, 2019, 06:59:01 AM »
my issue has been resolved, thanks Wim
for some reason the others folder had not been uploaded /expanded with the other folders via the WS_FTP program
so I just had to upload that folder

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 1,128
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 72.0.3626.119
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #416 on: March 05, 2019, 07:14:57 AM »
. . .  shortened . . .
I also see Overwegend bewolkt  in the current conditions ( I set to use clientraw for that)
:)
In your setup, the information for the "currentconditon block" comes partly from WD-clientraw (icon / text).
The rest comes from the 1 hour forecast from DarkSky

So you probably selected for DarkSky the language:  "Dutch" .
A beautifull language understood in the Netherlands, Flanders (Belgium) and a few municipalities at the upper north-west  of France. But it is at no use in NZ.

If you select English the forecast block and the 1 hour forecast will all be English.
But you have to wait an hour to see the changes as the forecasts are cached  to stay within the limits for your DarkSky API.

Wim

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 1,128
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 72.0.3626.119
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #417 on: March 05, 2019, 07:31:53 AM »
METAR CHANGES  for pwsWD

As other users already discovered, the layout changed again.
  • The airport-name is not available anymore / for now??.
  • The date/time field layout changed from:
    old:   01-03-2019 @ 07:20Z"
    new: 2019-03-05T05:55:00.000Z
I attach a zip with the two changed scripts for the pwsWD users.

The updates for the beta will be posted in the other topic.

Wim
« Last Edit: March 05, 2019, 08:18:05 AM by wvdkuil »

Offline staccermaccer

  • Posts: 206
  • Antwerp,Belgium
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Weather in Ekeren and Harbour of Antwerp
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #418 on: March 05, 2019, 08:45:56 AM »
Hi, Wim

Replaced the two files, works like a charm now!

Staccermaccer,

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 1,128
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 72.0.3626.119
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #419 on: March 05, 2019, 08:53:26 AM »
Ended up defining this cron task:
*/1 * * * * /usr/bin/php -q /home/weather/public_html/w34_cron_stationcron.php

I verified it is running once every minute and updates MYSQL db and csv file as expected
. . . shortened . . .
The cronjob has two tasks.
  • Loading all external files
  • Generating one line in the daily CSV and the SQL table
I think you are running the cron-job far to fast. Once every 5 minutes is OK.
For the external files, such as forecasts,  METAR a.s.o. the cache time is (far) more than 5 minutes.   
The cron-job has to check every file for its last  file-modified-time and load the file when it is above 80% of the allowed age.

The graphs .csv files for today (result.csv) will accept 1 minute values, but the graphs itself has not that much room to display all those values.

And every day all those values in your sql-table are discarded also and replaced with a single line in your monthly/yearly .csv file which will be only used  to display those graphs.

There is no advantage in accessing an external hosted web-server every minute 24/7 for the graphs-weather-data.
And some web-hosting companies may think that it looks like a DDOS attack and block the IP-address.

Wim
« Last Edit: March 05, 2019, 08:56:25 AM by wvdkuil »