Author Topic: Meteotemplate - new free website template  (Read 627283 times)

0 Members and 1 Guest are viewing this topic.

Offline davidefa

  • Forecaster
  • *****
  • Posts: 436
Re: Meteotemplate - new free website template
« Reply #7675 on: November 22, 2021, 11:10:57 AM »
You should have a cron job that executes load/cron.php?password=xxx ( insert your update password ).
This is needed for your webcam images to be saved in db.
Check if it is working correctly.

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: Meteotemplate - new free website template
« Reply #7676 on: November 22, 2021, 11:17:04 AM »
wahoo, thats the money shot right there, i did, at the very early stages of the template, change folder name from template to meteo
I am gonna go out on a hunch here and say that that was the issue before I've even checked to see if its working lol
I have just checked now and the 1st images is in the db, thank you davidefa, very much appreciated, thank you :)
Kind regards
Bashy

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: Meteotemplate - new free website template
« Reply #7677 on: November 22, 2021, 11:20:52 AM »
Dammit, i was a tad premature lol, the 1st image is in the db and in the webcam/images folder but its empty, 0kb :/
Just refreshed the FTP and the 2nd is in now and that too is blank...

Interestingly, its saving blanks every 5 minutes but i have it set to every minute, more confusing lol
Is it my image being 920?
« Last Edit: November 22, 2021, 11:31:19 AM by Bashy »
Kind regards
Bashy

Offline davidefa

  • Forecaster
  • *****
  • Posts: 436
Re: Meteotemplate - new free website template
« Reply #7678 on: November 23, 2021, 11:28:40 AM »
This is a slightly modified version of load/crons/updateWebcam.php script ( it has additional debug prints )
Expand it in the load/crons directory ( make a backup of the original file ).
Execute the script ( https://www.brecklandweather.com/meteo/load/cron.php?password=xxxx ) and post the result.
My guess is that the file_get_contents in line 152 fails ( for some reason ), added another attempt to retrieve image in line 159 ( that may succeed )

 [ You are not allowed to view attachments ]

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: Meteotemplate - new free website template
« Reply #7679 on: November 24, 2021, 04:48:45 AM »
This is a slightly modified version of load/crons/updateWebcam.php script ( it has additional debug prints )
Expand it in the load/crons directory ( make a backup of the original file ).
Execute the script ( https://www.brecklandweather.com/meteo/load/cron.php?password=xxxx ) and post the result.
My guess is that the file_get_contents in line 152 fails ( for some reason ), added another attempt to retrieve image in line 159 ( that may succeed )

 [ You are not allowed to view attachments ]

Hi, thank you for the file and the assist, much appreciated, i have done as requested but once i had ran that, i thought i would quickly check and it looks like its saving now, oh i also changed the image to 640x480, don't know if that helped... https://www.brecklandweather.com/meteo/plugins/webcam/index.php

Code: [Select]
debug=1
baseURL=/home/breckland/public_html/meteo/
intervalFromLastSave=102 sec
webcamSaveInterval=5 min
Webcam image being saved.
imageURL=##http://www.brecklandweather.com/jpgwebcam.jpg##
file_get_contents: read 154021 bytes
nwritten=154021
INSERT INTO webcam (DateTime, T, H, P, R, RR, S, W, G, img) VALUES ('2021-11-24 09:41:44',5.9, 96.1, 1022.400, 0.000, 0.000, 18.0, 0.7, 3.8, '202111240941')
No images older than 2002-01-25 00:00:00
Loaded CRON: /home/breckland/public_html/meteo/load/crons/updateWebcam.php

Very much appreciate it and taking the time and patience with me :)
« Last Edit: November 24, 2021, 07:42:07 AM by Bashy »
Kind regards
Bashy

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: Meteotemplate - new free website template
« Reply #7680 on: December 03, 2021, 05:45:28 AM »
Hi folks, not sure whats going on but it looks like my site defaulted to a previous password, the only way that could happen is if i changed it or my site was restored from a backup, neither of those things, this led to my MT not getting data for over 4 days. Thats been resolved now but my Steelseries is not working, I'm getting a syntax parse error according to the LED scroller. https://www.brecklandweather.com/meteo/plugins/steelSeries/index.php
Kind regards
Bashy

Offline davidefa

  • Forecaster
  • *****
  • Posts: 436
Re: Meteotemplate - new free website template
« Reply #7681 on: December 03, 2021, 06:32:42 PM »
I see your plugins/steelSeries/cache/yesterday.txt is empty and your plugins/steelSeries/ssMeteotemplate.php results in errror.
Try uploading this script ( which has extended error logging enabled, and a few errors corrected ), in plugins/steelSeries directory, calling with the browser should display something like this:

 [ You are not allowed to view attachments ]

 [ You are not allowed to view attachments ]

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: Meteotemplate - new free website template
« Reply #7682 on: December 03, 2021, 11:35:12 PM »
I see your plugins/steelSeries/cache/yesterday.txt is empty and your plugins/steelSeries/ssMeteotemplate.php results in errror.
Try uploading this script ( which has extended error logging enabled, and a few errors corrected ), in plugins/steelSeries directory, calling with the browser should display something like this:


Hi, thanks for the reply,  upon checking them this morning (4am) they are working again, is that due to getting the site running again yesterday? i ask that because you mentioned yesterday.txt cache being empty? I still upped that script though and the results
https://www.brecklandweather.com/meteo/plugins/steelSeries/ssMeteotemplate1.php

Thanks again for your help, i am still baffled how the password reverted to and older one, i had it set to something simple whilst testing stuff in case anyone needed access and i hadn't changed it back yet, not that i can recall anyway, its not sommat you forget mind lol
Kind regards
Bashy

Offline davidefa

  • Forecaster
  • *****
  • Posts: 436
Re: Meteotemplate - new free website template
« Reply #7683 on: December 04, 2021, 05:48:02 AM »
Sorry can't help about remembering/forgetting ( I'm old, I even don't remember what I ate yesterday ; - ).
But password and configuration are stored in config.php, so the only way of changing them ( I can imagine ) is via the main configuration page or editing the file directly ( or restoring a previous backup )

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: Meteotemplate - new free website template
« Reply #7684 on: December 04, 2021, 06:00:17 AM »
Sorry can't help about remembering/forgetting ( I'm old, I even don't remember what I ate yesterday ; - ).
But password and configuration are stored in config.php, so the only way of changing them ( I can imagine ) is via the main configuration page or editing the file directly ( or restoring a previous backup )


I think I vaguely remember doing something a few days back and maybe I restored some files from, no, wait, that was for the pwsWD2021 template, different folder, but ya get pretty much guarantee I did sommat and forgot about it, just kicking myself that it was 4 days up the swanny lol thanks again, you're a great help as always :)
Kind regards
Bashy

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: Meteotemplate - new free website template
« Reply #7685 on: February 06, 2022, 10:58:38 AM »
RE webcam plugin, if i have it setup like this, why is it saving the images every 5 minutes and not every minute, please?
Kind regards
Bashy

Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3296
Re: Meteotemplate - new free website template
« Reply #7686 on: February 06, 2022, 11:45:11 AM »
I guess it's because the database archive interval is 5 minutes .
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: Meteotemplate - new free website template
« Reply #7687 on: February 06, 2022, 11:48:28 AM »
I guess it's because the database archive interval is 5 minutes .

What am i missing, please? I have it set to 1 minute, where is this 5 minute setting? it must be hard coded?
Kind regards
Bashy

Offline Gyvate

  • Forecaster
  • *****
  • Posts: 3296
Re: Meteotemplate - new free website template
« Reply #7688 on: February 06, 2022, 12:54:15 PM »
I guess it's because the database archive interval is 5 minutes .

What am i missing, please? I have it set to 1 minute, where is this 5 minute setting? it must be hard coded?
What did you set to one minute ?
The plugin or the database ? The database has afaik no (direct) option to set the archiving interval. I guess it's someware in the php files.
I don't think you can have a picture update interval separate from the weather data archiving interval. (But I may be mistaken).
Maybe the 1 minute pictures are saved somewhere "locally", i.e. not in the database but in the file system.
As does the API - it collects data from the posting source in a loop, accumulates them and every archiving interval, afaik that's every 5 minutes, one resulting entry per table is made.
That may be difficult (by nature) with pictures, you cannot add them or choose e.g. a max value.
I don't know who has written the plugin and what is the logic behind it though.
When you go through all the php files you may find (or someone else already knows) where the database interval is defined, and one could change this.
The php script which makes the database updates needs to be trigered somehow, usually by some cron job.
It may also depend on the CRON implementation of your web hoster who may not allow shorter database update intervals.

Maybe you should direct your question directly to Jachym, the designer of meteotemplate. He should know how it works and how it can be done (if it can be done).
« Last Edit: February 06, 2022, 12:57:34 PM by Gyvate »
WS2350 1.6.7, GW1000(3) 1.7.7,WH2650 WiFi (2) 1.7.7 (test/backup), GW1100 2.3.1, GW2000(3) 3.1.1, HP2551 1.9.5,5.1.5;HP3500 1.7.2,WS3800 1.2.8, WN1910 1.2.3,WN1980 1.2.3;
Ecowitt WS90(2)1.3.5/1.4.0, WS80(2)1.2.5, WS68, WS69, WH40, WH31, WH31-EP, WN30, WN34L, WN35, WH32, WH32-EP, WH32B, WH57 [Lightning], WH41 [PM2.5], WH51, WH45, WH55
MeteobridgePro(2)[test,prod] 5.8 Mar 01 2024, 15185 - Blake-Larsen Sun Recorder - RPi4/weewx 4.8.0/4.10.2/CumulusMX 3283/Meteobridge RPi4B-2GB(3169)
Barani Meteoshield Pro, MetSpec Rad02 - Ecowitt 5763,34418;WU ISAARB3(WH4000SE),ISAARB22(HP2553), http://meshka.eu

Offline davidefa

  • Forecaster
  • *****
  • Posts: 436
Re: Meteotemplate - new free website template
« Reply #7689 on: February 06, 2022, 04:12:47 PM »
The webcam table is different from the sensors table and you can set different update intervals ( well the sensors update interval is fixed to 5 mins ).
As Gyvate pointed out, the culprit is the cron job that executes the load/cron.php, you have to set it at 1 min interval ( all the scripts in load/crons directory should execute at their set interval )
« Last Edit: February 06, 2022, 04:15:11 PM by davidefa »

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: Meteotemplate - new free website template
« Reply #7690 on: February 06, 2022, 10:43:47 PM »
Thanks guys, i have changed the load/cron to update every 1 minute, i will see how that goes :)

