Author Topic: Support of "Leuven" Air Quality scripts  (Read 9660 times)

0 Members and 1 Guest are viewing this topic.

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #25 on: February 23, 2020, 06:00:54 AM »
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
chrome right click => inspect => console => errors  => A "mixed content" problem.
Quote
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

Offline plex

  • Contributor
  • ***
  • Posts: 102
Re: Support of "Leuven" Air Quality scripts
« Reply #26 on: February 23, 2020, 06:11:42 AM »
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
chrome right click => inspect => console => errors  => A "mixed content" problem.
Quote
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




Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Re: Support of "Leuven" Air Quality scripts
« Reply #27 on: March 07, 2020, 10:50:42 AM »
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
 

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #28 on: March 07, 2020, 11:18:37 AM »
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

Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Re: Support of "Leuven" Air Quality scripts
« Reply #29 on: March 07, 2020, 11:26:11 AM »
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.


Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Re: Support of "Leuven" Air Quality scripts
« Reply #30 on: March 07, 2020, 01:00:03 PM »
Hi Wim

Ok, Fixed it by changing the privileges on the /luftdaten/data and /luftdaten directories on the website.

Dave

Offline blainec

  • Senior Member
  • **
  • Posts: 70
    • Weather YYC
Re: Support of "Leuven" Air Quality scripts
« Reply #31 on: March 18, 2020, 11:20:37 PM »
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

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #32 on: March 20, 2020, 02:57:14 PM »
. . .  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

Code: [Select]
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




Offline blainec

  • Senior Member
  • **
  • Posts: 70
    • Weather YYC
Re: Support of "Leuven" Air Quality scripts
« Reply #33 on: March 21, 2020, 12:13:00 AM »
I tested on a HTTP server and it works. Now to find a way around this.

Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Re: Support of "Leuven" Air Quality scripts
« Reply #34 on: April 28, 2020, 11:01:51 AM »
Hi Wim,

According to my 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

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #35 on: April 28, 2020, 11:52:30 AM »
Hi Wim,

According to my 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
Quote
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.
Quote
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
« Last Edit: April 28, 2020, 12:03:53 PM by wvdkuil »

Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Re: Support of "Leuven" Air Quality scripts
« Reply #36 on: April 28, 2020, 12:11:15 PM »
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.

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #37 on: April 28, 2020, 12:19:30 PM »
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

Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Re: Support of "Leuven" Air Quality scripts
« Reply #38 on: April 28, 2020, 12:50:00 PM »
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.

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #39 on: April 28, 2020, 12:54:09 PM »
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
Code: [Select]
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

Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Re: Support of "Leuven" Air Quality scripts
« Reply #40 on: April 29, 2020, 04:11:11 AM »
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

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #41 on: April 29, 2020, 04:19:50 AM »
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:
Code: [Select]
/luftdaten/sensorluft2.php?change that to
Code: [Select]
/luftdaten/sensorluft2.php?htpIncoming 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

Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Re: Support of "Leuven" Air Quality scripts
« Reply #42 on: April 29, 2020, 04:34:33 AM »
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

Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Re: Support of "Leuven" Air Quality scripts
« Reply #43 on: May 04, 2020, 05:32:08 AM »
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

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Support of "Leuven" Air Quality scripts
« Reply #44 on: May 18, 2020, 05:36:35 AM »
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:
Code: [Select]
/luftdaten/sensorluft2.php?change that to
Code: [Select]
/luftdaten/sensorluft2.php?htpIncoming 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-

Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Re: Support of "Leuven" Air Quality scripts
« Reply #45 on: May 18, 2020, 05:52:31 AM »
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.

   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

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #46 on: May 18, 2020, 06:16:46 AM »
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
« Last Edit: May 18, 2020, 06:18:46 AM by wvdkuil »

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Support of "Leuven" Air Quality scripts
« Reply #47 on: May 20, 2020, 04:36:49 AM »
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.

   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-
« Last Edit: May 20, 2020, 04:40:22 AM by pimohdaimaoh »

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Support of "Leuven" Air Quality scripts
« Reply #48 on: May 20, 2020, 04:41:42 AM »
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-

Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Re: Support of "Leuven" Air Quality scripts
« Reply #49 on: May 20, 2020, 04:49:54 AM »
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.

 

anything