Hi Neil,
Thank you! I had same problem and could not find it.
Solved!
Brgds,
Oebel
Hi Neil,
Thank you! I had same problem and could not find it.
Solved!
Brgds,
Oebel
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:
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.
The WDapi script connects to the database, in your case the connection is OK, otherwise there would have been an error message
The fields for the database are created from the text string
AND NOW the data is inserted in the database
$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()); }
When you use the WDapi in your browser you get those messages as the fields are not available URL?d=all_your_data_fields
w34_WDapi.php.zip (2.21 KB)
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
w34_WDapi.php.zip (2.24 KB)
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
Compare your site with the demo-site. It should be the temperature trend.
Most of the times it should be between -1 and + 1.
The script compares “current temp” with “temp 15 minutes” ago.
But you WD file as uploaded contains 2 extra spaces.
All fields after these two spaces are misaligned and current temp is now compared to lowest dewpoint today.
Please update to the latest WD release as this is an old problem.
Or use clientraw.txt for your data.
Why do I always ask for the link to the site?
To check a lot of values with this script: http://micklehamweather.com/pwsWD/w34_module_test.php
One can check the calculated “Live data values” or the WDapi values with the field-names.
All the uploaded files, as long as they are in the default folders, can also be inspected this way.
And any individual script can be run with error-reporting on.
Wim
Thanks again Wim - I have updated to the latest version of WD and it is working fine.
Neil
Silly trivial question: why are the legends (data source, hardware, etc.) not automatically centred? Is that css too?
Legend1 is my site, legend2 is your test site - viewed in Chrome.
In w34_easyweathersetup I have used this link to my webcam image: ./webcam/aad-axis-01.jpg?
Nothing is shown under “Live Web Cam” rectangle.
If I select “Live Web Cam” link at the bottom the static webcam image pops up.
Any idea what I’m doing wrong?
What is requirements for showing webcam image?
Can we add a url to the webcam when using an IP camera? Should we use http://xxx or just add fqdn?
When using an image what is the size requirements (X x Y pixels)?
the web cam Q was asked and answered further up in this thread
Please always the URL to your pwsWD folder. I had to scan your previous posts to find the URL.
Yes, it is in the CSS and the three lines itself are centred. But the block with the three is not centred in the footer.
It only has a 75px left margin to not interfere with the images on the left.
As I have a longer third line it only looks like the block with the three lines is centred.
Adapting the CSS is a not so trivial task for the April release.
Wim
The previous post recommends: “You set the link to “…/webcam/image.jpg” which is 100% correct”
This is what I have done by specifying …/webcam/aad-axis-01.jpg , but on an “X weathercam” is shown in rectangle for Live Web Cam
ls -l webcam
total 156
-rw------- 1 weather weather 158374 Jan 17 09:26 aad-axis-01.jpg
After posting the previous message I discovered my error: owner user and group was incorrect.
Now it is working
It’s working now. Thank you
Hi Wim,
Sorry I have another question, this maybe a bug or a lack of understanding on my part. Currently I have an AQI reading on my site of 99 - this is based on the nearest AQ station (for me it’s Footscray, Australia). If I go to the link for this station the AQI is actually 35 - see link below.
I have then checked the output for my AQI in the module_test page, I can see the reference of an AQI of 35, but nothing for 99. How is the 99 generated? Maybe I am wrong, but I assumed my site should be showing the same AQI as the source, which is 35.
The link to my site is,
https://micklehamweather.com/pwsWD/
Thanks,
Neil
Thank you, added future code for test and did not remove all before release :oops: A new version is attached.
One can check the files itself by using this script: https://micklehamweather.com/pwsWD/w34_module_test.php
Just use list contents and select “./jsondata/gov_aqi.txt” it shows all data (also in json).
Wim
gov_aqi_block.php.zip (3.1 KB)
Thanks Wim - it
[quote author=Cheffy link=topic=67468.msg542463#msg542463 date=1547890244]
Thanks Wim - it
gov_aqi_popup.php.zip (6.91 KB)
Moon rise and set appear to be shown an hour late: moon set in Edinburgh this morning was 0645, next moon rise is 1425.
There is an update on-line with all changed scripts: http://wd34.weather-template.com/
The moon-block.php and two new supporting scripts in the other/ folder could take care of it.
Wim