cloudy cloudy

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

0 Members and 1 Guest are viewing this topic.

Offline Cheffy

  • Posts: 76
  • Melbourne, Australia
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
    • Mickleham Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #165 on: January 14, 2019, 11:11:38 AM »
Hi,

I have had this version up and running for the last few days now, however I can't seem to get the graphs working.  I have set up the WD API and tested with success and I have set up the SQL table and I can see the data arriving every minute, however I can't seem to generate the graphs.  The  'Today' graph seems to be populated with some demo data and does not seem to change.  Am I missing something?

I can switch the source of the graph data from WU and that works fine.

Is there any ideas what I am doing wrong?

The link to my site is,

http://micklehamweather.com/pwsWD/

Thanks,
Neil

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 899
  • 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 #166 on: January 14, 2019, 12:04:20 PM »
Hi,
I have had this version up and running for the last few days now, however I can't seem to get the graphs working.  I have set up the WD API and tested with success and I have set up the SQL table and I can see the data arriving every minute, however I can't seem to generate the graphs.  The  'Today' graph seems to be populated with some demo data and does not seem to change.  Am I missing something?

I can switch the source of the graph data from WU and that works fine.
. . . shortened . . .
Thanks,Neil
I can not check your settings, so  I attach a screenshot. How did you set these two settings?
It works like this:
If all database settings are OK:
WDapi  or the stationcron will store 1 record in the database

If charts are set to Database
 => stationcron will store one line in results.csv

In hindsight, it is more logical to let WD-api add the lines to the .csv when it is loading the DB-record.
But that file can grow very rapidly when the upload interval is set to frequently.


Just before and after midnight the two other cron-scripts will add 1 line to year and monh csv files and clean todays data from the database.
The result.csv (= this days data) is then cleared also.

===
As far as I can see, based on the file-contents, you set WDapi to upload to the database, but are not running a cron-job.

Wim

P.S. I added another post below about the sun-block


« Last Edit: January 14, 2019, 01:47:02 PM by wvdkuil »
Leuven-Template&Scripts https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 899
  • 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 #167 on: January 14, 2019, 01:39:25 PM »
. . .  shortened . .
The link to my site is,  http://micklehamweather.com/pwsWD/
Thanks,Neil
I do not understand the sun block on your site.
These should be the settings (for Melbourne)  in pwsWD/w34_settings1.php.  Could you check them?
Code: [Select]
                   $TZ = "Australia/Melbourne";
                  $lat = (float) "-37.813611";
                  $lon = (float) "144.963056";
I attach the latest version of the script, for easier reference it displays the hours around the 24-hr clock. 
You have to add the azimuth script also.
At noon there should be sun, at midnight it should be dark.

Wim
« Last Edit: January 14, 2019, 03:20:01 PM by wvdkuil »
Leuven-Template&Scripts https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline bitsostring

  • Posts: 569
  • Oregon Scientific WMR200
  • Edinburgh, UK
  • OS/Browser:
  • Win NT 10.0
  • Mozilla compatible
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #168 on: January 14, 2019, 02:36:56 PM »
I attach the latest version of the script, for easier reference it displays the hours around the 24-hr clock. 
At noon there should be sun, at midnight it should be dark.

Azimuth/elevation not working in new Sun block here - http://swanston.maui.co.uk/pws/
It's meant to be fun. . .

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 899
  • 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 #169 on: January 14, 2019, 02:45:30 PM »
Azimuth/elevation not working in new Sun block here - http://swanston.maui.co.uk/pws/
Yes, stupid me. I wanted to check how the beta-sun script would work in Australia.
I forgot that others could also download that script.  Will do it with PM's from now on.
For the new sun script you need the Niko's version of the Azimuth/elevation script also, it is attached.
Succes, PM me if you have more problems with this version.
Wim
Leuven-Template&Scripts https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline bitsostring

  • Posts: 569
  • Oregon Scientific WMR200
  • Edinburgh, UK
  • OS/Browser:
  • Win NT 10.0
  • Mozilla compatible
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #170 on: January 14, 2019, 03:07:03 PM »
For the new sun script you need the Niko's version of the Azimuth/elevation script also, it is attached.

No worries, sun/azimuth working now! And so is the rain last hour, I think: I'll check that when we get more rain  :)
It's meant to be fun. . .

Offline Cheffy

  • Posts: 76
  • Melbourne, Australia
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
    • Mickleham Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #171 on: January 15, 2019, 08:36:05 AM »
Thanks Wim.

I checked my settings and you were correct I had set WDapi to upload to the database, I have now changed it to 'stationcron job will the database load' - however I am still having issues.

I think I understand how it works now, I originally had WDapi to upload to the database and I could see the data coming into my SQL table on 1 minute intervals (but obviously not populating the .csv files).  Since I have changed to the cronjob load option, nothing is coming into my SQL table.  It seems like the cronjobs in WD are not running.  If I manually run the following link, it will work but nothing is happening in WD.

http://micklehamweather.com/pwsWD/w34_cron_stationcron.php

I have checked and double checked the links in WD but I can't seem to work it out why it won't work. I have included some of my settings, maybe I have missed something!

Re the sun block on my site, I have checked my settings and they match what you had suggested so again I am not sure what has happened there!

I have attached a copy of what I can currently see.

Thanks again for your help with this.

Neil
« Last Edit: January 15, 2019, 08:51:03 AM by Cheffy »

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 899
  • 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 #172 on: January 15, 2019, 10:29:38 AM »
Thanks Wim.
I checked my settings and you were correct I had set WDapi to upload to the database, I have now changed it to 'stationcron job will the database load' - however I am still having issues.
I think I understand how it works now, I originally had WDapi to upload to the database and I could see the data coming into my SQL table on 1 minute intervals (but obviously not populating the .csv files).  Since I have changed to the cronjob load option, nothing is coming into my SQL table.  It seems like the cronjobs in WD are not running.  If I manually run the following link, it will work but nothing is happening in WD.

http://micklehamweather.com/pwsWD/w34_cron_stationcron.php

I have checked and double checked the links in WD but I can't seem to work it out why it won't work. I have included some of my settings, maybe I have missed something!
The WDapi works fine, so you can set that to upload the SQL table.

I agree that it seems the cron-jobs are not running as they should. They run OK when manually  started.  But they do not appear to be run by WD.
Please check first if there are no spaces or other strange characters before or after the cron links.
If all seems OK on your end,  contact Brian Hamilton maybe he can see in the logs what the problem is.
Quote
Re the sun block on my site, I have checked my settings and they match what you had suggested so again I am not sure what has happened there!
I have attached a copy of what I can currently see.
Thanks again for your help with this.
Neil
The problem with the sun-block is not something you can see. Only visitors from another timezone see a strange circle.
Attached a screenshot hot is looks  when I visit your site

Wim
Leuven-Template&Scripts https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline Cheffy

  • Posts: 76
  • Melbourne, Australia
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
    • Mickleham Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #173 on: January 15, 2019, 11:17:11 AM »
Thanks Wim - all good now, I have it working!

The issue was a leading blank space at the start!!  It was hard to spot - but now that I have noticed it, it's quite obvious....sorry!  :oops:

Neil

Offline oreitsma

  • Posts: 543
  • Assen, Netherlands
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
    • Weerstation Assen
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #174 on: January 15, 2019, 04:19:48 PM »
Thanks Wim - all good now, I have it working!

The issue was a leading blank space at the start!!  It was hard to spot - but now that I have noticed it, it's quite obvious....sorry!  :oops:

Neil

Hi Neil,

Thank you! I had same problem and could not find it.
Solved!

Brgds,
Oebel

Offline blainec

  • Global Moderator
  • Posts: 377
  • Calgary, Ab.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 64.0
    • Weather YYC
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #175 on: January 16, 2019, 03:58:21 AM »
I'm having a problem using wdapi.

It seems to be set correctly, but when I press the test in WD I get "Success: Bad data". and the database does not get updated.


This is what I get when I manually execute wdapi:

Notice: Undefined variable: file_contents in C:\Abyss Web Server\htdocs\pwsWD\w34_WDapi.php on line 71

Notice: Undefined offset: 2 in C:\Abyss Web Server\htdocs\pwsWD\w34_WDapi.php on line 74

Notice: Undefined offset: 10 in C:\Abyss Web Server\htdocs\pwsWD\w34_WDapi.php on line 75

Notice: Undefined offset: 9 in C:\Abyss Web Server\htdocs\pwsWD\w34_WDapi.php on line 76

Notice: Undefined offset: 39 in C:\Abyss Web Server\htdocs\pwsWD\w34_WDapi.php on line 77

Notice: Undefined offset: 6 in C:\Abyss Web Server\htdocs\pwsWD\w34_WDapi.php on line 78

Notice: Undefined offset: 5 in C:\Abyss Web Server\htdocs\pwsWD\w34_WDapi.php on line 79

Notice: Undefined offset: 41 in C:\Abyss Web Server\htdocs\pwsWD\w34_WDapi.php on line 80

Notice: Undefined offset: 4 in C:\Abyss Web Server\htdocs\pwsWD\w34_WDapi.php on line 81

Notice: Undefined offset: 8 in C:\Abyss Web Server\htdocs\pwsWD\w34_WDapi.php on line 82

Notice: Undefined offset: 7 in C:\Abyss Web Server\htdocs\pwsWD\w34_WDapi.php on line 83
Bad Data:
« Last Edit: January 16, 2019, 05:00:09 AM by blainec »

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 899
  • 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 #176 on: January 16, 2019, 07:44:50 AM »
I'm having a problem using wdapi.

It seems to be set correctly, but when I press the test in WD I get "Success: Bad data". and the database does not get updated.
. . .  shortened . . .
Bad Data:
Step 1: save the uploaded data which is put after the URL by WD in the form  URL?d=all_your_data_fields
The first part of the return message "succes" signals that some data  (at least 50 characters) was received  and is saved as a text-string for later use
2. Then the WDapi checks if a database exits "If not" the script ends.
You have set you will use a database so the settings are read to check if WDapi needs to upload to the database
The database name, password a.s.o.  are checked if they are not empty,  if empty the script ends without a message.
Then it checks if "WDapi or the cronjob" must upload. If the cronjob should do it => no message and the WDapi script ends.

3. The WDapi script connects to the database, in your case the connection is OK, otherwise there would have been an error message

4. The fields for the database are created from the text string
AND NOW the data is inserted in the database
Code: [Select]
$result = mysqli_query($conn,"INSERT INTO weatherstation(time, outsideTemp, barometer, raintoday, UV, windgust, windSpeed, radiation, dewpoint, rainrate, direction, date, lightning)
VALUES('$updated', '$temp', '$barometer', '$raintoday', '$uv', '$windgust', '$windspeed', '$solar', '$dewpoint', '$rainrate', '$direction', '$date', '$lightning')");
if ($result == false)
     { die ('Bad Data: '. mysqli_connect_error()); }


The only thing which does not works is the insert, probably the credentials for the userid are set to low.
I will read the documentation to find a better clue what is wrong, as the error message displayed is empty, try the attached replacement script
Use PHPADMIN or your cPanel and give this weather34 user all credentials possible.
===
Check http://wd34.weather-template.com//documentation/WD34-SQL-2019-01.pdf point 2.1: you could try load some data with PHPadmin, just to see  if there is an error message.
===
When you use the WDapi in your browser you get those messages as the fields are not available URL?d=all_your_data_fields


« Last Edit: January 16, 2019, 08:27:55 AM by wvdkuil »
Leuven-Template&Scripts https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline blainec

  • Global Moderator
  • Posts: 377
  • Calgary, Ab.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 64.0
    • Weather YYC
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #177 on: January 17, 2019, 04:34:01 AM »
with your new script I now get an error number 1366

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 899
  • 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 #178 on: January 17, 2019, 07:52:00 AM »
with your new script I now get an error number 1366
OK, it was the UV value which was causing the problem.
Please test this version,
Wim
Leuven-Template&Scripts https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline Cheffy

  • Posts: 76
  • Melbourne, Australia
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
    • Mickleham Weather
Re: weather34 for WeatherDisplay (clientraw and WDapi)
« Reply #179 on: January 17, 2019, 09:34:18 AM »
Hi Wim,

Can you tell me what the little temperature below the main temperature is supposed to represent (see attachment)?  I assume it some kind of trend, however mine seems to be way off and it has been like this since the start.  How is this calculated?

If it helps, here is a link to my site.

http://micklehamweather.com/pwsWD/

Thanks,
Neil

 

cumulus