cloudy cloudy

Author Topic: HWS-template (WD34 / weather34) April release  (Read 840 times)

0 Members and 1 Guest are viewing this topic.

Offline GW400

  • Posts: 77
  • OS/Browser:
  • Win NT 10.0
  • Chrome 73.0.3683.103
Re: HWS-template (WD34 / weather34) April release
« Reply #30 on: Today at 05:15:13 AM »
Who to use to run the cron-job
As the cron-job runs on your website, the website itself can not start the cron-job.
Your website provider probably has a cron-job facility and there are other free or paid-for cron-job-providers
But WD is already running 24/7 and has al cron-job services built in.  No need to use another way.

How does it work:
WD will start the cron-job with a http call to your website => that is the only thing WD has to do
The "cron-job" will be run on your webserver as it is a normal PHP script
The "cron-job" will load the  server-side "load_files" php-script which re-loads all external data files if they are to old, but this time with 80% of the allowed age

Some documentation
http://wd34.weather-template.com/ => Documentation => http://wd34.weather-template.com/documentation/WDapi-stationcron-2019-01.pdf

PLEASE ALWAYS SUPPLY THE URL TO YOUR WEBSITE
Sometimes a small problem or a provider-setting inhibits loading the external data.
Only with the link  the poeple who try to help you, can check if there is another problem

Wim
I'm using WeeWx and can't use WD to run the cron jobs.
Is it then recommended to manually define cron jobs running the same .py scripts as when using WD?
My website is at weather.meisal.com and I have created three jobs (os i Ubuntu 18.04) running the mentioned scripts. ...stationcron is running fine as scheduled (every 5 min), but the ..empty and ...addtoyear jobs does not work.
G400

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 1,071
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 73.0.3683.103
    • My PWS at Leuven Belgium Europe
Re: HWS-template (WD34 / weather34) April release
« Reply #31 on: Today at 10:54:30 AM »
I'm using WeeWx and can't use WD to run the cron jobs.
Is it then recommended to manually define cron jobs running the same .py scripts as when using WD?
My website is at weather.meisal.com and I have created three jobs (os i Ubuntu 18.04) running the mentioned scripts. ...stationcron is running fine as scheduled (every 5 min), but the ..empty and ...addtoyear jobs does not work.
G400
Running the station-cron as test in the browser returns:
Quote
w34_cron_stationcron.php (28) version =>w34_cron_stationcron.php|00|2018-12-29|
. . . shorted all load data messages . . .
w34_load_files.php (129) purplair sensor not defined
w34_load_files.php (236) File not old enough (910/2880 seconds)https://api.waqi.info/feed/geo:59.014728;6.902158/?token=_API_SETTING_

No loading of DB needed
. . . shortened , removed trace . . . 
success files loaded +to day file

Running the add-to-year-cron http://weather.meisal.com/_test.php?test=w34_cron_addtoyear.php as test in the browser returns:
Quote
No database usage allowed according to the settings

Please check your settings, you do not allow a database to be used.
When you are uploading to WeatherUnderground this is the correct setting.

When not uploading to WU you should let the stationcron upload to an sql table.
Then the two other cron-jobs can convert the sql-data to month and year files

Please replace current version of station-cron with attached one so that I know which version you use.

Wim

Offline GW400

  • Posts: 77
  • OS/Browser:
  • Win NT 10.0
  • Chrome 73.0.3683.103
Re: HWS-template (WD34 / weather34) April release
« Reply #32 on: Today at 09:23:09 PM »
Running the station-cron as test in the browser returns:
Running the add-to-year-cron http://weather.meisal.com/_test.php?test=w34_cron_addtoyear.php as test in the browser returns:
Please check your settings, you do not allow a database to be used.
When you are uploading to WeatherUnderground this is the correct setting.

When not uploading to WU you should let the stationcron upload to an sql table.
Then the two other cron-jobs can convert the sql-data to month and year files

Please replace current version of station-cron with attached one so that I know which version you use.

Wim

Inserted w34_cron_stationcron.php you attached to last message and also enabled the option "Database uses standard PHP connection..." in settings.

Manually executed all cron jobs:

http://weather.meisal.com/_test.php?test=w34_cron_stationcron.php
w34_cron_stationcron.php (28) version =>w34_cron_stationcron.php|00|2019-04-25|
w34_load_files.php(23) loaded  =>w34_load_files.php|00|2019-04-10|
....
w34_settings.php (218) $units =scandinavia $windunit=m/s $tempunit=C $rainunit=mm $pressureunit=hPa $distanceunit=km $wu_unit=m
w34_load_files.php (32) include  =>w34_common.php
w34_common.php (26) version =>w34_common.php|00|2019-01-03|
......
w34_cron_stationcron.php (80) data correctly loaded to database
w34_cron_stationcron.php (89) include_once =>w34_livedata.php
w34_cron_stationcron.php (99) Data saved to chartsmysql/result.csv
success files loaded +to db +to day file

http://weather.meisal.com/_test.php?test=w34_cron_addtoyear.php
object(mysqli_result)#2 (5) {
  ["current_field"]=>
  int(0)
  ["field_count"]=>
  int(12)
  ["lengths"]=>
  NULL
  ["num_rows"]=>
  int(1)
  ["type"]=>
  int(0)
}
string(170) "MAX_timestamp,MAX_outsideTemp,MIN_outsideTemp,MAX_dewpoint,MIN_dewpoint,MAX_raintoday,MAX_windgust,MAX_windSpeed,MAX_radiation,MAX_barometer,MIN_barometer,SUM_lightning,
"
string(74) "2019-04-25 22:31:33,9.3,0.0,5.80,-1.80,0.00,64.4,51.5,0.00,1015.10,0.00,0,"
success
w34_cron_addtoyear.php (28) version =>w34_cron_addtoyear.php|00|2018-12-29|
w34_cron_addtoyear.php (31) include_once =>w34_settings.php
w34_settings.php (25) version =>w34_settings.php|00|2019-04-10|
w34_settings.php (28) include =>w34_settings1.php
w34_settings1.php (4) version =>w34_settings1.php|00|2019-04-25|
w34_settings.php (218) $units =scandinavia $windunit=m/s $tempunit=C $rainunit=mm $pressureunit=hPa $distanceunit=km $wu_unit=m

http://weather.meisal.com/_test.php?test=w34_cron_empty.php
success 1

bool(true)
-2

All three script jobs seems to work when run manually.

Added to the following jobs within the context of the user running WD34:
su <user>
crontab -e

Then added the following:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * php -q /path/w34_cron_stationcron.php
58 23 * * * php -q /path/w34_cron_addtoyear.php
0 0 * * *   php -q /path/w34_cron_empty.php

Note: "path" is not the real path

I will let it run until tomorrow and check again, but to me it seems unlikely it will not work when run as cron jobs when executed manually through browser works

Offline bitsostring

  • Posts: 735
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
Re: HWS-template (WD34 / weather34) April release
« Reply #33 on: Today at 09:46:04 PM »
Quick question: where do I find the meteoalarm.eu "Europe: code for your area, example BE004" mentioned in easyweathersetup?

I have only entered "UK" so far. . .
It's meant to be fun. . .

Offline hcorrin

  • Posts: 1,238
  • Ballaugh Isle of Man GB
  • OS/Browser:
  • Win NT 10.0
  • Mozilla compatible
    • Ballaugh Weather
Re: HWS-template (WD34 / weather34) April release
« Reply #34 on: Today at 10:04:54 PM »
Try UK004

 

cumulus