cloudy cloudy

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

0 Members and 1 Guest are viewing this topic.

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 #285 on: February 02, 2019, 08:03:59 PM »
I would expect that the last hour would be the previous 59 minutes from the current time. . .  My vote is if the value is going to be shown then it should be correct, otherwise remove it.

I agree, too. As niko says, it's unreasonable to expect a value from the data available in clientraw or api.
It's meant to be fun. . .

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,341
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 71.0.3578.98
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #286 on: February 02, 2019, 08:46:18 PM »
Any reason I can't bring up pop ups on phone?

Sent from my Pixel 2 using Tapatalk
Yes, they are to wide. So the CSS suppresses the pop-up's
All blocks are only displayed one below each other, fitting inside the width of the phone.
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 GW400

  • Posts: 83
  • Klepp, Norway
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #287 on: February 03, 2019, 08:22:33 PM »
There should be two midnight cron-jobs   1 before and 1 after midnight.
The second one purges the SQL-table  and writes a new header to the .csv file.
When I now check your files, they are empty, => chartsmysql/result.csv only has the header line with the fields names.
The graphs are therefor empty also.
Wim
I would like to store all data in my local MySQL database to be able to access historical data.
What would be the recommended solution to this?
Regards G400

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,341
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 71.0.3578.98
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #288 on: February 03, 2019, 08:32:52 PM »
I would like to store all data in my local MySQL database to be able to access historical data.
What would be the recommended solution to this?
That question you should ask in another topic or even another forum.
With a question like: "How to store all data from WeatherDisplay in a SQL database"

Probably the answer is to be found on the  MeteoTemplate website: http://www.meteotemplate.com/web/index.php
That template already uses another API from WD to upload all data and stores is in an SQL database.

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 GW400

  • Posts: 83
  • Klepp, Norway
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #289 on: February 03, 2019, 08:42:29 PM »
Thank you Wim,
I'm already aware of this, but what I'm concerned about is the possibility for a user to see historical data in Weather34 for WD.
Regards G400

Offline jzinckgra

  • Posts: 150
  • Maine, U.S.A
  • OS/Browser:
  • Win NT 10.0
  • Firefox 60.0
    • Personal weather site
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #290 on: February 04, 2019, 01:26:24 PM »
The second job should clear the table and clear the daily .csv
The daily file ./chartsmysql/result.csv
Has one line only , with the headers
Filetime (UTC): 2019-02-01T23:00:32+00:00 which an age of 15 hrs 46 min 02 seconds
It was purged exactly midnight Norway time. Your question about old data is answered, that data will be correctly removed at midnight
Now  to find out why no data is added during the day, use the test program . . . /_test.php?test=w34_cron_stationcron.php  "et voila"
Code: [Select]
Fatal error: Uncaught Error: Call to undefined function curl_init() in /home/weather/public_html/w34_load_files.php:201 Same reason as for another problem, no CURL. The main task of cronjob is to load the data before it is needed. The script fails so it can not do the other tasks.  You could set WDapi to do the task.

Wim

Wim,

Still having issues with the popups. The csv files are getting populated, but the cron job does not appear to be erasing the data from the day before. https://www.weather911.net/pwsWD/
Also, getting spikes of data at 00:00 every day. Thanks.

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,341
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 71.0.3578.98
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #291 on: February 04, 2019, 01:56:34 PM »
Wim,
Still having issues with the popups. The csv files are getting populated, but the cron job does not appear to be erasing the data from the day before. https://www.weather911.net/pwsWD/
Also, getting spikes of data at 00:00 every day. Thanks.
Only the daily csv files seems to be populated, others are empty, do not even exist yet: no 2019.csv or 2019_02.csv

I ran the add-to-year  in the browser including error reporting:
 .../pwsWD/_test.php?test=w34_cron_addtoyear.php
Code: [Select]
Warning: mysqli_connect(): (28000/1045): Access denied for user 'Jzinckgr'@'162.144.12.159' (using password: YES)
 in /home4/jzinckgr/public_html/pwsWD/w34_cron_addtoyear.php on line 42
