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

0 Members and 1 Guest are viewing this topic.

Offline pimohdaimaoh

  • Senior Contributor
  • ****
  • Posts: 288
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Support of "Leuven" Air Quality scripts
« Reply #75 on: April 16, 2022, 07:58:18 AM »
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
« Last Edit: April 16, 2022, 08:06:40 AM by pimohdaimaoh »

Offline djroby19

  • Senior Member
  • **
  • Posts: 88
    • Pomeziameteo
Re: Support of "Leuven" Air Quality scripts
« Reply #76 on: April 16, 2022, 09:09:49 AM »
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

Offline pimohdaimaoh

  • Senior Contributor
  • ****
  • Posts: 288
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Support of "Leuven" Air Quality scripts
« Reply #77 on: April 16, 2022, 12:01:48 PM »
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
« Last Edit: April 16, 2022, 12:06:45 PM by pimohdaimaoh »

Offline djroby19

  • Senior Member
  • **
  • Posts: 88
    • Pomeziameteo
Re: Support of "Leuven" Air Quality scripts
« Reply #78 on: April 16, 2022, 07:51:02 PM »
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?

Offline pimohdaimaoh

  • Senior Contributor
  • ****
  • Posts: 288
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Support of "Leuven" Air Quality scripts
« Reply #79 on: April 17, 2022, 05:12:47 AM »
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)

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1919
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #80 on: April 17, 2022, 12:19:56 PM »
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
« Last Edit: April 17, 2022, 12:25:21 PM by wvdkuil »
Please remember, "If it is a hobby for both of us, it should be fun for both of us also"

If I helped you building and enhancing your website, feel free to donate at https://paypal.me/pwsdashboard.

Offline djroby19

  • Senior Member
  • **
  • Posts: 88
    • Pomeziameteo
Re: Support of "Leuven" Air Quality scripts
« Reply #81 on: April 17, 2022, 12:25:44 PM »
But in fact Wim I was just reading some previous post and on my web server I can't find an htaccess  ](*,)

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1919
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #82 on: April 17, 2022, 12:35:39 PM »
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.
Code: [Select]
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
Please remember, "If it is a hobby for both of us, it should be fun for both of us also"

If I helped you building and enhancing your website, feel free to donate at https://paypal.me/pwsdashboard.

Offline djroby19

  • Senior Member
  • **
  • Posts: 88
    • Pomeziameteo
Re: Support of "Leuven" Air Quality scripts
« Reply #83 on: April 17, 2022, 01:01:25 PM »
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

Offline djroby19

  • Senior Member
  • **
  • Posts: 88
    • Pomeziameteo
Re: Support of "Leuven" Air Quality scripts
« Reply #84 on: April 23, 2022, 07:24:32 AM »
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:

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1919
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #85 on: April 23, 2022, 07:38:54 AM »
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
Please remember, "If it is a hobby for both of us, it should be fun for both of us also"

If I helped you building and enhancing your website, feel free to donate at https://paypal.me/pwsdashboard.

Offline djroby19

  • Senior Member
  • **
  • Posts: 88
    • Pomeziameteo
Re: Support of "Leuven" Air Quality scripts
« Reply #86 on: April 23, 2022, 07:41:59 AM »
Wim the given folder and empty no files

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1919
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #87 on: April 23, 2022, 07:43:15 AM »
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
Code: [Select]
$save_last_mes  = false; to
Code: [Select]
#  $save_last_mes  = false;That way it will at least write a file, empty or not.

Wim
« Last Edit: April 23, 2022, 07:46:29 AM by wvdkuil »
Please remember, "If it is a hobby for both of us, it should be fun for both of us also"

If I helped you building and enhancing your website, feel free to donate at https://paypal.me/pwsdashboard.

Offline djroby19

  • Senior Member
  • **
  • Posts: 88
    • Pomeziameteo
Re: Support of "Leuven" Air Quality scripts
« Reply #88 on: April 23, 2022, 07:46:31 AM »
Yes, the write settings are 777
I am attaching 2 screanshots of the settings if it can be useful

Offline djroby19

  • Senior Member
  • **
  • Posts: 88
    • Pomeziameteo
Re: Support of "Leuven" Air Quality scripts
« Reply #89 on: April 23, 2022, 07:47:20 AM »
also this screanshot

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1919
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #90 on: April 23, 2022, 07:49:16 AM »
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
Please remember, "If it is a hobby for both of us, it should be fun for both of us also"

If I helped you building and enhancing your website, feel free to donate at https://paypal.me/pwsdashboard.

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1919
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #91 on: April 23, 2022, 07:50:50 AM »
also this screanshot

Also try to remove the ? in your sensor settings, it should do no harm but who knows for sure.

Wim

Please remember, "If it is a hobby for both of us, it should be fun for both of us also"

If I helped you building and enhancing your website, feel free to donate at https://paypal.me/pwsdashboard.

Offline djroby19

  • Senior Member
  • **
  • Posts: 88
    • Pomeziameteo
Re: Support of "Leuven" Air Quality scripts
« Reply #92 on: April 23, 2022, 07:56:11 AM »
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;
« Last Edit: April 23, 2022, 08:01:23 AM by djroby19 »

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1919
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" Air Quality scripts
« Reply #93 on: April 23, 2022, 08:10:46 AM »
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
« Last Edit: April 23, 2022, 08:14:12 AM by wvdkuil »
Please remember, "If it is a hobby for both of us, it should be fun for both of us also"

If I helped you building and enhancing your website, feel free to donate at https://paypal.me/pwsdashboard.

Offline djroby19

  • Senior Member
  • **
  • Posts: 88
    • Pomeziameteo
Re: Support of "Leuven" Air Quality scripts
« Reply #94 on: April 23, 2022, 08:22:58 AM »
no it's not a free provider
I will use the normal version thanks Wim himself