update.php not being run for netatmo

Post Reply
Julius
Advisor
Advisor
Posts: 89
Joined: Fri Sep 24, 2021 10:41 pm
Station model: Barani MeteoHelix
Software: meteobridge

update.php not being run for netatmo

Post by Julius » Sat Aug 06, 2022 3:52 pm

I get:

Code: Select all

# /usr/bin/php -f /w/mt/plugins/netAtmo/update/update.php?pass=myupdatepassword
Could not open input file: /w/mt/plugins/netAtmo/update/update.php?pass=myupdatepassword
And thus also the cron for this does not work. Gives the same error..
Anyone know what this means?

# php -v
PHP 7.4.30 (cli) (built: Jun 27 2022 08:11:59) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.30, Copyright (c), by Zend Technologies

I'm running MT under NGINX with php-fpm on a debian 10 server.
It's not a permissions issue, or at least not for opening update.php since I tried as root, and changed it to 777 already to test.
Something else is going on, but I can't find a solution..

I also disabled all others that send data to the api directly, but it still errors out with that same error...

Anyone?
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: update.php not being run for netatmo

Post by davidefa » Sat Aug 06, 2022 10:57 pm

You could try using wget or curl ( assuming your meteotemplate server is http://localhost/mt ):

Code: Select all

wget http://localhost/mt/plugins/netAtmo/update/update.php?pass=myupdatepassword

Code: Select all

curl http://localhost/mt/plugins/netAtmo/update/update.php?pass=myupdatepassword
Image

Julius
Advisor
Advisor
Posts: 89
Joined: Fri Sep 24, 2021 10:41 pm
Station model: Barani MeteoHelix
Software: meteobridge

Re: update.php not being run for netatmo

Post by Julius » Sun Aug 07, 2022 4:49 pm

It yields success with curl, but still the MT says 'OFFLINE'.
Where do I set it to use the netatmo output/input? The Wiki as well as the Plugin info is not clear to me as far as this goes. It does not show a proper instruction, unfortunately..
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: update.php not being run for netatmo

Post by davidefa » Sun Aug 07, 2022 7:55 pm

No need to set anything else ( once you have the cron job set to execute at least every 5 minutes ) as the plugin calls the api.php script.
You can take a look at the result ( of the api.php script ) in cache/apiLog.txt ( please post a copy of the log, so I can take a look ).
In the cache/apiLog.txt you should see the fields read from the 'netatmo cloud', and every 5 minutes the logging of the database queries.
If you have still have not set the cron job ( and are testing the plugin 'manually' ) you need to repeat the 'curl call' several times before you see the 'online' message ( once a minute, until you see the database query logging at the end of the cache/apiLog.txt file )
Image

Julius
Advisor
Advisor
Posts: 89
Joined: Fri Sep 24, 2021 10:41 pm
Station model: Barani MeteoHelix
Software: meteobridge

Re: update.php not being run for netatmo

Post by Julius » Sun Aug 07, 2022 8:05 pm

Turned out crontab could not run the curl command (!?)..
Had to externalize it into a shell script, and then call that shell-script from crontab.
I have it working now.

Next job: Add solar/UV and lightning data from a weatherflow device to the same updates.
I still have a hard time getting separate sensor data into the same database/visual overview..
Do you happen to have a good pointer on how to accomplish that?
Is there a way to merge data into the same updates, or append it to the meteotemplateLive.txt?
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: update.php not being run for netatmo

Post by davidefa » Sun Aug 07, 2022 8:24 pm

Julius wrote: Sun Aug 07, 2022 8:05 pm Turned out crontab could not run the curl command (!?)..
Had to externalize it into a shell script, and then call that shell-script from crontab.
I have it working now.
Ok
Julius wrote: Sun Aug 07, 2022 8:05 pmNext job: Add solar/UV and lightning data from a weatherflow device to the same updates.
I still have a hard time getting separate sensor data into the same database/visual overview..
Do you happen to have a good pointer on how to accomplish that?
Is there a way to merge data into the same updates, or append it to the meteotemplateLive.txt?
You can use 'currently' both the tempest and the netatmo plugins.
If your stations have 'different sensors' you should have no problem.
If your stations have 'same sensors' ( I mean both have a T sensor, for example ) you'll end up having a mix/average of both sensors, if you can live with this you are done, if not we can add a configuration ( to the plugins ) to select which sensor to import.


P.S.
Well the api.php has nothing to handle concurrent calls, but after more than a year I use in this way, I can say that it can be 'done safely'.
Image

Julius
Advisor
Advisor
Posts: 89
Joined: Fri Sep 24, 2021 10:41 pm
Station model: Barani MeteoHelix
Software: meteobridge

Re: update.php not being run for netatmo

Post by Julius » Mon Aug 08, 2022 8:22 pm

New issue:
The stationData block no longer shows any values. Ever since I switched input from MeteoBridge to Netatmo.
Strangely though, the Interactive graphs work fine, so the netatmo data must be going in the database now.
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: update.php not being run for netatmo

Post by davidefa » Mon Aug 08, 2022 9:56 pm

Not super easy to understand what's the problem without seeing a log/configuration.

Try executing:

Code: Select all

http://localhost/mt/homepage/blocks/stationData/stationDataAjax.php?period=today&errors
http://localhost/template/indexFull.php?block=stationData&errors
and post the results ( assuming your meteotemplate server is http://localhost/mt )
Image

Julius
Advisor
Advisor
Posts: 89
Joined: Fri Sep 24, 2021 10:41 pm
Station model: Barani MeteoHelix
Software: meteobridge

Re: update.php not being run for netatmo

Post by Julius » Tue Aug 09, 2022 12:16 pm

Results of the /homepage/blocks/stationData/stationDataAjax.php?period=today&errors
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 216

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 229

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 242

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 255

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 268

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 281

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 294

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 307

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 320

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 333

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 346

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 359

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 372

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 385

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 619

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 620

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 621

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 622

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 623

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 624

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 627

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 628

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 629

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 637

Warning: A non-numeric value encountered in /w/mt/scripts/functions.php on line 182

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 644

Warning: A non-numeric value encountered in /w/mt/scripts/functions.php on line 182

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 650

Warning: A non-numeric value encountered in /w/mt/scripts/functions.php on line 182

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 656

Warning: A non-numeric value encountered in /w/mt/scripts/functions.php on line 182

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 662

Warning: A non-numeric value encountered in /w/mt/scripts/functions.php on line 182

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 668

Warning: A non-numeric value encountered in /w/mt/scripts/functions.php on line 182

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 674

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 675

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 676

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 678

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 679

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 680

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 694

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 695

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 696

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 713

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 714

Warning: number_format() expects parameter 1 to be float, string given in /w/mt/homepage/blocks/stationData/stationDataAjax.php on line 715
{"avgPP1":" ug\/m3","maxPP1":" ug\/m3","minPP1":" ug\/m3","maxPP1time":"","minPP1time":"","avgT":" \u00b0C","maxT":" \u00b0C","minT":" \u00b0C","avgH":" %","maxH":" %","minH":" %","avgP":" hPa","maxP":" hPa","minP":" hPa","avgW":" km\/h","avgWBft":0,"avgWBftBg":"#ffffff","avgWBftColor":"#000","maxW":" km\/h","maxWBft":0,"maxWBftBg":"#ffffff","maxWBftColor":"#000","minW":" km\/h","minWBft":0,"minWBftBg":"#ffffff","minWBftColor":"#000","avgG":" km\/h","avgGBft":0,"avgGBftBg":"#ffffff","avgGBftColor":"#000","maxG":" km\/h","maxGBft":0,"maxGBftBg":"#ffffff","maxGBftColor":"#000","minG":" km\/h","minGBft":0,"minGBftBg":"#ffffff","minGBftColor":"#000","avgA":" \u00b0C","maxA":" \u00b0C","minA":" \u00b0C","avgD":" \u00b0C","maxD":" \u00b0C","minD":" \u00b0C","totalR":"0.0 mm","R2":" mm\/h","R3":"","R2Label":"Max","R3Label":"","avgS":" W\/m2<\/sup>","maxS":" W\/m2<\/sup>","minS":" W\/m2<\/sup>","minTtime":"","maxTtime":"","minHtime":"","maxHtime":"","minAtime":"","maxAtime":"","minDtime":"","maxDtime":"","minWtime":"","maxWtime":"","minGtime":"","maxGtime":"","maxStime":"","minPtime":"","maxPtime":"","name":"Today"}
and for the second command;
Warning: A non-numeric value encountered in /w/mt/scripts/headerMetar.php on line 248

Notice: Undefined variable: moreclouds in /w/mt/scripts/headerMetar.php on line 832

Warning: A non-numeric value encountered in /w/mt/scripts/headerMetar.php on line 248

Warning: A non-numeric value encountered in /w/mt/scripts/headerMetar.php on line 248

Warning: A non-numeric value encountered in /w/mt/scripts/headerMetar.php on line 248
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: update.php not being run for netatmo

Post by davidefa » Tue Aug 09, 2022 2:24 pm

The first log you posted shows there is no error, but no value is returned for any sensor ( I assume your database is not updated ).
Does the block show correct values when selecting a longer time interval ( last 7 days, this month, this year )?

stationdata02.png
stationdata02.png (63.17 KiB) Viewed 1900 times

Please post also a copy of cache/apiLog.txt ( preferably containing the database query at the very end of the file, these will be included after minutes 0, 5, 10... )

apilog01.png
apilog01.png (31.88 KiB) Viewed 1900 times
Image

Julius
Advisor
Advisor
Posts: 89
Joined: Fri Sep 24, 2021 10:41 pm
Station model: Barani MeteoHelix
Software: meteobridge

Re: update.php not being run for netatmo

Post by Julius » Tue Aug 09, 2022 10:52 pm

davidefa wrote: Sun Aug 07, 2022 8:24 pm You can use 'currently' both the tempest and the netatmo plugins.
If your stations have 'different sensors' you should have no problem.
If your stations have 'same sensors' ( I mean both have a T sensor, for example ) you'll end up having a mix/average of both sensors, if you can live with this you are done, if not we can add a configuration ( to the plugins ) to select which sensor to import.

P.S.
Well the api.php has nothing to handle concurrent calls, but after more than a year I use in this way, I can say that it can be 'done safely'.
I currently have 2 tempest units and 1 netatmo I would like to show separate data of. One of the tempest units has 2 broken sensors (I was testing for them), pressure and rain.
I do have a MeteoBridge Pro, which correctly collects both tempest units data, plus an air-quality sensor's data (PM10, PM2.5) and I could use MB to send that to MeteoTemplate, but how do I ever get to show all sources in MT?
It would be nice if I could pick sensors to show/use per block. Or even have two windRose blocks next to each other.
This was what first led me to use MeteoTemplate.
Image

Julius
Advisor
Advisor
Posts: 89
Joined: Fri Sep 24, 2021 10:41 pm
Station model: Barani MeteoHelix
Software: meteobridge

Re: update.php not being run for netatmo

Post by Julius » Wed Aug 10, 2022 10:56 am

davidefa wrote: Tue Aug 09, 2022 2:24 pm The first log you posted shows there is no error, but no value is returned for any sensor ( I assume your database is not updated ).
Does the block show correct values when selecting a longer time interval ( last 7 days, this month, this year )?
Yes, when I select 7 days, I see data has stopped coming in August 5. Strange, as this is when I stopped using the MeteoBridge to send data to it, not when I installed/got the netatmo block working..

cache/apiLog.txt:

Code: Select all

Checking temperature is between limits specified in template Main settings.
Minimum temperature limit: -100 C
Maximum temperature limit: 100 C
Temperature is OK and within the allowed limits
Parsing maximum temperature
Parsing minimum temperature
Parsing humidity
Humidity: 71 percent
Checking humidity is between limits specified in template Main settings.
Minimum humidity limit: 0 %
Maximum humidity limit: 100 %
Humidity is OK and within the allowed limits
Parsing wind speed
Wind speed: 4 kmh
Database wind speed units: kmh
Checking wind speed is between limits specified in template Main settings.
Minimum wind speed limit: 0 kmh
Maximum wind speed limit: 200 kmh
Wind speed is OK and within the allowed limits
Parsing wind gust
Wind gust: 10 kmh
Database wind units: kmh
Checking wind gust is between limits specified in template Main settings.
Minimum wind gust limit: 0 kmh
Maximum wind gust limit: 200 kmh
Wind gust is OK and within the allowed limits
Parsing wind direction
Wind direction: 28 degrees
Wind direction is OK and within the allowed limits
Parsing daily cumulative precipitation
Precipitation: 0 mm
Database precipitation units: mm
Checking precipitation is between limits specified in template Main settings.
Minimum precipitation limit: 0 mm
Maximum precipitation limit: 200 mm
Precipitation is OK and within the allowed limits
Parsing rain rate
Rain rate: 0 mm/h
Database rain units: mm/h
Checking rain rate is between limits specified in template Main settings.
Minimum rain rate limit: 0 mm/h
Maximum rain rate limit: 500 mm/h
Rain rate is OK and within the allowed limits
Parsing solar radiation
Now parsing extra sensors.
Sensor: UV not found in API file, skipping...
Sensor: extra temperature sensor 1 not found in API file, skipping...
Sensor: extra humidity sensor 1 not found in API file, skipping...
Sensor: particulate pollution 1 not found in API file, skipping...
No cache file found, create empty file.
Parsing pressure
Pressure: 1025.8 hpa
Database pressure units: hpa
Checking pressure is between limits specified in template Main settings.
Minimum pressure limit: 950 hpa
Maximum pressure limit: 1100 hpa
Pressure is OK and within the allowed limits
Pressure is valid.
Calculated dew point: 17.1 C
Dew point ok.
Calculated apparent temperature: 24.2 C
Apparent temperature ok.
End time for database update based on timestamp of current data: 2022-08-10 12:50:00
Rounded end time for database update: 2022-08-10 12:50:00
Time to update the database, preparing query.
Timestamp first cached record: 2022-08-10 12:50:00
Timestamp last cached record: 2022-08-10 12:50:00
Timestamp last received record: 2022-08-10 12:50:00
Timestamp new database record: 2022-08-10 12:50:00
No new day, currentRain=0.0
The database is updated with the following query:
            INSERT INTO alldata
            (DateTime,T,Tmax,Tmin,H,P,W,G,B,R,RR,D,A)
            values ('2022-08-10 12:50:00',22.6,22.6,22.6,71.0,1025.8,4.0,10.0,28,0.0,0.0,17.1,24.2
        )
Cache file deleted.
Generating log file cache/apiLog.txt

ERRORS:
No max temperature data provided.
No min temperature data provided.
No solar radiation data provided.
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: update.php not being run for netatmo

Post by davidefa » Wed Aug 10, 2022 11:36 am

From what you posted the database was updated correctly a few minutes ago ( 2022-08-10 12:50:00 )

Code: Select all

The database is updated with the following query:
            INSERT INTO alldata
            (DateTime,T,Tmax,Tmin,H,P,W,G,B,R,RR,D,A)
            values ('2022-08-10 12:50:00',22.6,22.6,22.6,71.0,1025.8,4.0,10.0,28,0.0,0.0,17.1,24.2
        )
Cache file deleted.
If you look in the meteotemplate control panel -> edit data do you see the data recordings for today? Something like in the following image.
If yes you should be able to see this today's data in the stationData block and in the various graphing blocks/pages.

editdata01.png
editdata01.png (277.22 KiB) Viewed 1860 times
Image

Julius
Advisor
Advisor
Posts: 89
Joined: Fri Sep 24, 2021 10:41 pm
Station model: Barani MeteoHelix
Software: meteobridge

Re: update.php not being run for netatmo

Post by Julius » Wed Aug 10, 2022 1:27 pm

davidefa wrote: Wed Aug 10, 2022 11:36 am If you look in the meteotemplate control panel -> edit data do you see the data recordings for today? Something like in the following image.
If yes you should be able to see this today's data in the stationData block and in the various graphing blocks/pages.
Yes, and I found out what was wrong; The stationDataBlock.php was some kind of later version than the original. This stems from your update showing min gust/windspeed time, and somehow it didn't work (anymore).
I've re-installed with version 10 from the MT site, and we're back online!
Image

johnathan
Observer
Observer
Posts: 29
Joined: Thu Apr 08, 2021 1:14 pm
Station model: wh1080
Software: WU

Re: update.php not being run for netatmo

Post by johnathan » Thu Aug 11, 2022 11:07 am

A web development team includes a Project Manager, Front-end and Back-end developers, QA engineers, UI and UX designers, DevOps engineers, and more. Other members of the team may include a Business Analyst, SEO specialist, or Project Architect. A good web development team is diverse and scalable, and is ideally made up of individuals with different skill sets and interests. The Project Manager should be a good communicator, and the other team members should be willing to work together on projects of varying sizes https://mlsdev.com/blog/how-to-create-social-media-app

Post Reply