same for the clean script
Code: [Select]
Warning: mysqli_connect(): (28000/1045): Access denied for user 'Jzinckgr'@'162.144.12.159' (using password: YES)
in /home4/jzinckgr/public_html/pwsWD/w34_cron_empty.php on line 37

It seems that your easyweather settings are not correct.   At least the midnight cron-jobs are not allowed to access your database.

The big question: are you sure that some script is adding data to your SQL table?

I think no script is doing that. Only two scripts can add data to the sql table. 

WDapi  which can run at set interval =>  it behaves like a cron-job also.  Or the station-cron

The station-cron displays a message that it does not have to do that.
Your settings seems to be that the WDapi will do that. 

But you are using clientraw.txt for your data,  not WDapi as is shown in the footer of your page: Data Source: Clientraw C10.37S90

Wim
« Last Edit: February 04, 2019, 02:11:14 PM 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/

Offline jzinckgra

  • Posts: 150
  • Maine, U.S.A
    • Personal weather site
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #292 on: February 04, 2019, 02:24:07 PM »
Only the daily csv files seems to be populated, others are empty, do not even exist yet: no 2019.csv or 2019_02.csv

I ran the add-to-year  in the browser including error reporting:
 .../pwsWD/_test.php?test=w34_cron_addtoyear.php
Code: [Select]
Warning: mysqli_connect(): (28000/1045): Access denied for user 'Jzinckgr'@'162.144.12.159' (using password: YES)
 in /home4/jzinckgr/public_html/pwsWD/w34_cron_addtoyear.php on line 42
same for the clean script
Code: [Select]
Warning: mysqli_connect(): (28000/1045): Access denied for user 'Jzinckgr'@'162.144.12.159' (using password: YES)
in /home4/jzinckgr/public_html/pwsWD/w34_cron_empty.php on line 37

It seems that your easyweather settings are not correct.   At least the midnight cron-jobs are not allowed to access your database.

The big question: are you sure that some script is adding data to your SQL table?

I think no script is doing that. Only two scripts can add data to the sql table. 

WDapi  which can run at set interval =>  it behaves like a cron-job also.  Or the station-cron

The station-cron displays a message that it does not have to do that.
Your settings seems to be that the WDapi will do that. 

But you are using clientraw.txt for your data,  not WDapi as is shown in the footer of your page: Data Source: Clientraw C10.37S90

Wim
In easy weather, I have wdapi listed to upload the data. Is this correct? What about which option to use for "live data"? Clientraw or WD API?

Sent from my Pixel 2 using Tapatalk
« Last Edit: February 04, 2019, 02:32:27 PM by jzinckgra »

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,341
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 71.0.3578.98
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #293 on: February 04, 2019, 02:46:19 PM »
In easy weather, I have wdapi listed to upload the data. Is this correct?
NO.  How does it work:
WeatherDisplay is uploading all kind of data to your website.
For use in the HWS-template you  can chose between  clientraw.txt and WDapi
=> You have selected clientraw.txt as is shown in the footer of your website page.

For the graphs you can select two sets of data which are not uploaded  by WeatherDisplay
1. If your WD is also uploading to WU  => you can use WU to grab the data from for the graphs
2. If you are a WU-member you have to do it yourself.

To generate the data yourself,  you need a script which runs at a set interval.
a. You are NOT using the WDapi so it is not possible  to use that one as WD will never start it
b. You use clientraw.txt so you have to use the station-cron-script.

Summary: You use clientraw for your data => WDapi is not possible => only station-cron is the one to use.

Wim

P.S. Probably station-cron will fail to load the sql-table as the other scripts accessing the database fail also.
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 jzinckgra

  • Posts: 150
  • Maine, U.S.A
  • OS/Browser:
  • Win NT 10.0
  • Firefox 65.0
    • Personal weather site
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #294 on: February 04, 2019, 09:22:29 PM »
NO.  How does it work:
WeatherDisplay is uploading all kind of data to your website.
For use in the HWS-template you  can chose between  clientraw.txt and WDapi
=> You have selected clientraw.txt as is shown in the footer of your website page.

