Api data being received but not updating graphs/mysql

Post Reply
User avatar
spanishhighs
Observer
Observer
Posts: 12
Joined: Mon Mar 12, 2018 2:02 pm
Location: Lanjaron, Granada, Spain
Station model: Davis Vantage Pro 2
Software: Weather Display ConsoleWD
Contact:

Api data being received but not updating graphs/mysql

Post by spanishhighs » Sun Jun 23, 2019 12:11 pm

I have recently changed from updating the database using clientraw.txt to update via Api (Weather Display Consolewd for linux). The api works in that the current station values are correct but the graphs stopped updating at the time I changed over from clientraw.txt to api updating.

The problem can best be seen at https://www.spanishhighs.co.uk/meteotemplate/. The temperatures in STATION DATA are correct yet the graphs below (BLOCK: combinedGraphs) stopped updating at 8:15 today.

Seems like the api.php function isn't updating Mysql?

User avatar
spanishhighs
Observer
Observer
Posts: 12
Joined: Mon Mar 12, 2018 2:02 pm
Location: Lanjaron, Granada, Spain
Station model: Davis Vantage Pro 2
Software: Weather Display ConsoleWD
Contact:

Re: Api data being received but not updating graphs/mysql

Post by spanishhighs » Sun Jun 23, 2019 3:14 pm

Confirmed that indeed, Mysql is not being updated and stopped at 08:15 this morning. See screenshot attached taken from phpmyadmin.

I have checked with my hosting service and the mysql databases are all stable.

The output of the api call from Weather Display has a "SUCCESS" response. An example is given below

meteotemplate/api.php?U=1561319429&T=23.8&TMX=23.8&TMN=23.8&TIN=24.8&HIN=62&H=67&P=1008.3&W=1.9&G=1.6&B=263&R=0.0&RR=0.000&S=0.0&UV=0.0&SS=0.0&BATT=3.1&PASS=XXXXXXXX&SW=WD&T1=0.0&T2=0.0&T3=0.0&T4=0.0&T5=0.0&T6=0.0&T7=0.0&T8=0.0&T9=0.0&T1=0.0&H2=0&H3=0&H4=0&H5=0&H6=0&H7=0&H8=0&H9=0&TS1=0.0&TS2=0.0&TS3=0.0&TS4=0.0&LW1=15&LW4=0
Attachments
phpmyadmin screenshot
phpmyadmin screenshot
Screenshot from 2019-06-23 17-12-57.png (209.83 KiB) Viewed 12407 times

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: Api data being received but not updating graphs/mysql

Post by andyk1 » Mon Jun 24, 2019 6:06 pm

spanishhighs wrote: Sun Jun 23, 2019 12:11 pm I have recently changed from updating the database using clientraw.txt to update via Api (Weather Display Consolewd for linux). The api works in that the current station values are correct but the graphs stopped updating at the time I changed over from clientraw.txt to api updating.

The problem can best be seen at https://www.spanishhighs.co.uk/meteotemplate/. The temperatures in STATION DATA are correct yet the graphs below (BLOCK: combinedGraphs) stopped updating at 8:15 today.

Seems like the api.php function isn't updating Mysql?
How are you sending data to MT... Meteobridge or just WD. Is your meteotemplate api.php showing WD?

I'm not seeing your "combinedGraphs" block as set up.
Image

User avatar
spanishhighs
Observer
Observer
Posts: 12
Joined: Mon Mar 12, 2018 2:02 pm
Location: Lanjaron, Granada, Spain
Station model: Davis Vantage Pro 2
Software: Weather Display ConsoleWD
Contact:

Re: Api data being received but not updating graphs/mysql

Post by spanishhighs » Mon Jun 24, 2019 7:24 pm

Thanks for coming back to me.

I am sending the data from the WD Consolewd Linux version to the Meteotemplate api. Updates every 2 minutes automatically via cron script

The Meteotemplate api is definitely receiving these updates as the Station Data at the top left of the desktop version is correct. What is wrong is that the api is not then updating the Mysql database and all the data sent is being lost.

The "combinedGraphs" block was set to 24 hours and as no data had been entered into the Mysql database I suspect showed nothing. I have now changed that show the last 7 days. You should now be able to see that the last update as in fact 23rd June at 8:15am

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: Api data being received but not updating graphs/mysql

Post by andyk1 » Tue Jun 25, 2019 12:57 pm

Could you go through the main setup and insure the dB names and and password are correct and test it. I'm going to take a guess and assume you already did that. I see you updated to 17.2 by any chance did this happen after. I can't think of a thing other than a dB name change, password or an api configuration. How about a change in WD settings i.e. ftp uploads to correct host and such.

There is a long gap between the 21st and 22nd. What happened there as I see it started then stopped again.

In the database the update times are all erratic. Some at 5 minute intervals as it should be to an hour. I'm not sure why as MT stores you're 2 min uploads in cache and then updates at 5 minute intervals as it was designed but yours is all over the place. I would look at you're WD settings first then go from there.
Image

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: Api data being received but not updating graphs/mysql

Post by andyk1 » Tue Jun 25, 2019 1:20 pm

OK looking at your page closer I noticed you are not sending data to WU, CWOP or any of the other listed sites you have. Your Davis Pro or your setup is not sending to any feeding sites in case you didn't already now that and I am not sure of your setup so start there. Your photo update in MT is working fine.

Andy
Image

User avatar
spanishhighs
Observer
Observer
Posts: 12
Joined: Mon Mar 12, 2018 2:02 pm
Location: Lanjaron, Granada, Spain
Station model: Davis Vantage Pro 2
Software: Weather Display ConsoleWD
Contact:

Re: Api data being received but not updating graphs/mysql

Post by spanishhighs » Wed Jun 26, 2019 7:49 am

Hi Andy

Firstly let me thank you for taking the time to investigate this and try to help. Really appreciated!

1) I have gone into main set up and re-tested the connection to the existing mysql database. Return is
Success: A proper connection to MySQL was made!
Table already exists.


2) The update to 17.2 came when I changed over from a Raspberry Pi to a Linux box, hence the reason for the non-reporting for a couple of days as I had a few problems on the initial WD setup.

3) After changing computers I tested Meteotemplate with clientraw.txt update. This was working but I was having some problems with the cron job functioning correctly. Hence the API is the preferred route and is incorporated already into the WD output.

4) Weather Underground and PWS are being updated from WD clientraw.txt. I had the wrong link setting in for CWOPS but it seems to be reporting
http://www.wxqa.com/sss/search1.cgi?keyword=d1477
https://www.wunderground.com/dashboard/pws/IALGRANA2
http://www.pwsweather.com/obs/LANJARON.html

Regards
Richard

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: Api data being received but not updating graphs/mysql

Post by andyk1 » Wed Jun 26, 2019 2:13 pm

Strange. You're WU, PWS and CWOP are now working correctly but not ingesting into MT and MT is showing OFF LINE.... Because it is not receiving data to that database anymore. You need to study the cronjob's for MT to make sure it is exactly the way it needs to be and is it showing failures for MT and the API? Since WU is ingesting data could you switch to use the WU api to test with in MT? Part of MT is back I see just not receiving data from the DB.
Image

User avatar
spanishhighs
Observer
Observer
Posts: 12
Joined: Mon Mar 12, 2018 2:02 pm
Location: Lanjaron, Granada, Spain
Station model: Davis Vantage Pro 2
Software: Weather Display ConsoleWD
Contact:

Re: Api data being received but not updating graphs/mysql

Post by spanishhighs » Wed Jun 26, 2019 6:01 pm

I have reverted back to clientraw.txt as the api was obviously not working as somehow the mysql database had got unlinked from the updates. Going to try a separate new install on a different domain as see if that brings success as I have 12 years of weather data I cant afford to lose.

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: Api data being received but not updating graphs/mysql

Post by andyk1 » Thu Jun 27, 2019 3:08 am

spanishhighs wrote: Wed Jun 26, 2019 6:01 pm I have reverted back to clientraw.txt as the api was obviously not working as somehow the mysql database had got unlinked from the updates. Going to try a separate new install on a different domain as see if that brings success as I have 12 years of weather data I cant afford to lose.
Your site is working since you reverted back to "clientraw". Just curious, In Database Update Setup you choose Custom file with the correct path to it and filled out all the fields and Variables? That is the only thing I am coming up with. Everything else you are doing seems to be right. Try and get ahold of Jachym if he has the time to help you out. He is pretty busy with his Job lately.

I hear ya on not wanting to lose 12 years worth of data. I myself have so many backup's. I have 8 years (2000-2008) I wish I could import but saved in a way that makes it hard to rewrite the older XML and even worse prior to excels 2003 version. I've tried.

Andy
Image

User avatar
spanishhighs
Observer
Observer
Posts: 12
Joined: Mon Mar 12, 2018 2:02 pm
Location: Lanjaron, Granada, Spain
Station model: Davis Vantage Pro 2
Software: Weather Display ConsoleWD
Contact:

Re: Api data being received but not updating graphs/mysql

Post by spanishhighs » Thu Jun 27, 2019 8:18 am

Yes, my site is working via cron job and clientraw.txt. I will leave it at that as I have been offline too much recently.

I am still intrigued by why the API didnt work and update the mysql database though, so I set up another test account at
https://spanishhighstours.com/meteotemplate/

This is a clean install with no history information. It accepts the API from Weather Display and portrays it in the stationData Block. But yet again the database isn't being updated, hence no graphs (they should be to the right of the stationData block).

If I go to Weather Display and take the URL they are sending to the template, enter it in a browser window, I get a "SUCCESS" message. But, the databse is not updated. Could be a permissions issue?

Anyway I think I have gone as far as my technical ability allows. Maybe Jachym will pick up on this thread as it does sound like some sort of bug between WD and meteotemplate.

Thanks again for the support Andy.

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: Api data being received but not updating graphs/mysql

Post by Jachym » Thu Jun 27, 2019 2:06 pm

Hi,
if you go to Main setup and click Test database, do you get Connection successful?

User avatar
spanishhighs
Observer
Observer
Posts: 12
Joined: Mon Mar 12, 2018 2:02 pm
Location: Lanjaron, Granada, Spain
Station model: Davis Vantage Pro 2
Software: Weather Display ConsoleWD
Contact:

Re: Api data being received but not updating graphs/mysql

Post by spanishhighs » Thu Jun 27, 2019 2:08 pm

I get

Success: A proper connection to MySQL was made!
Table already exists.

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: Api data being received but not updating graphs/mysql

Post by andyk1 » Fri Jun 28, 2019 1:17 am

One quick question for my own curiosity and education again. Is this consolewd you are trying to implement using a raspberry Pi or a Linux box that's running 24/7 on your end?

I have not worked with Weather Display in a long while, Years so working off the top of my head and memory.

What happens when you run the cronjob manually?
Image

User avatar
spanishhighs
Observer
Observer
Posts: 12
Joined: Mon Mar 12, 2018 2:02 pm
Location: Lanjaron, Granada, Spain
Station model: Davis Vantage Pro 2
Software: Weather Display ConsoleWD
Contact:

Re: Api data being received but not updating graphs/mysql

Post by spanishhighs » Fri Jun 28, 2019 7:31 am

It is now on a small computer running Ubuntu Mate. We use this to run our media server and also the weather via Weather Display and Weewx. It runs 24/7. I have used Ubuntu Mate for many years and found it to be a very stable OS.

If you run a cron job manually I get a SUCCESS message but still the mysql database is not updated.

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: Api data being received but not updating graphs/mysql

Post by andyk1 » Fri Jun 28, 2019 11:05 pm

Even though the cronjob is saying success does not mean the data is being imported. It just runs a script to import what is available. It sees nothing is available to import. I am lost as to where next to look. As in clientraw.txt, is there a file to look at to see what is available in that file to import into the dB? a cache or similar? can you see data there and backtrack. My guess is there is something in WD that is not set up as in wrong file name, a password, a URL not matching.

Yes I have used Linux since the late 90's and Ubuntu seems to be the easiest to work with but I also like Debian.
Image

Post Reply