WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Topic started by: wvdkuil on March 28, 2019, 12:10:11 PM
-
I coded the Purpleair (PA-II) and the Luftdaten scripts in a similar way. Probably most questions/problems are similar, so both scripts will be supported in this topic.
PurpleAir NEW VERSION as of 2019-11-22
Demo: https://weather-template.nl/purpleair/index.html
Download: https://leuven-template.eu/leuven_download2019.php?id=purpleair
Readme: You will find the read-me pdf in the download, but you can read it here (https://weather-template.nl/purpleair/_readme%20FIRST.pdf) in a new window also.
Known issues:
For extended version2: upload to own website fails nearly always
==> added a fall-back in sensor script by downloading from the purpleair website
Luftdaten
Demo: https://leuven-template.eu/luftdaten/index.html
Download: https://leuven-template.eu/leuven_download2019.php?id=luftdaten
Readme: You will find the read-me pdf in the download, but you can read it here (https://leuven-template.eu/luftdaten/index.html) in a new window also.
Known issues: link will be added when needed
There are two versions of these scripts which both can be accessed and studied from the demo-page. The "basic version" reads your data form the suppliers database. A more "extensive version" expects the sensor to upload the row measurements to your own web-server. This will need more knowledge about http-bypass in your webserver-htaccess file.
Support:
When you post questions about the scripts, please always include the URL (=correct link) to the script on your website. That reduces the time for answering your questions.
Wim
-
Thanks, Wim!
-
Thanks again! YAY! :D
-
Hi wim
The test1 is working perfect test2 has an Error
https://www.wetterstation-johanngeorgenstadt.de/purpleair/_test2.php
https://www.wetterstation-johanngeorgenstadt.de/purpleair/_test1.php
with your Sensor ID work test2 with mine not why
Stefan
-
Hi wim
The test1 is working perfect test2 has an Error
https://www.wetterstation-johanngeorgenstadt.de/purpleair/_test2.php
https://www.wetterstation-johanngeorgenstadt.de/purpleair/_test1.php
with your Sensor ID work test2 with mine not why
Stefan
The test2 works when you upload the data from your purpleair sensor. You have to instruct the sensor to do that.
More info; https://www.wetterstation-johanngeorgenstadt.de/purpleair/_readme%20FIRST.pdf => 4. Upload our data
There were / are/ often problems when the data/ folder to upload into is on an https server
Succes, Wim
-
Hi Wim,
Have do this new and also again, test2 not work
4. Upload our data -> Step by Step
https://www.wetterstation-johanngeorgenstadt.de/sensorpurple2.php -> ok
https://www.wetterstation-johanngeorgenstadt.de/purpleair/_test2.php -> Error, not found the File
it's a Cache thing? I have all do as described,nothing else changed.
Stefan
-
Hi Wim,
Have do this new and also again, test2 not work
4. Upload our data -> Step by Step
https://www.wetterstation-johanngeorgenstadt.de/sensorpurple2.php -> ok
https://www.wetterstation-johanngeorgenstadt.de/purpleair/_test2.php -> Error, not found the File
it's a Cache thing? I have all do as described,nothing else changed.
Stefan
I have no idea.
But
1. you should create a data/ folder on your server
2. set line 12 in sensorpurple2.php to comment
$save_last_mes = true;
#$save_last_mes = false;
3. check if there is anything arriving in the data folder.
The purpleair sensor sends the data to
=> sensorpurple2.php
==> that script
===> stores the received measurements in an array in the data/ folder
and
===> optionally writes the received data into a text file to inspect: data/last_purple_data_ 14151.json
Also important, did you add https:// before the www in the link in your purpleair sensor?
Success,
Wim
-
Hi
Thanks have set the new Data Folder now in these Folder: see Attachment
Test2 not work have these also to the Attachment
last_purple_data_14151.json, Ds Store, and purple_24data_14151.arr cannot attach, but there is in the new data Folder
$save_last_mes = true; -> have set
#$save_last_mes = false; -> have set
test2 will not work
Stefan
-
Hi in the json stands :false
array is in attach
-
Hi
Thanks have set the new Data Folder now in these Folder: see Attachment
Test2 not work have these also to the Attachment
last_purple_data_14151.json, Ds Store, and purple_24data_14151.arr cannot attach, but there is in the new data Folder
$save_last_mes = true; -> have set
#$save_last_mes = false; -> have set
test2 will not work
Stefan
https://www.wetterstation-johanngeorgenstadt.de/data/last_purple_data_14151.json
==> is there but it has got no or no good data last time is was accessed
===> check if the date /time of that file changes according to the uploads from purpleair
https://www.wetterstation-johanngeorgenstadt.de/data/purple_24data_14151.arr
==> is there and seems a correct PHP-array
===> but it can not be accessed by the script https://www.wetterstation-johanngeorgenstadt.de/purpleair/_test2.php
====> so probably the permissions are not correct.
Could you please set the permissions for the data/ folder and alll its contents to #0777 or read/write by world?
-
set to 0777 no luck
see:https://www.purpleair.com/data.json?show=14151&key=XRBTRTSYC512PMRC
yes it changed Date+ Time when run sensorpurple2.php
-
set to 0777 no luck
see:https://www.purpleair.com/data.json?show=14151&key=XRBTRTSYC512PMRC
yes it changed Date+ Time when run sensorpurple2.php
https://www.wetterstation-johanngeorgenstadt.de/data/ gives a 403 error, so the permissions are (to) low.
https://www.wetterstation-johanngeorgenstadt.de/data/last_purple_data_14151.json always contains false, so the data is not (correct) sent by the sensor or other error
Question: did you set https:// or http:// before www.wetterstation. . . in the purpleair sensor
TODO:
You did put the scripts in purpleair/ws_purpleair2.php in their own folder.
You then have to change line 7 in ws_purpleair2.php from$useOwnDir = './data/';
to $useOwnDir = '../data/';
There should be TWO points to tell the script the data folder is 1 level below its own folder.
Wim
-
hi Wim
it works but all Data is 0 in there json
https://www.wetterstation-johanngeorgenstadt.de/data/last_purple_data_14151.json
https://www.wetterstation-johanngeorgenstadt.de/purpleair/ws_purpleair2.php
-
hi Wim
it works but all Data is 0 in there json
https://www.wetterstation-johanngeorgenstadt.de/data/last_purple_data_14151.json
https://www.wetterstation-johanngeorgenstadt.de/purpleair/ws_purpleair2.php
PS registered wih : https
-
hi Wim
it works but all Data is 0 in there json
https://www.wetterstation-johanngeorgenstadt.de/data/last_purple_data_14151.json
https://www.wetterstation-johanngeorgenstadt.de/purpleair/ws_purpleair2.php
The receiving script sets the value 'false" so that means no data or no correct data received on your webserver..
https://www.wetterstation-johanngeorgenstadt.de/data/last_purple_data_14151.json
Some setting in the purpleair is wrong
or
some communication problem between purpleair and the receiving script.
There were often problems when using https:// servers in the past also.
I have to think how we can test that.
Wim
-
hi Wim
it works but all Data is 0 in there json
https://www.wetterstation-johanngeorgenstadt.de/data/last_purple_data_14151.json
https://www.wetterstation-johanngeorgenstadt.de/purpleair/ws_purpleair2.php
The receiving script sets the value 'false" so that means no data or no correct data received on your webserver..
https://www.wetterstation-johanngeorgenstadt.de/data/last_purple_data_14151.json
Some setting in the purpleair is wrong
or
some communication problem between purpleair and the receiving script.
There were often problems when using https:// servers in the past also.
I have to think how we can test that.
Wim
Why is there user:password in the settings in purpleair header?
Wim
(https://www.wxforum.net/index.php?action=dlattach;topic=36471.0;attach=40403;image)
-
as in the Instruction say:
At the Key 3 field you enter the exact URL http://www.website.com/sensorpurple2.php
Key4 you type user:password
and Method you leave “Post” as it is
Data Provider #2: Custom
Data Provider #2 URL: http://www.website.com/sensorpurple2.php Data Provider
#2 HEADERS: user:password
Data Provider #2 METHOD: POST
-
you need the Link to change these settings per PM?
or give the email to forwarding the Mail from purple air to you
find in pm to you
-
message (mail) sent to you from here
-
you need the Link to change these settings per PM?
or give the email to forwarding the Mail from purple air to you
find in pm to you
I have my own Purpleair sensor but it failed uploading to my own server in June, no big problem as I always used the type-1 output on my site. Uploading was only needed when there was a user-problem as you have.
My current purpelair, which is a few years old, shows at the bottom of the sensor page
NTPLOCUPDPAATSATSS3RDTSBTSS3RD
V4.11 2.0+OPENLOG+15833 MB+DS3231+BME280+PMSX003-B+PMSX003-A
I tried all settings possible on the registration page.
With my version it is impossible to sent information to an https or an http site using post, get or put.
The messages arrive, but there is no data in the message, as it was until June this year.
Using $_REQUEST, GET , POST or 'php://input' returns no data at all.
Maybe your sensor has the same problem,
Wim
-
First message is adapted for a new version of the PurpleAir script.
The upload to ones own website seems to fail at 99% of the user-sites
I added a "fall-back" so, when there is no sensor data arriving directly, the sensor script reads the latest sensor-data from the PurpleAir database.
Wim
-
First message is adapted for a new version of the PurpleAir script.
The upload to ones own website seems to fail at 99% of the user-sites
I added a "fall-back" so, when there is no sensor data arriving directly, the sensor script reads the latest sensor-data from the PurpleAir database.
Wim
Now works with Version 2 many thanks Wim
-
For me _test2 is working ok, but saratoga page not.
https://okroglovreme.com/wxAqLuft.php (https://okroglovreme.com/wxAqLuft.php)
https://okroglovreme.com/luftdaten/ws_luftdaten2.php (https://okroglovreme.com/luftdaten/ws_luftdaten2.php)
what is correct record in setting?
$userSensor = 'esp8266-XXXXXX'
or
$userSensor = 'XXXXXX'
any toughts?
thx.
-
For me _test2 is working ok, but saratoga page not.
https://okroglovreme.com/wxAqLuft.php (https://okroglovreme.com/wxAqLuft.php)
https://okroglovreme.com/luftdaten/ws_luftdaten2.php (https://okroglovreme.com/luftdaten/ws_luftdaten2.php)
what is correct record in setting?
$userSensor = 'esp8266-XXXXXX'
or
$userSensor = 'XXXXXX'
any toughts?
thx.
I am on vacation with insufficient internet. The sensor in your case is the displayed in the test2 page, I think 38115
I will check it when I am back Feb 1/2 depending on some strikes.
Wim
Edited Febr 1: Seems working correctly now. Wim
-
Thanks for yet a great script from Leuven [tup] =D>
I've got everything working, except the "Luftdaten map" inside the "my_AqhiLuft2Page.php". I've found other Leuven templates, where it's actually working, so I suspect I didn't do everything correct #-o Anyways there are only 4 Luftdaten users visible on the map in Denmark.
Could it be a path related problem? I've copied the files to weather28/_my_scripts dir, and kept the data dir in weather28/luftdaten/data. The graphs didn't work before changing the path to:
# ---------- we load our own sensor to our site
$useOwnDir = './luftdaten/data/';
As I understand from the readme file, I shouldn't be necessary, to change path if I use weather28/ for the template?
https://www.vejrstationen.dk/weather28/index.php?p=mnu_aqhi_luft&wp=MB&lang=en (https://www.vejrstationen.dk/weather28/index.php?p=mnu_aqhi_luft&wp=MB&lang=en)
-
Thanks for yet a great script from Leuven [tup] =D>
I've got everything working, except the "Luftdaten map" inside the "my_AqhiLuft2Page.php". I've found other Leuven templates, where it's actually working, so I suspect I didn't do everything correct #-o Anyways there are only 4 Luftdaten users visible on the map in Denmark.
Could it be a path related problem? I've copied the files to weather28/_my_scripts dir, and kept the data dir in weather28/luftdaten/data. The graphs didn't work before changing the path to:
# ---------- we load our own sensor to our site
$useOwnDir = './luftdaten/data/';
As I understand from the readme file, I shouldn't be necessary, to change path if I use weather28/ for the template?
https://www.vejrstationen.dk/weather28/index.php?p=mnu_aqhi_luft&wp=MB&lang=en (https://www.vejrstationen.dk/weather28/index.php?p=mnu_aqhi_luft&wp=MB&lang=en)
chrome right click => inspect => console => errors => A "mixed content" problem.
Mixed Content: The page at 'https://www.vejrstationen.dk/weather28/index.php?p=mnu_aqhi_luft&wp=MB&lang=en' was loaded over HTTPS, but requested an insecure frame 'http://deutschland.maps.luftdaten.info/#6/55.899269/8.516578'. This request has been blocked; the content must be served over HTTPS.
Adapt the link from http://deutschland.maps.luftdaten.info to https://
Wim
-
Thanks for yet a great script from Leuven [tup] =D>
I've got everything working, except the "Luftdaten map" inside the "my_AqhiLuft2Page.php". I've found other Leuven templates, where it's actually working, so I suspect I didn't do everything correct #-o Anyways there are only 4 Luftdaten users visible on the map in Denmark.
Could it be a path related problem? I've copied the files to weather28/_my_scripts dir, and kept the data dir in weather28/luftdaten/data. The graphs didn't work before changing the path to:
# ---------- we load our own sensor to our site
$useOwnDir = './luftdaten/data/';
As I understand from the readme file, I shouldn't be necessary, to change path if I use weather28/ for the template?
https://www.vejrstationen.dk/weather28/index.php?p=mnu_aqhi_luft&wp=MB&lang=en (https://www.vejrstationen.dk/weather28/index.php?p=mnu_aqhi_luft&wp=MB&lang=en)
chrome right click => inspect => console => errors => A "mixed content" problem.
Mixed Content: The page at 'https://www.vejrstationen.dk/weather28/index.php?p=mnu_aqhi_luft&wp=MB&lang=en' was loaded over HTTPS, but requested an insecure frame 'http://deutschland.maps.luftdaten.info/#6/55.899269/8.516578'. This request has been blocked; the content must be served over HTTPS.
Adapt the link from http://deutschland.maps.luftdaten.info to https://
Wim
#-o
Thanks for helping
-
Hi There,
Great script, but I am having trouble using my own data via "ws_luftdaten2.php".
I used the "_test2.php" program and got the following error:
Warning: file_get_contents(./luftdaten/data/luft_24data_esp8266-14900835.arr): failed to open stream: No such file or directory in /homepages/27/d801236146/htdocs/luftdaten/ws_luftdaten2.php on line 108
There is no data in the ./luftdaten/data/ directory on the server, and I am not sure what to put in the sensor Configuration under "Own API".
I am using a Saratoga script and my domain is https://www.wraxallweather.co.uk/wxindex.php
The wxAqLuft.php is in the root directory and the other script files are under /luftdaten/
Any idea what I am doing wrong?
Thanks
Dave
-
Hi There,
Great script, but I am having trouble using my own data via "ws_luftdaten2.php".
I used the "_test2.php" program and got the following error:
Warning: file_get_contents(./luftdaten/data/luft_24data_esp8266-14900835.arr): failed to open stream: No such file or directory in /homepages/27/d801236146/htdocs/luftdaten/ws_luftdaten2.php on line 108
There is no data in the ./luftdaten/data/ directory on the server, and I am not sure what to put in the sensor Configuration under "Own API".
I am using a Saratoga script and my domain is https://www.wraxallweather.co.uk/wxindex.php
The wxAqLuft.php is in the root directory and the other script files are under /luftdaten/
Any idea what I am doing wrong?
Thanks
Dave
I am a little bit confused about which version this is, I could not find the readme
https://leuven-template.eu/luftdaten/_readme%20FIRST.pdf => second page.
You have to setup your sensor to upload the data to your own webserver first
The hardware used in the luftdaten sensor does not always allow to upload to https servers.
Succes, Wim
-
Hi Wim,
the "ws_luftdaten2.php" file says version "4.00 2018-07-20"
What do I put in the Server Box in the Configuration?
I put my domain name minus the "http://" part.
Is this wrong?
Thanks Dave.
-
Hi Wim
Ok, Fixed it by changing the privileges on the /luftdaten/data and /luftdaten directories on the website.
Dave
-
Hi There,
Great script, but I am having trouble using my own data via "ws_luftdaten2.php".
I used the "_test2.php" program and got the following error:
Warning: file_get_contents(./luftdaten/data/luft_24data_esp8266-14900835.arr): failed to open stream: No such file or directory in /homepages/27/d801236146/htdocs/luftdaten/ws_luftdaten2.php on line 108
There is no data in the ./luftdaten/data/ directory on the server, and I am not sure what to put in the sensor Configuration under "Own API".
I am using a Saratoga script and my domain is https://www.wraxallweather.co.uk/wxindex.php
The wxAqLuft.php is in the root directory and the other script files are under /luftdaten/
Any idea what I am doing wrong?
Thanks
Dave
I'm getting the same error. Checked Permissions, and everything looks OK
https://weatheryyc.com/pwsTEST/luftdaten/_test2.php
-
. . . shortened . . .
I'm getting the same error. Checked Permissions, and everything looks OK
https://weatheryyc.com/pwsTEST/luftdaten/_test2.php
Readme: https://weatheryyc.com/pwsTEST/luftdaten/_readme%20FIRST.pdf
Warning: file_get_contents(./data/luft_24data_esp8266-14321313.arr): failed to open stream:
No such file or directory in C:\Abyss Web Server\htdocs\pwsTEST\luftdaten\ws_luftdaten2.php on line 106
Maybe: When running a https website the small processor in the sensor will often not be able to upload data.
Therefor when the receiving script does not get any data, it will not create the file needed to display 24-hour data.
Or: Did you give the pwsTEST/luftdaten/data/ folder the highest permissions?
So is a www script such as pwsTEST/luftdaten/sensorluft2.php allowed to write data ?
Or: Maybe the script is incompatible with a windows server, but I can not test that myself.
Wim
-
I tested on a HTTP server and it works. Now to find a way around this.
-
Hi Wim,
According to my https://www.wraxallweather.co.uk/wxAqLuft.php (https://www.wraxallweather.co.uk/wxAqLuft.php) script, the latest reading I have was for 26/04/2020 16:03, two days ago.
The readings are still going to luftdaten site and the graphs are still being updated.
Nothing at this end has changed but the "luft_24data_esp8266-14900835.arr" file in /luftdaten/data has stopped updating.
Any idea where the problem might be?
I have the "Particulate Matter App" on my phone and everything is working there.
Thanks in advance,
Dave
-
Hi Wim,
According to my https://www.wraxallweather.co.uk/wxAqLuft.php (https://www.wraxallweather.co.uk/wxAqLuft.php) script, the latest reading I have was for 26/04/2020 16:03, two days ago.
The readings are still going to luftdaten site and the graphs are still being updated.
So the sensor is still functional, although there are gaps.
The luftdaten site is a different site as the graphs are coming from
=> https://www.madavi.de/sensor/images/sensor-esp8266-14900835-sds011-1-day.png
Nothing at this end has changed but the "luft_24data_esp8266-14900835.arr" file in /luftdaten/data has stopped updating.
Any idea where the problem might be?
I have the "Particulate Matter App" on my phone and everything is working there.
I am not familiar with that app. But I assume that app will not get its data from your webserver file "luft_24data_esp8266-14900835.arr" but from another source.
Thanks in advance,
Dave
Most luftdaten sensors are not able to upload to a https website.
Or they can not use a 301 from your server.
Maybe you switched to https or changed htaccess since April 26?
Checking the map https://deutschland.maps.sensor.community/#12/51.4468/-2.7439 I think your sensor number is 33862
The new luftdaten website: https://data.sensor.community/airrohr/v1/sensor/33862/
That sensor is also updating correctly.
Wim
-
Yes,
You are right, I did fix my .htaccess file to force everything to https
There is an option in the sensor configuration to send with HTTPS, does it not work?
If it doesn't then I will have to remove the script.
Dave.
-
Yes,
You are right, I did fix my .htaccess file to force everything to https
There is an option in the sensor configuration to send with HTTPS, does it not work?
If it doesn't then I will have to remove the script.
Dave.
It could work if it is a newer board used. But you need to change the sensor configuration also. Default it uses port 80.
https://leuven-template.eu/luftdaten/_readme%20FIRST.pdf => point 4.2
I am not familiar with the latest "sensor configuration" as my luftdaten is very old.
Wim
-
Hi Wim,
I have put everything back as it was before and it is now all working again.
I can't leave it in this state, moving to https will soon be a must.
[ You are not allowed to view attachments ]
Dave.
-
Hi Wim,
I have put everything back as it was before and it is now all working again.
I can't leave it in this state, moving to https will soon be a must.
[ You are not allowed to view attachments ]
Dave.
This works for me in the htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteCond %{QUERY_STRING} htp
RewriteCond %{QUERY_STRING} d
RewriteRule ^.*$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTPS} off
RewriteCond %{QUERY_STRING} !htp
RewriteCond %{QUERY_STRING} !d
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Wim
-
Hi Wim,
I just tried your .htaccess example, the luftdaten data file stopped coming to the /luftdaten/data directory.
The file updated as soon as I put the original .htaccess file back.
](*,)
Dave
-
Hi Wim,
I just tried your .htaccess example, the luftdaten data file stopped coming to the /luftdaten/data directory.
The file updated as soon as I put the original .htaccess file back.
](*,)
Dave
Yes, I see.
You screenshot shows for path:
/luftdaten/sensorluft2.php?
change that to /luftdaten/sensorluft2.php?htp
Incoming request at the htaccess file
will change the request from https to http if the query string has a variable with the name htp
and
will leave the http as is, if the query string contains htp
Wim
-
Hi Wim,
I have uploaded the .htaccess file with your example and changed the luftdaten config as you suggested,
and now it is working.
Your a Star. [tup]
Thanks, Dave
-
Hi Wim,
I am getting a 403 error on the graphs on the wxAqLuft.php page.
I see that they are missing on many other sites with this script. I have removed the graphs from my page at the moment.
Regards,
Dave
-
Hi Wim,
I just tried your .htaccess example, the luftdaten data file stopped coming to the /luftdaten/data directory.
The file updated as soon as I put the original .htaccess file back.
](*,)
Dave
Yes, I see.
You screenshot shows for path:
/luftdaten/sensorluft2.php?
change that to /luftdaten/sensorluft2.php?htp
Incoming request at the htaccess file
will change the request from https to http if the query string has a variable with the name htp
and
will leave the http as is, if the query string contains htp
Wim
Hello WIM,
Again thank you for ur scripts for AQI, but recently the png files that linked from the server is somewhat restricted, the result is my page is UNABLE to view the graph files http://www.pimohweather.com/wxLuftdatenAQI.php
I also checked your DEMOs and its the same. i check directly from MADAVI site to see its path, in can be viewed there but not during linked to my site it says "You don't have permission to access /sensor/images/sensor-esp8266-4390696-sds011-1-day.png on this server."
I hope there still a way to make this viewable on our pages.
Thanks and Regards
-Mike-
-
Hi There,
I gave up on those graphs on the MADAVI site.
I wrote a script to write the sensor JSON file to an SQL database, then displayed them with JPGraphs.
(http://[attachment id=1 msg=405949][/attachment]) The spike on the graph is the result of a large fire at a Premier Inn, 12 miles away to the North East.
Only done the day plot at the moment as I only have 4 days in an SQL database.
Dave
-
Hi Wim,
I am getting a 403 error on the graphs on the wxAqLuft.php page.
I see that they are missing on many other sites with this script. I have removed the graphs from my page at the moment.
Regards, Dave
Hello WIM,
Again thank you for ur scripts for AQI, but recently the png files that linked from the server is somewhat restricted, the result is my page is UNABLE to view the graph files http://www.pimohweather.com/wxLuftdatenAQI.php
. . . shortened. . .
The madavi graphs are not available anymore for deep-linking. And the page itself from Madavi can not be used in a iFrame either.
leider haben es einige Nutzer mit der Einbindung der Grafiken übertrieben und erzeugen damit eine extrem hohe Last auf dem Server.
Wir mussten daher die Einbindung auf externen Webseiten unterbinden. Die Grafiken sind nur noch direkt auf Madavi.de abrufbar.
translated by google
unfortunately some users have it with the integration of the graphics exaggerated and thus create an extremely high load on the server.
We therefore had to prevent the integration on external websites. The Graphics can only be called up directly on Madavi.de.
I removed those pages also for my own websites. You can easily switch any sub-page on/off in the settings of the scripts.
Wim
-
Hi There,
I gave up on those graphs on the MADAVI site.
I wrote a script to write the sensor JSON file to an SQL database, then displayed them with JPGraphs.
(http://[attachment id=1 msg=405949][/attachment]) The spike on the graph is the result of a large fire at a Premier Inn, 12 miles away to the North East.
Only done the day plot at the moment as I only have 4 days in an SQL database.
Dave
Hello,
We hope you could share your script with weekly, monthly and yearly since the MADAVI png files are resticted, I cant report to our local environment AQI reports due to this.
regards
-Mike-
-
Hi Wim,
I am getting a 403 error on the graphs on the wxAqLuft.php page.
I see that they are missing on many other sites with this script. I have removed the graphs from my page at the moment.
Regards, Dave
Hello WIM,
Again thank you for ur scripts for AQI, but recently the png files that linked from the server is somewhat restricted, the result is my page is UNABLE to view the graph files http://www.pimohweather.com/wxLuftdatenAQI.php
. . . shortened. . .
The madavi graphs are not available anymore for deep-linking. And the page itself from Madavi can not be used in a iFrame either.
leider haben es einige Nutzer mit der Einbindung der Grafiken übertrieben und erzeugen damit eine extrem hohe Last auf dem Server.
Wir mussten daher die Einbindung auf externen Webseiten unterbinden. Die Grafiken sind nur noch direkt auf Madavi.de abrufbar.
translated by google
unfortunately some users have it with the integration of the graphics exaggerated and thus create an extremely high load on the server.
We therefore had to prevent the integration on external websites. The Graphics can only be called up directly on Madavi.de.
I removed those pages also for my own websites. You can easily switch any sub-page on/off in the settings of the scripts.
Wim
I see it now so no choice, I should find alternative to view its graph then. Thanks for Clarification.
Regards
-Mike-
-
Hi There,
Before we can start, do you have the user sensor file coming to your /luftdaten/data directory on your server?
it will look like "luft_24data_esp8266-14900835.arr"
Regards,
Dave.
-
Hi There,
Before we can start, do you have the user sensor file coming to your /luftdaten/data directory on your server?
it will look like "luft_24data_esp8266-14900835.arr"
Regards,
Dave.
Hello, yes I have that exactly but I temporarily disabled it because im using WIM's script that directly reads data from luft servers
Regards
-Mike-
-
Hi Mike,
First task is to read that sensor file, I modified Wim's "Saratoga" script to read the sensor file.
Then wrote a script to run as a cron to load the data into an SQL database.
There are several graph/chart packages that can be used to display SQL data, I like JPGraphs, but you could use HighCharts.
I can help with reading the sensor file and the SQL load script, but explaining graph packages would take forever. There is a lot on the forum about using these packages.
If you would like to go down the route of getting the data into an SQL database, let me know?
Cheers,
Dave
-
Well not bad i INSTEAD USE its gaffana graphs, however the monthly and yearly graphs are not available so still need to redirect to MADAVI site for it, but at least I got daily graphs
-
Hi Wim,
i like your skript for purpleair,
and i have a little problem..
https://wetter.priesterath.net/purpleair/_test2.php
I would like only the page with all the data first. Otherwise I always have to click on more.
I just can't do it. :roll:
Thx Sperber
-
Hi Wim,
i like your skript for purpleair,
and i have a little problem..
https://wetter.priesterath.net/purpleair/_test2.php
I would like only the page with all the data first. Otherwise I always have to click on more.
I just can't do it. :roll:
Thx Sperber
Most people only want a low (small) block on their page. So default the condensed data is used with a button to extend.
Script ws_purpleair2.php lines 360-361 now use the $aq_condensed_html
if (isset ($purple_html) && $purple_html == true)
{ echo $pageHTML_0.$aq_condensed_html.$pageHTML_9; }
Change that so that all information is shown
if (isset ($purple_html) && $purple_html == true)
{ echo $pageHTML_0.$aq_fullpage_html.$pageHTML_9; }
That should do it.
Wim
-
Thanks, that was quick.
It's going to be a special project.
Since all the air data measuring devices differ too much for me, I will present 3 manufacturers on one page.
Your script is the first for Purple Air.
IQAir AirVisual Pro from Switzerland and https://www.air-q.com/ from Germany are added.
I'm waiting for the delivery.
All are placed in the same location.
Maybe you can help me with the page ?!
Thanks Sperber
-
Hello Wim ...
Long time since the beteljuice last annoyed you :grin:
Woken up by the last few posts I fancied a change, and thought I'd have a quick look under the bonnet and see what you've done with the AQ stuff.
So I've messed about tweaked a bit and Here are the results (http://www.beteljuice.co.uk/purpleair/purp1.php)
Done very little really, just light cosmetics. :roll:
BTW - You seem to have very good air ATM - Last 24h avg 4 µg/m3
I judge my air by how bad the birds are coughing !
-
@the beteljuice
[tup]
-
Hi Wim!
Thanks for the script!
It is working "kinda good" :roll:
Having a little problem with saratoga-template...
Do you know why nothing is shown in /wxAqLuft.php while using ws_luftdaten2.php ???
_test2.php and ws_luftdaten2.php are actually working but wxAqLuft.php is not showing anything... :???: (i already changed wxAqLuft.php to show ws_luftdaten2.php but nothing...)?
www.meteotaranto.org/wxAqLuft.php
Thank you,
Silvio. :grin:
-
Hi Wim!
Thanks for the script!
It is working "kinda good" :roll:
Having a little problem with saratoga-template...
Do you know why nothing is shown in /wxAqLuft.php while using ws_luftdaten2.php ???
_test2.php and ws_luftdaten2.php are actually working but wxAqLuft.php is not showing anything... :???: (i already changed wxAqLuft.php to show ws_luftdaten2.php but nothing...)?
www.meteotaranto.org/wxAqLuft.php
Thank you,
Silvio. :grin:
Fairly difficult to debug. On top of that, add the continuous change and blocking of luftdaten maps and madavi graphs which also needs some work.
So it is easier for you to make a new page to the menu starting with the wxnewpage.php
You can then add the working http://www.meteotaranto.org/luftdaten/ws_luftdaten2.php in an iframe
And add any other interesting and still working information you may need.
Wim
-
Hi Wim!
Thanks for the script!
It is working "kinda good" :roll:
Having a little problem with saratoga-template...
Do you know why nothing is shown in /wxAqLuft.php while using ws_luftdaten2.php ???
_test2.php and ws_luftdaten2.php are actually working but wxAqLuft.php is not showing anything... :???: (i already changed wxAqLuft.php to show ws_luftdaten2.php but nothing...)?
www.meteotaranto.org/wxAqLuft.php
Thank you,
Silvio. :grin:
Fairly difficult to debug. On top of that, add the continuous change and blocking of luftdaten maps and madavi graphs which also needs some work.
So it is easier for you to make a new page to the menu starting with the wxnewpage.php
You can then add the working http://www.meteotaranto.org/luftdaten/ws_luftdaten2.php in an iframe
And add any other interesting and still working information you may need.
Wim
Thank you Wim.
I'll try what you said once i'm back home.
Will let you know if it works!
Thank you! :grin:
Silvio
-
Dear Wim,
while i'm trying to make work about what you said, i'm now using ws_luftdaten1.php
Good. Now the "big" question:
Is there a way to create a new IQA for like Italy?? :-k :-k
Silvio.
:grin:
-
Dear Wim,
. . .
Is there a way to create a new IQA for like Italy?? :-k :-k
. . .
If you want to use the Italian language
- Copy ws_luft_langEN.php and name it ws_luft_langEN.php
- Change all English text at the right of the = to Italian texts.
Do not change any texts at the lef of the = !
Then the texts would all be in Italian.
Wim
-
Dear Wim,
. . .
Is there a way to create a new IQA for like Italy?? :-k :-k
. . .
If you want to use the Italian language
- Copy ws_luft_langEN.php and name it ws_luft_langEN.php
- Change all English text at the right of the = to Italian texts.
Do not change any texts at the lef of the = !
Then the texts would all be in Italian.
Wim
Dear Wim,
i guess we didn't understand each other :oops:
I'm talking about creating a new IQA Index with the Italian values...
Like the US/NL etc...
[ You are not allowed to view attachments ]
Thank you :grin:
-
Dear Wim,
. . .
Is there a way to create a new IQA for like Italy?? :-k :-k
. . .
If you want to use the Italian language
- Copy ws_luft_langEN.php and name it ws_luft_langEN.php
- Change all English text at the right of the = to Italian texts.
Do not change any texts at the lef of the = !
Then the texts would all be in Italian.
Wim
Dear Wim,
i guess we didn't understand each other :oops:
I'm talking about creating a new IQA Index with the Italian values...
Like the US/NL etc...
[ You are not allowed to view attachments ]
Thank you :grin:
I was not aware of an Italian AQ-index.
As you can understand adding a totally new index (not the words but the levels) will costs a lot of hours of my spare time.
Sadly the AQ scripts seems not to be used that much and neither are they appreciated that much.
I should better spent my free time enhancing scripts which are used and valued more.
Wim
-
Dear Wim,
. . .
Is there a way to create a new IQA for like Italy?? :-k :-k
. . .
If you want to use the Italian language
- Copy ws_luft_langEN.php and name it ws_luft_langEN.php
- Change all English text at the right of the = to Italian texts.
Do not change any texts at the lef of the = !
Then the texts would all be in Italian.
Wim
Dear Wim,
i guess we didn't understand each other :oops:
I'm talking about creating a new IQA Index with the Italian values...
Like the US/NL etc...
[ You are not allowed to view attachments ]
Thank you :grin:
I was not aware of an Italian AQ-index.
As you can understand adding a totally new index (not the words but the levels) will costs a lot of hours of my spare time.
Sadly the AQ scripts seems not to be used that much and neither are they appreciated that much.
I should better spent my free time enhancing scripts which are used and valued more.
Wim
Dear Wim,
i totally understand what you are saying.
I kinda knew that it wasn't an "easy-to-do" thing but i asked anyway...
Thank you for your support! :grin:
-
Hi Wim,
I switched my website to phph 8.0.3 yesterday.
Everything is (seems) ok.
I decided to check one of the error files on my site and I saw this error appearing since yesterday :
2021/04/20 16:31:00 [error] 16737#0: *7634892 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined array key "accuracy" in /var/www/vhosts/matar.be/httpdocs/weather/sensorpurple3.php on line 133" while reading response header from upstream, client: 81.242.122.10, server: matar.be, request: "POST /weather/sensorpurple3.php HTTP/1.1", upstream: "fastcgi://unix:///var/www/vhosts/system/matar.be/php-fpm.sock:", host: "www.matar.be"
Because I don't know php very well, have you an idea how to solve this?
Thank you
-
Hi Wim,
I switched my website to phph 8.0.3 yesterday.
Everything is (seems) ok.
I decided to check one of the error files on my site and I saw this error appearing since yesterday :
2021/04/20 16:31:00 [error] 16737#0: *7634892 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined array key "accuracy" in /var/www/vhosts/matar.be/httpdocs/weather/sensorpurple3.php on line 133" while reading response header from upstream, client: 81.242.122.10, server: matar.be, request: "POST /weather/sensorpurple3.php HTTP/1.1", upstream: "fastcgi://unix:///var/www/vhosts/system/matar.be/php-fpm.sock:", host: "www.matar.be"
Because I don't know php very well, have you an idea how to solve this?
Thank you
Seems that one of the seldom used fields is not uploaded anymore by the sensor, missing?
No idea since when, I have to check some other sensors.
PHP-8 does not like missing items and generated a message, in the past it was a null value.
Luckily your settings saved the last posted message in a cache file, so that made debugging very easy.
Change line 133 in weather/sensorpurple3.php from
$accuracy = (float) $this_mes['accuracy'];
to
$accuracy = -1;
Wim
-
Wim,
thank you for your quick response.
Made the correction.
-
Hi Wim,
Is it also possible to use the AQI script, of course after some adjustments, for the Davis Airlink sensor?
Greetings,
Peter.
-
Hi Wim,
Is it also possible to use the AQI script, of course after some adjustments, for the Davis Airlink sensor?
Greetings,
Peter.
Sorry, no.
I stopped enhancing all "donation-ware" scripts.
But the Airlink sensor is supported in the free PWS_Dashboard scripts.
Wim
-
Hi Wim
I have been using the excellent standalone luftdaten scripts without any problems until 1st Jan this year when they stopped updating. I discovered the sensor link url had changed from http://api.luftdaten.info/v1/sensor/####/ (http://api.luftdaten.info/v1/sensor/####/) to https://data.sensor.community/airrohr/v1/sensor/####/ (https://data.sensor.community/airrohr/v1/sensor/####/)
I updated the ws_luftdaten1.php and _test1.php scripts and the sensor readings updated again ok.
https://www.tottonweather.co.uk/luftdaten/ws_luftdaten1.php (https://www.tottonweather.co.uk/luftdaten/ws_luftdaten1.php)
However the ws_luftdaten2.php and _test2 scripts do not update and I cannot see any link in them to change.
https://www.tottonweather.co.uk/luftdaten/ws_luftdaten2.php (https://www.tottonweather.co.uk/luftdaten/ws_luftdaten2.php)
I then discovered the luft_24data_esp8266-6535739.arr file had not updated since 1 Jan despite no changes to the sensor config by myself on the custom api. Sensor has been rebooted and running on latest firmware.
The PWS luftdaten popup on https://www.tottonweather.co.uk/homeweather-station/ (https://www.tottonweather.co.uk/homeweather-station/) still updates ok.
Any help appreciated.
Thanks
Roger
-
. . .
However the ws_luftdaten2.php and _test2 scripts do not update and I cannot see any link in them to change.
https://www.tottonweather.co.uk/luftdaten/ws_luftdaten2.php (https://www.tottonweather.co.uk/luftdaten/ws_luftdaten2.php)
I then discovered the luft_24data_esp8266-6535739.arr file had not updated since 1 Jan despite no changes to the sensor config by myself on the custom api. Sensor has been rebooted and running on latest firmware.
. . .
The luftdaten2 receive script sensorluft2.php accepts a HTTP post from your sensor.
Your website is using https and probably re-directs all incoming http requests?
Please check your Luftdaten sensor setup.
If it still uses http to access your server
=> the access is redirected by your webserver and the sensor data is lost
==> according to the http-to-https standards the http payload is "untrusted"
So the sensorluft2.php gets an access with empty data and discards it.
Wim
-
Your website is using https and probably re-directs all incoming http requests?
Yes there has been a redirect for over a year when I went to https so why did it not reject before [ You are not allowed to view attachments ] ?
I have tried changing the custom api to https as screenshot attached but no change. The password box continues to show "password" so don't know if it is retaining it.
Seems odd that the luftdaten api had to be updated at the same time. From the airrohr forum a post said there was a redirect for 2 years which presumably expired.
-
Good morning wim
I'm trying to get the _test2.php script to work
but I get the error Warning: file_get_contents (./ data / luft_24data_esp8266-5220886.arr): failed to open stream: No such file or directory in /web/htdocs/www.pomeziameteo.it/home/luftdaten/ws_luftdaten2.php on line 106
I have configured this in my detector
also tried to put the .htaccess file as you recommended but nothing
do you have any idea where am i wrong? :oops:
Thank you
-
Good morning wim
I'm trying to get the _test2.php script to work
but I get the error Warning: file_get_contents (./ data / luft_24data_esp8266-5220886.arr): failed to open stream: No such file or directory in /web/htdocs/www.pomeziameteo.it/home/luftdaten/ws_luftdaten2.php on line 106
I have configured this in my detector
also tried to put the .htaccess file as you recommended but nothing
do you have any idea where am i wrong? :oops:
Thank you
Maybe try to check this on line 8
$useOwnData = $useOwnDir.'luft_24data_esp8266-'.$userSensor.'.arr';
it says it should YOUR sensor ID number to detect the arr files so try to check this then put your number like this in line 4
$userSensor = '5220886';
if not, put your ID number there to detect it in folder and you dont need to put user name and password in API settings just leave as blank as it is
second dont add space between your ./ data / folder do like this
$useOwnDir = './data/'; not this = './ data /';
hope it helps
-
Good morning wim
I'm trying to get the _test2.php script to work
but I get the error Warning: file_get_contents (./ data / luft_24data_esp8266-5220886.arr): failed to open stream: No such file or directory in /web/htdocs/www.pomeziameteo.it/home/luftdaten/ws_luftdaten2.php on line 106
I have configured this in my detector
also tried to put the .htaccess file as you recommended but nothing
do you have any idea where am i wrong? :oops:
Thank you
Maybe try to check this on line 8
$useOwnData = $useOwnDir.'luft_24data_esp8266-'.$userSensor.'.arr';
it says it should YOUR sensor ID number to detect the arr files so try to check this then put your number like this in line 4
$userSensor = '5220886';
if not, put your ID number there to detect it in folder and you dont need to put user name and password in API settings just leave as blank as it is
second dont add space between your ./ data / folder do like this
$useOwnDir = './data/'; not this = './ data /';
hope it helps
I did as you told me but nothing to do
one thing I did not understand
if not, put your ID number there to detect it in folder and you dont need to put user name and password in API settings just leave as blank as it is
-
Good morning wim
I'm trying to get the _test2.php script to work
but I get the error Warning: file_get_contents (./ data / luft_24data_esp8266-5220886.arr): failed to open stream: No such file or directory in /web/htdocs/www.pomeziameteo.it/home/luftdaten/ws_luftdaten2.php on line 106
I have configured this in my detector
also tried to put the .htaccess file as you recommended but nothing
do you have any idea where am i wrong? :oops:
Thank you
Maybe try to check this on line 8
$useOwnData = $useOwnDir.'luft_24data_esp8266-'.$userSensor.'.arr';
it says it should YOUR sensor ID number to detect the arr files so try to check this then put your number like this in line 4
$userSensor = '5220886';
if not, put your ID number there to detect it in folder and you dont need to put user name and password in API settings just leave as blank as it is
second dont add space between your ./ data / folder do like this
$useOwnDir = './data/'; not this = './ data /';
hope it helps
I did as you told me but nothing to do
one thing I did not understand
if not, put your ID number there to detect it in folder and you dont need to put user name and password in API settings just leave as blank as it is
On your ws_luftdaten2, change the I'd number and put your sensor ID number on it and since I saw your configuration you add username to it, it should left it blank also on your configuration remove the ? At the end it should be /sensorluft.php , remove the ? At the end maybe that's the reason why it doesn't generate .arr file to your /data folder
-
Good morning wim
I'm trying to get the _test2.php script to work
but I get the error Warning: file_get_contents (./ data / luft_24data_esp8266-5220886.arr): failed to open stream: No such file or directory in /web/htdocs/www.pomeziameteo.it/home/luftdaten/ws_luftdaten2.php on line 106
I have configured this in my detector
also tried to put the .htaccess file as you recommended but nothing
do you have any idea where am i wrong? :oops:
Thank you
Maybe try to check this on line 8
$useOwnData = $useOwnDir.'luft_24data_esp8266-'.$userSensor.'.arr';
it says it should YOUR sensor ID number to detect the arr files so try to check this then put your number like this in line 4
$userSensor = '5220886';
if not, put your ID number there to detect it in folder and you dont need to put user name and password in API settings just leave as blank as it is
second dont add space between your ./ data / folder do like this
$useOwnDir = './data/'; not this = './ data /';
hope it helps
I did as you told me but nothing to do
one thing I did not understand
if not, put your ID number there to detect it in folder and you dont need to put user name and password in API settings just leave as blank as it is
On your ws_luftdaten2, change the I'd number and put your sensor ID number on it and since I saw your configuration you add username to it, it should left it blank also on your configuration remove the ? At the end it should be /sensorluft.php , remove the ? At the end maybe that's the reason why it doesn't generate .arr file to your /data folder
In the meantime, thanks for helping me
but the username where should I enter that I did not understand?
-
Good morning wim
I'm trying to get the _test2.php script to work
but I get the error Warning: file_get_contents (./ data / luft_24data_esp8266-5220886.arr): failed to open stream: No such file or directory in /web/htdocs/www.pomeziameteo.it/home/luftdaten/ws_luftdaten2.php on line 106
I have configured this in my detector
also tried to put the .htaccess file as you recommended but nothing
do you have any idea where am i wrong? :oops:
Thank you
Maybe try to check this on line 8
$useOwnData = $useOwnDir.'luft_24data_esp8266-'.$userSensor.'.arr';
it says it should YOUR sensor ID number to detect the arr files so try to check this then put your number like this in line 4
$userSensor = '5220886';
if not, put your ID number there to detect it in folder and you dont need to put user name and password in API settings just leave as blank as it is
second dont add space between your ./ data / folder do like this
$useOwnDir = './data/'; not this = './ data /';
hope it helps
I did as you told me but nothing to do
one thing I did not understand
if not, put your ID number there to detect it in folder and you dont need to put user name and password in API settings just leave as blank as it is
On your ws_luftdaten2, change the I'd number and put your sensor ID number on it and since I saw your configuration you add username to it, it should left it blank also on your configuration remove the ? At the end it should be /sensorluft.php , remove the ? At the end maybe that's the reason why it doesn't generate .arr file to your /data folder
In the meantime, thanks for helping me
but the username where should I enter that I did not understand?
(see image below)
-
Good morning wim
I'm trying to get the _test2.php script to work
but I get the error Warning: file_get_contents (./ data / luft_24data_esp8266-5220886.arr): failed to open stream: No such file or directory in /web/htdocs/www.pomeziameteo.it/home/luftdaten/ws_luftdaten2.php on line 106
I have configured this in my detector
also tried to put the .htaccess file as you recommended but nothing
do you have any idea where am i wrong? :oops:
Thank you
1. Test http://www.pomeziameteo.it/luftdaten/sensorluft2.php that is an http request in your browser
2. using inspect (right click in most browsers) you can check what happens with the request
3. it is redirected to https and by the security definitions all data is lost.
See attached screenshot
So either
you have to have a sensor with enough processing power to process modern https => very unlikely
or
you have to set the .htaccess to not redirect the commands to the luftdaten folder
But when someone wants to check this problem, you have to
1. post the complete .htaccess file
2. and tell us were you put that file on your webserver.
Your current .htaccess (or cPanel settings) still force all http luftdaten folder traffic to https.
All other settings are OK. The ? can be added or left out.
We use that to test, fi.i. with ?some_test=12345
User and Password need not to be set, we use those when for some reason, new users copy your examples and upload other sensor-data.
Then one can add an extra password check.
Wim
-
But in fact Wim I was just reading some previous post and on my web server I can't find an htaccess ](*,)
-
But in fact Wim I was just reading some previous post and on my web server I can't find an htaccess ](*,)
It all depends on your hosting company.
You can ask your provider and explain you want to allow http traffic to the luftdaten/data/ folder.
Most hosting companies allow you to have a .htaccess in the user-root of your website (I think it is "home" in your setup).
In that folder you have a luftdaten folder and probably a lot more folders
There you insert a text-file with .htaccess similar to this one inside that home folder.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/luftdaten/data/
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
But check with your provider, they are paid by you to help you with this.
Also any file starting with a . is hidden, only visible with a decent ftp program of a cPanel file browser.
Wim
-
Wim I put the htaccess file in the root of the aruba server, but in doing so the site goes down.
on the aruba server there is a redirect function from http to https enabled.
I think the problem is as you say
Now I talk to Aruba customer service and explain that the luftdaten folder must work in http
I will keep you updated thanks as always
-
Hi Wim, here I am again
I changed host from Aruba I switched to Keliweb and I had the luftdaten folder dedicated in http but the problem remains the same
http://pomeziameteo.it/luftdaten/_test2.php
Warning: file_get_contents (./ data / luft_24data_esp8266-5220886.arr): failed to open stream: No such file or directory in /home/fqtreomy/public_html/luftdaten/ws_luftdaten2.php on line 106
:oops: :oops: :oops:
-
Hi Wim, here I am again
I changed host from Aruba I switched to Keliweb and I had the luftdaten folder dedicated in http but the problem remains the same
http://pomeziameteo.it/luftdaten/_test2.php
Warning: file_get_contents (./ data / luft_24data_esp8266-5220886.arr): failed to open stream: No such file or directory in /home/fqtreomy/public_html/luftdaten/ws_luftdaten2.php on line 106
:oops: :oops: :oops:
Please check if there is any data in the ./luftdaten/data/ folder.
And post what files are there and what date/time they were modified.
Checking ourselves is not possible as we are not allowed to browse that folder from the internet.
Wim
-
Wim the given folder and empty no files
-
Wim the given folder and empty no files
Is it writable? So could a script write to that folder and make new files into it?
Change line 10 sensorluft2.php from $save_last_mes = false;
to # $save_last_mes = false;
That way it will at least write a file, empty or not.
Wim
-
Yes, the write settings are 777
I am attaching 2 screanshots of the settings if it can be useful
-
also this screanshot
-
Yes, the write settings are 777
I am attaching 2 screanshots of the settings if it can be useful
The settings should also set to include the files, not only the folder.
Also see my previous post and change line 10 to write any message coming in.
Wim
-
also this screanshot
Also try to remove the ? in your sensor settings, it should do no harm but who knows for sure.
Wim
-
Then wim
I removed ?
and set up like this
the data folder remains empty
<? php
# ------------------------------------- SETTINGS
$ timezone = 'Europe / Brussels';
# $ timezone = 'America / New_York';
#
$ data_dir = './data/'; // relative to this calling script ## 2018-08-25
# $ data_dir = './cache';
#
$ save_last_mes = true; // copy upload to disk also
# $ save_last_mes = false;
$ load_regional = true; // load sensor data to LOCAL site (f.i. leuvenair) needs userid-pw
$ load_regional = false;
-
Then wim
I removed ?
and set up like this
the data folder remains empty
<? php
# ------------------------------------- SETTINGS
$ timezone = 'Europe / Brussels';
# $ timezone = 'America / New_York';
#
$ data_dir = './data'; // relative to this calling script ## 2018-08-25
# $ data_dir = './cache';
#
$ save_last_mes = true; // copy upload to disk also
# $ save_last_mes = false;
$ load_regional = true; // load sensor data to LOCAL site (f.i. leuvenair) needs userid-pw
$ load_regional = false;
If there is no data arriving in the folder, there is nothing I can do from here.
There are dozens of users when counting the requests for support for this script.
I can not debug from the outside internet into your protected website as you are currently the only one reporting problems.
If it fails in your specific environment:
Option 1 -> use the normal version.
Or option 2: use another script to handle your sensor.
The script had no PHP 500 errors http://pomeziameteo.it/luftdaten/sensorluft2.php?sce=view
It accepts data: https://pomeziameteo.it/luftdaten/sensorluft2.php?HTTP_SENSOR=123456
Maybe it gets no good / invalid data
Maybe it can not write data
Maybe .. ?
It also returns an enormous amount of tracking information from your provider.
Is it a "free" provider?
Sorry, I can not do anything more than guessing what could be wrong in your setup.
Wim
-
no it's not a free provider
I will use the normal version thanks Wim himself