Page 1 of 1

api.php not updating current data

Posted: Wed Feb 10, 2021 3:42 am
by WyoDog
My weather page http://www.powellweather.net has quit updating the CurrentData and SSdials. In spite of everything I know to be true, I decided that it would be a simple fix, probably a password issue. Instead of developing a plan and proceeding systematically, I dove right in and starting making changes. Well if it's not the password it's probably . . .

I use Weather Display to send my data. WD is set up as:
Meteo setup in WD.png
Meteo setup in WD.png (24.47 KiB) Viewed 12631 times
where /template is a subdomain of www.powellweather.net.

The file structure is root/www.powellweather.net/public_html/template
so
root/template.powellweather.net/public_html/ puts you in /template. This path operates without error in WD. This has been my setup until it stopped working.

My problem is I don't think that my current data is actually making it to /template on the host computer.

As I understand it, http://template.powellweather.net/public_html/api.php calls and
runs the script api.php on the web server. As api.php runs a file is created meteotemplateLive.txt and maybe apiCache.txt that are used by the various blocks for input.

I would think that the meteotemplateLive.txt file would have a current date and time stamp. That isn't happening. Is there a copy stored elsewhere than in /template

1st I would like to know if my logic is correct about api.php creating meteotemplateLive.txt.

2nd, how can I check if current data is being sent by WD to the web host.

And most important, how can I get everything back on line ASAP.

For extra credit, how does WD send current data as it calls api.php on the web server. Is it a txt string appended to the end of api.php?

As you can tell, I know about enough to be dangerous, and that's exactly what I did.

Thank you in advance for any help or words of wisdom.

Terry

Re: api.php not updating current data

Posted: Wed Feb 10, 2021 11:22 am
by davidefa
I think you should change the URL to http://template.powellweather.net/api.php

api1.png
api1.png (26.22 KiB) Viewed 12627 times

Re: api.php not updating current data

Posted: Wed Feb 10, 2021 7:56 pm
by WyoDog
davidefa, I changed the URL.

Shouldn't meteotemplate.txt in /template root change each time the api.php script is run?

I don't know how to tell if the api.php script is being call and run. That would tell me if Weather Display is sending data.

Thanks

Terry

Re: api.php not updating current data

Posted: Wed Feb 10, 2021 9:47 pm
by davidefa
Yes, the file is meteotemplateLive.txt, the date of the file should change each time api.php is called.
The attached file ( params.php ) simply dumps the GET parameters to a file ( params.txt )
If you point WD to this params.php you should see params.txt growing ( data are appended )

Re: api.php not updating current data

Posted: Wed Feb 10, 2021 10:45 pm
by WyoDog
Thank you, davidefa.

That's a cool script. It's filling with data.

So this data is passed thru api.php and used to create Meteotemplate.txt.

Meteotemplate.txt is not being updated so that would indicate that the api.php has been corrupted?

Do you agree?

Re: api.php not updating current data

Posted: Wed Feb 10, 2021 11:10 pm
by WyoDog
davidefa, That script was of tremendous value, it eliminated Weather Display as the problem. I had a newer version of Meteotemplate downloaded, so I copied the api.php script from it to the version I'm running.

Current conditions is now working with correct time and data. ssGauges isn't working but I suspect that's a file caching problem. Also I turned off Cloudflare when I starting having a problem.

Thanks again

Terry

Re: api.php not updating current data

Posted: Thu Feb 11, 2021 12:07 am
by davidefa
I think Jachym should chime in ( by the way are you using now a api.php from a different version or from same meteotemplate 15.0 as in your site?! )

Re: api.php not updating current data

Posted: Thu Feb 11, 2021 12:57 am
by WyoDog
I used the api file from v 15

I really need to update ver. I've put it off because everything had been working so well. Seems like every time I upgrade something, the upgrade breaks something.

I haven't seen Jachym on here much of late.

clientraw.txt

Posted: Thu Mar 04, 2021 2:13 am
by WyoDog
I am still trying to understand the data import in MT.

Where does clientraw.txt come from. I don't see a reference to it in api.php. I do see the file in the WDclientraw directory, however it is almost a month old.

I'm assuming that the 'WD' is for WeatherDisplay. Is Weather Display supposed to create it or does MT create the file. Shouldn't it be in the root of \template and not in a subdirectory. Maybe my api.php isn't working correctly.

Or maybe I'm not seeing the forest for the trees. (Something my Father used to say)

Terry

Re: api.php not updating current data

Posted: Thu Mar 04, 2021 11:37 am
by davidefa
- what software are you using for the 'database update' ( feeding weather station data to meteotemplate )?
- does it call api.php directly?
- does it upload a text file and then a cron job calls update/update.php?

P.S.
By the way your signature points to
http://www.template.powellweather.net/indexDesktop.php
which have all icons not showing correctly ( and ssgauges are dead )
Even www.powellweather.net redirects to the same url

if I click on the home icon I'm redirected to
http://www.powellweather.net/template/indexDesktop.php
which shows your page correctly.
I don't know if this is important ( maybe is only 'signature related' ), but verify your configurations only use the second form

P.P.S.
My dumbness, you have already replied to my questions in the previous posts.
So your software is calling api.php directly, so no txt file is needed ( maybe this stale file was generated during some test you did )

Re: api.php not updating current data

Posted: Thu Mar 04, 2021 5:15 pm
by WyoDog
thank you David

My weather sticker isn't updating, it was previously. I was wondering if the weathersticker block got its data from clientraw.txt.

I think that I have the url issue sorted out. I had a re-direct pointing to itself. I'm hoping once the cache's have been flushed and rewritten, that it will have taken care of it by itself.

Thanks

Terry Foley

Re: api.php not updating current data

Posted: Thu Mar 04, 2021 5:37 pm
by davidefa
To use this script [stickersWD] you need to be using the Weather Display software and have a periodically updated clientraw.txt file to your server.
Yes, stickersWD need clientraw.txt file ( regularly updated ).
The 'non standalone' stickers plugin should do the same ( extracting data from database ).

Re: api.php not updating current data

Posted: Fri Mar 05, 2021 1:34 am
by WyoDog
Thank you David