Meteohub plugin for Saratoga AJAX/PHP templates

Moderator: Mattk

skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by skyewright »

saratogaWX wrote:I'm not familiar enough with the Meteoplug to know if it's possible. The basic template architecture needs to have the weather software push data to the website for PHP and optional JavaScript/AJAX processing. If Meteoplug can push stuff via ftp, then it could work :?:
With Meteoplug itself "push" is not possible; it's all "pull". However presumably the template system doesn't really care how the data arrives just so long as it gets there some how? So if something else (e.g. a crontab using something like wget on the web server) were "pulling" from Meteoplug and "pushing" to where the template php site was then presumably that would have potential to work? Setting up the crontab (or whatever) would of course add complexity to the setup.

Your Meteohub is already providing data to Meteoplug (I just checked looking on the map at http://wiki.meteoplug.com/Maps_and_Groups)
The Meteoplug documentation is the wiki at http://wiki.meteoplug.com/Main_Page.
To see Meteoplug "from the inside" you'd need to sign up for a trial, as described on http://wiki.meteoplug.com/Getting_Start ... pplication.

Of course, people who already have Meteohub would probably simply use the Meteohub version, but people using the other client options (e.g. the ultra low energy Bifferboard) wouldn't have that option.

I use a Meteoplug "account" alongside my Meteohub because of the graphing capabilities which go way beyond anything possible with Meteohub. It acts as a further "off site" backup too.

Edit: I added wget as an example of something that might be used by a crontab entry to pull data from Meteoplug
MarKel
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: Mon Aug 23, 2010 4:03 pm

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by MarKel »

I have also a running meteohub and testen the saratoga template, but i can't automatically update the files using the meteohub solution because my ftp account on meteohub is alreay
uploading the info to another ftp-server.

see: http://zwolle.meteostad.nl/wxindex.php

i also have weather display live installed BUT on another domain (http://www.meteozwolle.nl).

the clientraw and other files neccesary for the saratoga template are transfered to the meteozwolle domain

would it be possible to upload the neccesary files to my saratoga template AND also to the meteozwolle domain
from the meteohub ?

i know i could be using a cron-job on my host to sync but can't get this working. A solution (ftp upload to multipe ftp-servers) would be nice
or perhaps there's another option i haven't found in meteohub yet ;-)


regards,

Marcel
geiro
Senior Boarder
Senior Boarder
Posts: 47
Joined: Mon Jul 18, 2011 12:42 am
Location: Oslo, Norway
Contact:

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by geiro »

MarKel wrote:
would it be possible to upload the neccesary files to my saratoga template AND also to the meteozwolle domain
from the meteohub ?

. A solution (ftp upload to multipe ftp-servers) would be nice
or perhaps there's another option i haven't found in meteohub yet ;-)
l
Add it as a request, I already did, but if more people wants the same thing the chances of getting it increases I would guess.....
wfpost
Platinum Boarder
Platinum Boarder
Posts: 591
Joined: Thu Jun 12, 2008 2:24 pm
Location: HONSOLGEN
Contact:

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by wfpost »

I have a second small server on my network: an alix running Debian 6 and doing all my webcam shots with a digital camera.
On that unit I installed the Saragota scripts and quickly saw that I might need an upload feature from meteohub to a 2nd ftp server as well.

Looking at how meteohub uploads to an ftp-server are done, I saw that multiple ftp-uploads is maybe not so easy.
To my knowledge ftp-uploads with meteohubs are working and executed like this:

cron creates all the defined files for uploading and stores them on
/var/run/meteohub/uploads

the last entry you see in cron is then doing this
- every minute - uploading all the files it reads from the above directory to the pre-defined ftp server in the GUI.
it waits 35 seconds, uploads the files and then removing all files to be ready when the same procedure starts again one minute later.

Code: Select all

*/1 * * * *     sleep 35; [ -z "`ls /var/run/meteohub/uploads/`" ] || [ -n "`/bin/pidof /usr/bin/ncftpput`" ] || /usr/bin/ncftpput -S .tmp -R -V -DD -u "username" -p "password" -P 21 ftp.ftpserver1.de directoryname /var/run/meteohub/uploads/* 2>&1 | /usr/bin/logger
as my alix can access meteohubs upload folder over the internal network, I only needed to add one task and copy the files to my alix before they´re getting deleted.
So, my alix waits 10 seconds to get the files created and then picking them up.

In your case:
Your 2nd ftp-server is external and you need clientraw.txt and other files uploaded to that 2nd ftp-server you might try this
Copy the last cron entry and add it slightly altered - of course leaving the orginal entry unchanged
change sleep to sleep 15; and the password and url of your 2nd server
(maybe you have to play around with the sleep time value, depending on how fast your broadband connection and ftp server is :
When I´m starting the command at the bottom manually from the shell it does not take longer than 2 seconds to upload the files to a different directory on my external ftp-server - so in any case the ftp-upload has finished before the the other ftp-upload starting 35 seconds after the minute)
Also: I would not do that on an NSLU2, because the performance of that old thing is simply not good enough to bring on and add further tasks :wink:

Code: Select all

*/1 * * * *     sleep 15; [ -z "`ls /var/run/meteohub/uploads/`" ] || [ -n "`/bin/pidof /usr/bin/ncftpput`" ] || /usr/bin/ncftpput -S .tmp -R -V -DD -u "username" -p "password" -P 21 ftp.ftpserver2.de directoryname /var/run/meteohub/uploads/* 2>&1
wfpost
Platinum Boarder
Platinum Boarder
Posts: 591
Joined: Thu Jun 12, 2008 2:24 pm
Location: HONSOLGEN
Contact:

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by wfpost »

Hi Ken,

just saw that Baro trend arrow and connected text are giving conflicting opinions.
What can be the reason for that?

kind regards,
Wolfgang

Image

My calculation says it´s steady which at the very moment is in line with what I read from my VP2 console

Image
MarKel
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: Mon Aug 23, 2010 4:03 pm

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by MarKel »

wfpost wrote:I have a second small server on my network: an alix running Debian 6 and doing all my webcam shots with a digital camera.
On that unit I installed the Saragota scripts and quickly saw that I might need an upload feature from meteohub to a 2nd ftp server as well.

Looking at how meteohub uploads to an ftp-server are done, I saw that multiple ftp-uploads is maybe not so easy.
To my knowledge ftp-uploads with meteohubs are working and executed like this:

cron creates all the defined files for uploading and stores them on
/var/run/meteohub/uploads

the last entry you see in cron is then doing this
- every minute - uploading all the files it reads from the above directory to the pre-defined ftp server in the GUI.
it waits 35 seconds, uploads the files and then removing all files to be ready when the same procedure starts again one minute later.

Code: Select all

*/1 * * * *     sleep 35; [ -z "`ls /var/run/meteohub/uploads/`" ] || [ -n "`/bin/pidof /usr/bin/ncftpput`" ] || /usr/bin/ncftpput -S .tmp -R -V -DD -u "username" -p "password" -P 21 ftp.ftpserver1.de directoryname /var/run/meteohub/uploads/* 2>&1 | /usr/bin/logger
as my alix can access meteohubs upload folder over the internal network, I only needed to add one task and copy the files to my alix before they´re getting deleted.
So, my alix waits 10 seconds to get the files created and then picking them up.

In your case:
Your 2nd ftp-server is external and you need clientraw.txt and other files uploaded to that 2nd ftp-server you might try this
Copy the last cron entry and add it slightly altered - of course leaving the orginal entry unchanged
change sleep to sleep 15; and the password and url of your 2nd server
(maybe you have to play around with the sleep time value, depending on how fast your broadband connection and ftp server is :
When I´m starting the command at the bottom manually from the shell it does not take longer than 2 seconds to upload the files to a different directory on my external ftp-server - so in any case the ftp-upload has finished before the the other ftp-upload starting 35 seconds after the minute)
Also: I would not do that on an NSLU2, because the performance of that old thing is simply not good enough to bring on and add further tasks :wink:

Code: Select all

*/1 * * * *     sleep 15; [ -z "`ls /var/run/meteohub/uploads/`" ] || [ -n "`/bin/pidof /usr/bin/ncftpput`" ] || /usr/bin/ncftpput -S .tmp -R -V -DD -u "username" -p "password" -P 21 ftp.ftpserver2.de directoryname /var/run/meteohub/uploads/* 2>&1
I just made the neccesary adjustments to my cron and i think it works like a charm !. Will test this for a few hours and get back to you with the result.
regards,

Marcel
User avatar
saratogaWX
Junior Boarder
Junior Boarder
Posts: 36
Joined: Tue Jun 14, 2011 2:39 am
Location: Saratoga, CA, USA
Contact:

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by saratogaWX »

wfpost wrote:Hi Ken,

just saw that Baro trend arrow and connected text are giving conflicting opinions.
What can be the reason for that?

kind regards,
Wolfgang

Image

My calculation says it´s steady which at the very moment is in line with what I read from my VP2 console

Image
The baro trend text is derived from the value of the change using the MH_get_barotrend_text function in MH-defs.php .. it uses:
// Change Rates
// Rapidly: =.06" inHg; 1.5 mm Hg; 2 hPa; 2 mb
// Slowly: =.02" inHg; 0.5 mm Hg; 0.7 hPa; 0.7 mb
values (actually the hPa values are used) to determine what the trend words should be.

The arrow is up or down if the difference between last 60 minutes pressure and current pressure is not zero. Yours shows -0.1 hPa per hour .. well inside the 'steady' range, but is actually numerically decreasing .. so the arrow routine shows a down-arrow with a 'Decreasing 0.1 hPa/hour' tooltip.
The arrow routine is used for all the arrow displays (temperature, humidity, dew point, pressure) so it can display something different than the text of the barometer trend (which quantizes the change values into ranges).

Best regards,
Ken
Free Weather website PHP templates and scripts at Saratoga-Weather.org
wfpost
Platinum Boarder
Platinum Boarder
Posts: 591
Joined: Thu Jun 12, 2008 2:24 pm
Location: HONSOLGEN
Contact:

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by wfpost »

Hi Ken,

do you know why the WU forecast isn´t working anymore?
That happens since two weeks.

Neither the outlook on the starting page nor the detailed WU forecast isn´t working anymore.

http://adr.homedns.org:88/

Detailed forecast shows up this error message:
Sorry.. this country forecast can not be processed by this script.
Locations in the United States and territories should use the carterlake NOAA script.

Locations in Canada should use the Environment Canada forecast script.

WeatherUnderground 7-Day Forecast: Buchloe
If I google that message there´s a couple of other websites with your script, but without meteohub showing the same failure.
What can I do?

Kind regards,
Wolfgang
User avatar
saratogaWX
Junior Boarder
Junior Boarder
Posts: 36
Joined: Tue Jun 14, 2011 2:39 am
Location: Saratoga, CA, USA
Contact:

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by saratogaWX »

wfpost wrote:Hi Ken,

do you know why the WU forecast isn´t working anymore?
That happens since two weeks.

Neither the outlook on the starting page nor the detailed WU forecast isn´t working anymore.

http://adr.homedns.org:88/

Detailed forecast shows up this error message:
Sorry.. this country forecast can not be processed by this script.
Locations in the United States and territories should use the carterlake NOAA script.

Locations in Canada should use the Environment Canada forecast script.

WeatherUnderground 7-Day Forecast: Buchloe
If I google that message there´s a couple of other websites with your script, but without meteohub showing the same failure.
What can I do?

Kind regards,
Wolfgang
Hi Wolfgang,

This issue was caused by a small website change by WeatherUnderground two weeks ago. I'd done an update of the WU-forecast.php script to handle that about 2 weeks ago. You can use the updates page (with a query date of when you originally downloaded the Base-World/MH-Plugin) to get all the needed updates to your site. The new WU-forecast.php V1.22(ML) was done 16-Sep-2011.

Hope this helps...
Best regards,
Ken
Free Weather website PHP templates and scripts at Saratoga-Weather.org
wfpost
Platinum Boarder
Platinum Boarder
Posts: 591
Joined: Thu Jun 12, 2008 2:24 pm
Location: HONSOLGEN
Contact:

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by wfpost »

I see >>> yes, that helped :D
Thanks very much and nice weekend,
Wolfgang
User avatar
saratogaWX
Junior Boarder
Junior Boarder
Posts: 36
Joined: Tue Jun 14, 2011 2:39 am
Location: Saratoga, CA, USA
Contact:

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by saratogaWX »

Just a note to let you know that several updates to the templates are now available.

First, a new wxmetar.php page was added to the Base-* distributions .. this new page allows you to display the reports from your nearby METAR stations. For Canada/World, the display is also multilingual.

Second, for Base-World distribution, an improved WU-forecast.php is available with multi-city forecast capability (like the same capability for Base-USA in the NOAA forecasts).

Third, the capability for right-to-left reading languages has been added to the Base-World template, and the Hebrew translations were provided by Eli of Sde Hemed Weather. For this capability, a new Settings-language.php file was implemented to make it easier to update languages as they become available.

Updates for V3 templates are available from the updates page

Convert V2 WD/AJAX/PHP to V3 easily using the upgrade tool page.

You can keep informed of updates as they become available using the RSS feed and/or the SaratogaWXPHP Twitter feed.

Best regards,
Ken
Free Weather website PHP templates and scripts at Saratoga-Weather.org
Killervette
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: Mon Dec 19, 2011 1:06 am

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by Killervette »

Is there a way to update clientraw more often than 1 minute? I use Saratoga weather Ajax scripts and it updates the data much more often than once a minute. I would like to be able to update the data.
JohnR
Fresh Boarder
Fresh Boarder
Posts: 15
Joined: Fri Dec 23, 2011 11:01 pm

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by JohnR »

I've been setting up my site using the templates over the past few days at http://www.jrainer.co.uk/weather. Very impressed with them!

Most things seem to be working, other than on the Home page, Rain Yesterday is showing as zero when it should be 2.4mm. In the current yesterday.php file there is $WX['yday_rain0_total_mm'] = '2.40' but i'm not sure where the Home page rain value is being pulled from.

Similarly on http://www.jrainer.co.uk/weather/wxtrends.php the Rain history is showing nothing and the Yest. value under Rain is zero. Everything else there seems ok. Is this a Meteohub plugin configuration issue or something to do with general configuration of the templates that I've got wrong? Or is it just because the station has only been running a few days?

[edit] not sure if this helps but in MHtags.php I have "seqday1_rain0_total_mm|2.40 0.00 0.00 :|:" and in MHdefs.php: "$yesterdayrain = MH_seqval('seqday1_rain0_total_mm',1,$uomrain)" and also "$raccumweek = MH_seqval('seqday1_rain0_total_mm',8,$uomrain)".

Thanks

John
User avatar
saratogaWX
Junior Boarder
Junior Boarder
Posts: 36
Joined: Tue Jun 14, 2011 2:39 am
Location: Saratoga, CA, USA
Contact:

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by saratogaWX »

JohnR wrote:I've been setting up my site using the templates over the past few days at http://www.jrainer.co.uk/weather. Very impressed with them!

Most things seem to be working, other than on the Home page, Rain Yesterday is showing as zero when it should be 2.4mm. In the current yesterday.php file there is $WX['yday_rain0_total_mm'] = '2.40' but i'm not sure where the Home page rain value is being pulled from.

Similarly on http://www.jrainer.co.uk/weather/wxtrends.php the Rain history is showing nothing and the Yest. value under Rain is zero. Everything else there seems ok. Is this a Meteohub plugin configuration issue or something to do with general configuration of the templates that I've got wrong? Or is it just because the station has only been running a few days?

[edit] not sure if this helps but in MHtags.php I have "seqday1_rain0_total_mm|2.40 0.00 0.00 :|:" and in MHdefs.php: "$yesterdayrain = MH_seqval('seqday1_rain0_total_mm',1,$uomrain)" and also "$raccumweek = MH_seqval('seqday1_rain0_total_mm',8,$uomrain)".

Thanks

John
Hi John,
Thanks for the kind words about the template set.. I'm glad you're enjoying using it for your personal weather website.

I just looked at your site, and the 2.4mm for yesterday now shows.. The yesterday.php file depends on having the cron run it at 23:55 each day to take a snapshot of the day_ values and put them a set of yday_ values for later use. Just make sure the setup for the yesterday * graph upload has a custom schedule of '59 23 * * *' and it should capture the yesterday values for you on a daily basis.

Best regards,
Ken
Free Weather website PHP templates and scripts at Saratoga-Weather.org
JohnR
Fresh Boarder
Fresh Boarder
Posts: 15
Joined: Fri Dec 23, 2011 11:01 pm

Re: Meteohub plugin for Saratoga AJAX/PHP templates

Post by JohnR »

Hello Ken,

I'm a bit further forward in at least something is showing for yesterday's rain. Trouble is today is the 31st and it's showing the total of 2.4mm, which was the total for the 29th!

The total for the 30th was 6.0mm and the current yesterday.php file on my website has $WX['yday_rain0_total_mm'] = '6.00'. The file is dated 30/12/2011 23.59 so it seems to have uploaded at the right time with the right data. The Meteohub and weather station are both showing the correct date and time.

in the Trends page there is the correct month and year totals (8.4mm from a total of two days rain of 6mm and 2.4mm) but Yesterday is also showing there as 2.4mm.

Anything else I should be checking?

Also, the Rain History on the Trends page has no data showing - just:

Today days since last rain on
Week 0.0 mm over last 7 days.
Month - mm last month.

I tried the updated MH-defs-prototype.txt mentioned in a post by you on the wxforum site about rain history issues (even though my download was 19th Dec and post dated the fix) and generating a new php file from it but it made no difference, so I've gone back to the original.

Thanks for your help.

John
Post Reply