For the graphs you can select two sets of data which are not uploaded  by WeatherDisplay
1. If your WD is also uploading to WU  => you can use WU to grab the data from for the graphs
2. If you are a WU-member you have to do it yourself.

To generate the data yourself,  you need a script which runs at a set interval.
a. You are NOT using the WDapi so it is not possible  to use that one as WD will never start it
b. You use clientraw.txt so you have to use the station-cron-script.

Summary: You use clientraw for your data => WDapi is not possible => only station-cron is the one to use.

Wim

P.S. Probably station-cron will fail to load the sql-table as the other scripts accessing the database fail also.
After looking into this further, it appears my IP address is being blocked by spamhaus and is on the PBL list. Although this doens't make sense since I can upload WD data to my server without problem. It's just the mysql that is having issue.

Also, I can't even get data tables to work with WU and I am using my station ID
« Last Edit: February 04, 2019, 09:37:57 PM by jzinckgra »

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,341
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 71.0.3578.98
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #295 on: February 05, 2019, 07:58:49 AM »
. . . shortened . .
Also, I can't even get data tables to work with WU and I am using my station ID
You have to change your easyweathersettings from using SQL to using WU Then I can check what the problem is.
BUT:   https://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=KMERAYM03&graphspan=day&year=&format=1
Returns no data, only the header line.  You have a typo in your settings. 
You typed KMERAYM03   but your WU station is  KMERAYMO3   That will solve  the WU-graphs

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 #296 on: February 05, 2019, 12:18:08 PM »
Quote
The Demo site now reflects a Canadian user.  I try to test the new EC alert- and forecast-scripts.

Alert not very legible in Dark Theme, but OK in Light.
It's meant to be fun. . .

Online wvdkuil

  • Wim van der Kuil
  • Posts: 1,341
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 71.0.3578.98
    • My PWS at Leuven Belgium Europe
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #297 on: February 05, 2019, 12:31:03 PM »
Alert not very legible in Dark Theme, but OK in Light.
Thanks.
@ALL  Testing is for me a two stage process.
First I use the light theme and try to get all PHP (script itself, unit conversion) and in-line css (scrolling a.s.o.) correct.
After that I look at how it works in different environments, on an Ipad, with the dark theme a.s.o.
So please post all the remarks but it can take some time before it is changed on the demo 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 jzinckgra

  • Posts: 150
  • Maine, U.S.A
  • OS/Browser:
  • Win NT 10.0
  • Firefox 65.0
    • Personal weather site
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #298 on: February 05, 2019, 01:39:40 PM »
You have to change your easyweathersettings from using SQL to using WU Then I can check what the problem is.
BUT:   https://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=KMERAYM03&graphspan=day&year=&format=1
Returns no data, only the header line.  You have a typo in your settings. 
You typed KMERAYM03   but your WU station is  KMERAYMO3   That will solve  the WU-graphs

Wim
Thanks for catching the station ID typo. Graphs working now, at least using WU. After Feb 15, who knows. Will have to get back to the sql table approach.

Offline saratogaWX

  • Global Moderator
  • Posts: 5,939
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 64.0
    • Saratoga Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #299 on: February 05, 2019, 04:01:43 PM »
The WU graphs *should* continue to work after Feb 15th since they use the CSV download from the PWS page on WU, not the WU API.

They have said
Quote
We'd like to remind our PWS owners/contributors:
 

    Your past data will always be available to you for viewing and download in a web browser on wunderground.com, just as it always has.
    If you are in the small minority of people who use the WU API and a corresponding WU API key to obtain data in .json format, here's what's happening:

    We'll open a registration page for you to get a new API key to get your data in .json format
    You'll sign up and get a new API key for the new API
    Once the registration page is open, we'll keep the old API and your old API key active for 2 weeks to allow transition time to your new key

 
 
We'll announce in the forum when the registration page opens.
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates