View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 35 posts ] 
Go to page 1, 2, 3  Next

Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sat Aug 30, 2008 6:54 am 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
Install RRDWeather-Mod

If you leave your KM box up 24/7 and have an interest in weather data, you might want to consider running RRDWeather-Mod. This is a modified version of Sébastien Wains' RRDWeather and it will work with KM5.5 out-of-the-box since KM R5.5 contains all the dependencies fully configured!

Basically, it will get weather data (temps, dew point, wind speed, uv index, moon phases, etc.) from weather.com and a few other source via an xml feed for any number of cities and place the data into rrd databases which it then displays graphically via rrdgraph when you browse to the url of the included .cgi script. It's just like the included rrd logging features in KM R5.5. You'll get nice graphs of various weather data for your city/cities on a daily, weekly, monthly, and yearly basis.

Frank Helak modified rrdweather to be even better in my opinion. In addition to the list data logged in the standard version, the notable enhancements are:
    * Forecasted high/low temps (area graph range, very slick)
    * Forecasted percent precipitation
    * Sunrise/sunset times
    * Wind direction

I further modified his original adding the following:
    * Novel and bandwidth friendly data update paradigm (cron invoked flag scripts/one main data harvester script)
    * Historical temperature data
    - Record high temp and the year it was set
    - Record low temp and the year it was set
    - Monthly average high and low temps
    * Precipitation graph (average monthly/amount fallen to-date)
    * Approx. Lunar cycle graph
    * Error checking which eliminates those damn zero value spikes
    * Nice installer/update/uninstaller scripts


Anyway, Frank wrote his mods on an earlier version of rrdweather (0.36) and was kind enough to send me the code he wrote which I adapted to the current version which is 0.42.

For a live demo of Frank's modified version, see this page. Note that the version at the URL above does NOT have any of my mods but it will give you a flavor for what it looks like.

I pre-configured the modified version for KM R5.5 so you just untar, add your zipcode(s) and run the installer!

Download the tarball (19 kb) here.
The md5sum for the tarball is: 6e245df6d5d86810d34ff49a02b8e075

Untar the file like this:
Code:
$ tar zxvf rrdweather-0.42-mod-R6.tgz ; cd rrdweather-0.42-mod-R6


Then enter your zipcode(s) in the files/rrdweather.conf and if you want to use metric units, edit the setting in the same file as well as in the file/weather.cgi file. Now just run the install.sh script like this:

Code:
# ./install.sh


I included a README with more detailed instructions.

If you have an existing rrdweather-mod, and wanna keep the data, you can copy the db's to another dir, run the install.sh, then copy them back after you make new databases.

For example, let's say I have data for zipcode 90210 and 80303 I want to save them.

1) Move the current db's to a safe place:

# mv /myth/rrdweather/db /home/mythtv

2) Run the uninstall/install as directed above and REMEMBER that the un-
installer will delete your /myth/rrdweather/db dir so be sure you did step
1 above!

3) Copy the legacy db's back overwriting any new ones that are dups

# cp /home/mythtv/db/90210/*.rrd /myth/rrdweather/db/90210
# cp /home/mythtv/db/80303/*.rrd /myth/rrdweather/db/80303

That should do it!

:!: EDIT on 27-Sep-08 - Enhancements, fixes and updates. Get the new release now (0.42-R6)!

CHANGELOG wrote:
26-Sep R6
- you will need to uninstall/reinstall for this release since new databases are required. this is very easy to do. please read the included README file which will show you how to do it keeping any current database you may have.

- totally re-wrote the backend scripts to use a novel paradigm of a single master data harvester script and three other cron-invoked flagger scripts which tell the master script when it's time to update the data source.

- made the scripts all point to vars defined in weather.conf which is nice if you wanna run this on a non-KM system (i.e you define the rrdweather-mod root dir, the user that can run the scripts, etc.)

- added two new databases and new graph for the phases of the moon
- added a few extra static vars to the graphs and also some added descriptors

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Last edited by graysky on Sat Sep 27, 2008 5:01 am, edited 28 times in total.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 31, 2008 2:39 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

Rather a cool project :) Makes nice graphs too!

Would you know how to modify the scripts to use locally available data instead of some unknown source?

Thanks
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 31, 2008 3:55 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
You can use any time dependent data source with rrdtool. The catch is having a weather station that can output its data in a format you can read. A number of expensive ones do in fact export their data to a variety of formats, but most of these are pretty expensive and undoubtedly come with their own data visualization software.

If you have a data source and wanna learn rrdtool, see the tutorials and documentation on the rrdtool page.

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 31, 2008 4:53 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

Thanks! I will poke at it a little to see what I can figure out. Here is what I currently can use:
17:03 08/31/08 E 03MPH 460F 460F 079F 036% 30.24S 00.00"D 00.75"M 34.39"T

It also runs very nicely on R5F27 except even with the m > e change I still get c labels on the temps.

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 31, 2008 5:04 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
::confused:: what is generating those data for you and how regularly will it update? Is it just a text file or..??

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 31, 2008 5:34 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,
Sorry, didn't mean to toss in a confusion factor :) It is a plain string of text that I pull every ~30 seconds or so using a RS232 connection from a Texas Weather system. Definitely not a "high end" system but ok for me. I mean does it really matter if it 92 or 93 degrees? A half mile away it probably is +/- of my readings anyway.

It is easy to separate out what data I want (tjc & Human taught me how) but I just never was able to grabbed how to make graphs and a single picture can give a lot of information in a single glance.

Something fun to do as I don't watch much TV :)
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 31, 2008 6:36 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
@mjl - cool. I think it can be done, but I don't have the know-how to do it :) If you study the structure of the rrdweather I think you can figure out what has to happen.

1) Grabber (something to read and parse the data)
2) Logger (something to feed the logged data into the rrd databases)
3) Grapher (rrdgraph)

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 31, 2008 6:57 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

Thanks for the encouragement. Looks like the magic is in the xml file which I can recreate easily. Just not sure of what how the second "zip-fore.xml" one ties in with some of the minor stuff.

The rest is in the cgi scripts and I can mess those up too. Will let you know what works out.

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 31, 2008 7:00 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
The zip-fore.xml is just the 1-day forecast which allows it to bring in the high and low temp for the day. In your case, you'd just have the single data source.

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 31, 2008 7:46 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

Ok, that makes sense and explains the values. Only part I have to figured out is where the script picks where to go to pull the xml so I can stop it and let it do the work locally.

I have checked in these but there seems to be an invisible pointer for the url, at least I don't see it.
/etc/cron.d/rrdweather
/usr/share/rrdweather/rrdweather_cron.sh
/usr/share/rrdweather/db_builder.sh
/etc/rrdweather.conf

Any hints?
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 01, 2008 5:42 am 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
It's /usr/share/db_updater.sh

The /etc/cron.d/rrdweather_cron should point to it and run it every 5 min.

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 01, 2008 6:07 am 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

Yep, found it also :) Only problem remaining so far is that it complains about the time stamp Not sure of what it is trying to tell me but will keep poking.

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 01, 2008 6:58 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

Just an update. It took a few little adjustments to select the data I have available and once I fixed my typos, the previous errors disappeared also. :) It works very nicely in R5F27.

The only small issue I have and it doesn't make any difference of where the source data is from, but I don't like the scaling of the barometer in inches. Maybe millibars might be ok but I have used inches so long and have no need to re-learn in mb. I was trying for an expanded fixed window of 28 to 32 as that shows trends nicely.

Thank you graysky for sharing!
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 02, 2008 1:18 am 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
I can take a look at this for you later today (no time right now). Also, can we take this conversation into a new thread?

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2008 12:35 am 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
I updated the rrdweather-mod (see first post) with some new features and a few bug fixes. Check it out!

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ] 
Go to page 1, 2, 3  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu