Author Topic: I need help to get my PWS dat from wundeground or weathercloud on my website  (Read 6205 times)

0 Members and 1 Guest are viewing this topic.

Online wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
. . . shortened . . .
I know it's not necessary to have it running but I wanted to test it anyway, the use of mysql.
Indeed absolutely unnecessary.  SQL will be removed in the upcoming release.
Currently there is no "database" only 1 table, to strore this-days values
The SQL-table is not used in any script. , Only  at the end of the day the max and min values are retieved and stored in .csv files.
Quote
I've setup my database properly and it's accepting data successfully.
THe problem however is that two of the three cronjobs is failing.
I've setup the cronjobs properly (user 'php' is executing the scripts) and the 10 min script (w34_cron_stationcron.php) is putting realtime measurements succesfully in ./chartsmysql/result.csv.
However the two other scripts (w34_cron_empty.php and w34_cron_addtoyear.php) are not working.
I'm sure cron triggers those scripts (I've set it to confirm it my email) and I'm sure user 'php' has the proper rights to execute the scripts, but they fail..
w34_cron_addtoyear.php reports: Couldn not write headers to chartsmysql/2019_04.csv
w34_cron_empty.php does not clean result.csv and reports: success 1-2
The csv files as well as it's directory chartsmysql have write permissions to all users so that not the point either (otherwise none of the scripts would work).
The testscript w34_module_test.php does not give any clues.
In this case it is more of a "inspect" the data  script. 
The cron-jobs are not listed in the drop-downs on purpose.
You should test the cron-jobs using your browser
I included a "_test.php" script to force all scripts to display errors and debug data.

When I run the add-to-year job in the browser it works OK
https://pws.gravedecayband.com/_test.php?test=w34_cron_addtoyear.php
Code: [Select]
object(mysqli_result)#2 (5) {
  ["current_field"]=>
  int(0)
  ["field_count"]=>
  int(12)
  ["lengths"]=>
  NULL
  ["num_rows"]=>
  int(1)
  ["type"]=>
  int(0)
}
string(77) "2019-04-17 09:30:02,12.0,8.0,3.00,1.00,0.00,6.0,9.0,130.00,1022.35,1021.33,0,"
success
w34_cron_addtoyear.php (28) version =>w34_cron_addtoyear.php|00|2018-12-29|
I ran it twice and both data-lines are in the .CSV files for this year and this month.
Code: [Select]
contents of "./chartsmysql/2019.csv", processed as filetype "text file"
Filetime (UTC): 2019-04-17T07:40:17+00:00 which an age of 0 hrs 00 min 13 seconds

Unprocessed first 50 characters of the file :2019-04-17 09:30:02,12.0,8.0,3.00,1.00,0.00,6.0,9.

Contents processed:
2019-04-17 09:30:02,12.0,8.0,3.00,1.00,0.00,6.0,9.0,130.00,1022.35,1021.33,0,
2019-04-17 09:40:02,12.0,8.0,3.00,1.00,0.00,6.0,9.0,136.00,1022.35,1021.33,0,

So please check if the permissions for the cron-jobs are set correctly.
The best way is to run them form an external cron-server. 
Your webserver thinks than that they are started from a browser by a human.

But again, the SQL part seems not to be the problem.
The reading of the daily .CSV => seems OK
Writing to the yearly/monthly .CSV seems to be not allowed.

Wim

Offline zakhooi

  • Member
  • *
  • Posts: 19
I checked the command configured in cron from the command line (my webhost allows commandline access).
Running the command manually works ok, but not with cron.
There is a difference between w34_cron_stationcron.php and the other two scripts.
I think the other two scripts do use something which is not in w34_cron_stationcron.php that cron is not allowed to use resulting in this.
If SQL is stripped from this nice tool I think it's not worth the effort to investigate further.
Thanks anyway for your help.

Offline zakhooi

  • Member
  • *
  • Posts: 19
@wvdkuil

I noted that WU graphs are not showing up anymore. I downloaded the latest version of your tool but found out that there is no module testing script anymore.
I'm sure the WU API key is correct.
Can you have a look please what's wrong?

Old site: https://mijnpws.staatonline.com/pws/
New site: https://mijnpws.staatonline.com/pws2/

Thanks in advance.

Online wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
@wvdkuil

I noted that WU graphs are not showing up anymore. I downloaded the latest version of your tool but found out that there is no module testing script anymore.
I'm sure the WU API key is correct.
Can you have a look please what's wrong?

Old site: https://mijnpws.staatonline.com/pws/
New site: https://mijnpws.staatonline.com/pws2/

Thanks in advance.

Someone else had to warn me of your post.  I really can not read all posts in all topics on more then 6 forums.
Your links give security warnings
Quote
NET::ERR_CERT_COMMON_NAME_INVALID
and-or do not work
Quote
ERR_CONNECTION_TIMED_OUT

This is PWS_Dashboard  information / download site:  https://pwsdashboard.com/
There you find
  • download information
  • links to current version discussion: this topic on the WeatherWatch forum
  • links to documentation
  • And the new name of the test-tool => "It is available on your own site after installing this template: PWS_module_test.php."

If you downloaded, installed the new version and  ran the EasyweatherSetup: the WU-graphs should work.

If not, please post on the PWS_Dashboard topic
  • the link to your site
  • and also the WU-ID, such as IVLAAMSG47
Wim