Yep, that's got it, luckily, its my own server hosted in France so i have no constraints, thanks again guys, much appreciated :)
« Last Edit: February 06, 2022, 10:49:00 PM by Bashy »
Kind regards
Bashy

Offline davidefa

  • Forecaster
  • *****
  • Posts: 436
Re: Meteotemplate - new free website template
« Reply #7691 on: February 07, 2022, 04:38:39 AM »
I see your api.php is called every few seconds ( 3 seconds roughly ) this is 'too much fast' ( I don't think meteotemplate can cope well with this update rate )
Additionally I see none of your pages that shows graph ( graghInteractive, Extended Graphs, Temperature... in menu Weather Station ) work as intended.
I think you should reduce the data update rate ( to 1 min to be on the safe side ) and see if this helps.
If this have no effect, we should dig deeper.

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: Meteotemplate - new free website template
« Reply #7692 on: February 07, 2022, 08:08:37 AM »
I see your api.php is called every few seconds ( 3 seconds roughly ) this is 'too much fast' ( I don't think meteotemplate can cope well with this update rate )
Additionally I see none of your pages that shows graph ( graghInteractive, Extended Graphs, Temperature... in menu Weather Station ) work as intended.
I think you should reduce the data update rate ( to 1 min to be on the safe side ) and see if this helps.
If this have no effect, we should dig deeper.

Hi, i have my own server with no limitations at all

Datacentre- RBX1 - Rack: 12B05 - Server ID: 106784
OS - Centos 7 cPanel (64bits)
Boot - Boot from hard drive (no netboot)
Commercial name - KS-6 Server - Intel i5-750 - 16GB DDR3 1333 MHz - 2Tb SATA

Load avg 0.17 - 0.17 - 0.15

So its plenty capable of handling those 3-second updates, its been doing it for the last 10 years on this server :)
Its set to 3 seconds because because my wind is updated every 2.7 seconds.

As for those graphs, it is strange because i did get them all working when i last noticed an issue with them, but i cannot remember what the fix was, i think you may have helped, i am going to have to go through all my replies and see whats what, but yeah, they shouldn't stop working for no reason, i haven't done anything at all to the template since I last got them working, weird.

Also noticed the rain block has stopped working also, btw, the data is added to the db every 5 minutes by the looks of things, the 3 second API call is primarily for the live data, steel series etc

My chrome browser seems to have a problem with this site also, it keeps lagging and i cannot find out what the issue is.

Code: [Select]

 Edit Copy Delete2011-12-12 23:52:008.48.48.498.08.127.437.0193.00.0001.800980.900NULL2.6
 Edit Copy Delete2011-12-12 23:57:008.58.58.598.08.217.142.6172.00.0001.800980.900NULL4.8
 Edit Copy Delete2011-12-13 00:02:008.58.58.598.08.223.037.0190.00.0000.000980.900NULL3.6
 Edit Copy Delete2011-12-13 00:07:008.58.58.598.08.221.935.2214.00.0000.000980.900NULL3.8

Just noticed that NULL, looks like S (sun?) stopped working 2017-05-09 17:25:00 lol
« Last Edit: February 07, 2022, 08:38:21 AM by Bashy »
Kind regards
Bashy

Offline davidefa

  • Forecaster
  • *****
  • Posts: 436
Re: Meteotemplate - new free website template
« Reply #7693 on: February 07, 2022, 07:32:21 PM »
No doubt your server can handle a query every 3 seconds ( I was only wondering if meteotemplate can ), but if you did this for the last 10 year we could be 'quite sure' it can.
You posted the database records of 2011 ( 1 record every 5 minutes ), check if the last records are saved regularly every 5 minutes too.
You can also copy the attached script in the homepge/blocks/interactiveGraph directory and call it in the browser:
Code: [Select]
https://www.brecklandweather.com/meteo/homepage/blocks/interactiveGraph/graphAjax1.php?parameter=T&value=all&interval=todayit should print a few debug info to help pinpoint the problem.

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: Meteotemplate - new free website template
« Reply #7694 on: February 07, 2022, 11:21:33 PM »
No doubt your server can handle a query every 3 seconds ( I was only wondering if meteotemplate can ), but if you did this for the last 10 year we could be 'quite sure' it can.
You posted the database records of 2011 ( 1 record every 5 minutes ), check if the last records are saved regularly every 5 minutes too.
You can also copy the attached script in the homepge/blocks/interactiveGraph directory and call it in the browser:
Code: [Select]
https://www.brecklandweather.com/meteo/homepage/blocks/interactiveGraph/graphAjax1.php?parameter=T&value=all&interval=todayit should print a few debug info to help pinpoint the problem.


Hi, thanks for looking in to my issue again,


please see the image for the latest db additions, was much easier grabbing the screenshot than trying to cut, paste and getting it to look ok :/

I have added the script and checked it but its all hocus pocus to me lol
I tried copying and pasting the data but it all ended up on one like so, here's the URL again lol

https://www.brecklandweather.com/meteo/homepage/blocks/interactiveGraph/graphAjax1.php?parameter=T&value=all&interval=today

« Last Edit: February 07, 2022, 11:31:56 PM by Bashy »
Kind regards
Bashy

Offline davidefa

  • Forecaster
  • *****
  • Posts: 436
Re: Meteotemplate - new free website template
« Reply #7695 on: February 08, 2022, 07:29:49 AM »
Well, I'd say everything is ok but nothing works.
The sql query returns no error and no result.

Please try executing this sql query in phpmyadmin ( copy in the sql tab and click go ), it should return many rows:
Code: [Select]
SELECT DateTime, avg(T), avg(A), min(Tmin), max(Tmax), avg(D) FROM alldata WHERE DATE(alldata.DateTime) = CURDATE() GROUP BY YEAR(alldata.DateTime), MONTH(alldata.DateTime), DAY(alldata.DateTime), HOUR(alldata.DateTime), MINUTE(alldata.DateTime) ORDER BY DateTime
If the above returns 0 rows try the followings:
Code: [Select]
SELECT DateTime, avg(T), avg(A), min(Tmin), max(Tmax), avg(D) FROM alldata WHERE DATE(alldata.DateTime) = CURDATE() ORDER BY DateTime
Code: [Select]
SELECT DateTime, avg(T), avg(A), min(Tmin), max(Tmax), avg(D) FROM alldata WHERE DATE(alldata.DateTime) = CURDATE() GROUP BY YEAR(alldata.DateTime), MONTH(alldata.DateTime), DAY(alldata.DateTime), HOUR(alldata.DateTime), MINUTE(alldata.DateTime) ORDER BY alldata.DateTime
Code: [Select]
SELECT DateTime, avg(T), avg(A), min(Tmin), max(Tmax), avg(D) FROM alldata WHERE DATE(DateTime) = CURDATE() GROUP BY YEAR(DateTime), MONTH(DateTime), DAY(DateTime), HOUR(DateTime), MINUTE(DateTime) ORDER BY DateTime
Code: [Select]
SELECT DateTime, T, A, Tmin, Tmax, D FROM alldata WHERE DATE(alldata.DateTime) = CURDATE() GROUP BY YEAR(alldata.DateTime), MONTH(alldata.DateTime), DAY(alldata.DateTime), HOUR(alldata.DateTime), MINUTE(alldata.DateTime) ORDER BY DateTime
This should work ( as it the same query used by station data blocks that works in your homepage ):
Code: [Select]
SELECT  max(Tmax), min(Tmin), avg(T), avg(H), max(H), min(H), avg(P), max(P), min(P), avg(A), max(A), min(A), avg(D), max(D), min(D), avg(W), max(W), avg(G), max(G), avg(S), max(S), max(R), min(W), min(G), min(S), max(RR) FROM  alldata WHERE DATE(DateTime) = CURDATE()
Please also check that the structure of the alldata table is similar to this one:

 [ You are not allowed to view attachments ]
« Last Edit: February 08, 2022, 07:43:34 AM by davidefa »

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: Meteotemplate - new free website template
« Reply #7696 on: February 08, 2022, 07:50:24 AM »
Hi, the structure is the same

All of the sql's ya gave do not work, they give an error, but the last one worked  as seen in the image below

This should work ( as it the same query used by station data blocks that works in your homepage ):

Code: [Select]
SELECT  max(Tmax), min(Tmin), avg(T), avg(H), max(H), min(H), avg(P), max(P), min(P), avg(A), max(A), min(A), avg(D), max(D), min(D), avg(W), max(W), avg(G), max(G), avg(S), max(S), max(R), min(W), min(G), min(S), max(RR) FROM  alldata WHERE DATE(DateTime) = CURDATE()
« Last Edit: February 08, 2022, 07:52:07 AM by Bashy »
Kind regards
Bashy

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: Meteotemplate - new free website template
« Reply #7697 on: February 08, 2022, 07:54:26 AM »
All the others gave these errors...
see image..
Kind regards
Bashy

Offline davidefa

  • Forecaster
  • *****
  • Posts: 436
Re: Meteotemplate - new free website template
« Reply #7698 on: February 08, 2022, 08:50:00 AM »
Ok, I should have tought!
You should disable the ONLY_FULL_GROUP_BY option in sql_mode ( via phpmyadmin or your hosting provider control panel ):
- if in phpmyadmin if you have the variables tab search for the sql_mode variable and remove ONLY_FULL_GROUP_BY option
- if you don't have the variable tab execute the following command ( from the integrated console or the sql tab ):

Code: [Select]
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

 [ You are not allowed to view attachments ]


P.S.
The previous script didn't return any error... well because I made an error : - (

Offline Bashy

  • brecklandweather.com/meteo
  • Forecaster
  • *****
  • Posts: 1465
  • brecklandweather.com/index.php
    • Breckland Weather
Re: Meteotemplate - new free website template
« Reply #7699 on: February 08, 2022, 10:45:02 AM »
Ok, I should have tought!
You should disable the ONLY_FULL_GROUP_BY option in sql_mode ( via phpmyadmin or your hosting provider control panel ):
- if in phpmyadmin if you have the variables tab search for the sql_mode variable and remove ONLY_FULL_GROUP_BY option
- if you don't have the variable tab execute the following command ( from the integrated console or the sql tab ):

Code: [Select]
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));




P.S.
The previous script didn't return any error... well because I made an error : - (

Thanks, i have executed that via SQL using my root privileges, it was good.

EDIT: ah ha, that fixed it, thank you ever so much, how did it managed to break though, any ideas?
« Last Edit: February 08, 2022, 10:48:51 AM by Bashy »
Kind regards
Bashy

 

anything