LinHES Forums
http://forums.linhes.org/

HOWTO: Install and Run RRDWeather-Mod on KM R5.5
http://forums.linhes.org/viewtopic.php?f=11&t=18894
Page 2 of 3

Author:  mythman13 [ Tue Sep 09, 2008 4:37 am ]
Post subject: 

Thanks for the guide graysky!

I was thinking that it'd be great to create a sought of mini-weather station and use this to graph the output, since unfortunately the nearest 'weather station' for me is quite far away!

Author:  mjl [ Tue Sep 09, 2008 5:27 pm ]
Post subject: 

Hi,

Noticed the changes but haven't figured what you did between the two. I notice the forecast doesn't work for me any more :( That is ok as I really don't use it except to test before I make changes.

One change I haven't figured out is how to stop the cgi from running back to w3c every 5 mnutes or on refresh to validate. It is almost like a "mother may I " tattler.

I use it with a Texas Weather systems station for local stuff on a com port for data source. Still working the graph scale for the barometer (air pressure) as what the scale is now barly makes a wiggly line. Always something to learn.

Anyway, it works nicely. :)

I would personnally rather see all the the rrdweather stuff stay in one thread rather than stuff get lost in the 100,000 + entries.

Thanks
Mike

Author:  graysky [ Wed Sep 10, 2008 1:35 pm ]
Post subject: 

mjl wrote:
I notice the forecast doesn't work for me any more :( That is ok as I really don't use it except to test before I make changes.


What zipcode are you using? The forecast data comes from an html source, not xml like the current, fells-like, dew point, etc. does. I can have a look and possibly adjust the parsing accordingly.

mjl wrote:
One change I haven't figured out is how to stop the cgi from running back to w3c every 5 mnutes or on refresh to validate. It is almost like a "mother may I " tattler.


That is something I'll haven't messed with...I think you can just comment out the lines in the weather.cgi for it, no?

Author:  mjl [ Wed Sep 10, 2008 6:29 pm ]
Post subject: 

Hi,

02886

I tried the disabling trick using the ! but then the script returns an error compliaining... :(

As for the pressure, that chart needs to be a single with the rang ~27.5 to 32.5 inches or what ever the milli bar numbers would be. I think I recall a 32 once many years ago but it may not have been official numbers. Anyway, I have not figured out how to do that scaling.

It is an interesting & fun project, thanks for getting me started :)
Mike

Author:  graysky [ Thu Sep 11, 2008 1:39 pm ]
Post subject: 

mjl wrote:
Hi,

02886

I tried the disabling trick using the ! but then the script returns an error compliaining... :(

As for the pressure, that chart needs to be a single with the rang ~27.5 to 32.5 inches or what ever the milli bar numbers would be. I think I recall a 32 once many years ago but it may not have been official numbers. Anyway, I have not figured out how to do that scaling.

It is an interesting & fun project, thanks for getting me started :)
Mike


Odd, I entered in your zipcode and all the fields are getting populated just fine. The only one that may have a problem is the "forecast high temp" because after a certain point in the afternoon, they don't include data for it since the day is more or less over... it should start populating around 4-5 AM with their high temp for the day forecast.

Can you confirm that it's working on your machine now?

Here is the output of my test script for the data I downloaded for your zipcode:

Code:
======= From the XML ===========
Real temperature . : 70
Felt temperature . : 70
Dew point ........ : 46
Humidity ......... : 41
Wind ............. : 2
Wind Direction ... : 230
Pressure ......... : 30.35
UV index ......... : 2
Sunrise .......... : 6.22
Sunset ........... : 7.01
======= From the-fore.XML ======
Hi temp .......... : UUU
Low temp ......... : 54
Precip chance .... : 10
======= From the-extra.html======
Precip. to Date .. : 4.36
Average Precip ... : 3.70
Record High ...... : 100
Record Low ....... : 32
Average High ..... : 73
Average Low ...... : 55

Author:  mjl [ Thu Sep 11, 2008 7:47 pm ]
Post subject: 

Hi,

Appears the issue was on my end. I think I may have simply replaced your updated script with the original :oops: Redid the steps and it worked the second time. Sometimes it gets tricky with same nane files and moving them around, plus also maybe throw in a senior moment....

How about the scale for the barometer, is it do able?

Thanks
Mike

Author:  graysky [ Fri Sep 12, 2008 1:25 pm ]
Post subject: 

Glad you got it solved... to alter the scale for pressure, simply edit your /usr/lib/cgi-bin/weather.cgi

Look for the variables that define it:
Code:
if($system eq "m") {
        $speed = 'kph';
        $pressurelowlimit = '980';
        $pressureuplimit = '1100';
        $rech_c = 'myrech';
        $aveh_c = 'myaveh';
        $avel_c = 'myavel';
        $recl_c = 'myrecl';
        $pressure_units = 'hPa';
        $precip_units = 'mm';
        $temp_units = '°C';
}
elsif($system eq "e") {
        $speed = 'mph';
        $pressurelowlimit = '20';
        $pressureuplimit = '40';
        $rech_c = 'rech_c';
        $aveh_c = 'aveh_c';
        $avel_c = 'avel_c';
        $recl_c = 'recl_c';
        $pressure_units = 'in Hg';
        $precip_units = 'in';
        $temp_units = '°F';
}


You can alter the '20' and '40' to whatever you want. You will need to manually delete the /myth/rrdweather/tmp/ZIPCODE/*.png or wait for the next update to have the png graphics reflect your change.

Author:  mjl [ Fri Sep 12, 2008 8:30 pm ]
Post subject: 

Hi,

That doesn't do it and the code in the -mod.cgi is a bit different.
I just need to do some more reading I guess :)
Thanks
Mike

Author:  mjl [ Fri Sep 12, 2008 10:01 pm ]
Post subject: 

Hi,

Looks this will do it for the hg settings. just convert to mb for metric. Using the weather-mod.cgi script.

"--title= Barometric Pressure at $city",
'--vertical-label', 'Pressure',
# '--lower-limit', $pressurelowlimit,
'--lower-limit', 27,
# '--upper-limit', $pressureuplimit,
'--upper-limit', 32,
'--units-exponent', 0,
'--rigid',
'--slope-mode',
'--no-gridfit',
'--lazy',
# '-Y',

This gives a scale of 27 (hurricane) to 32 (siberian) inches which now displays trends very nicely. At least I think so.

Now to stop the w3c tally call.
Thank you
Mike

Author:  graysky [ Sun Sep 14, 2008 4:13 am ]
Post subject: 

:!: Sep-14 update to RRDWeather-mod (now version R5).

You can download it from the link in the first post and updating your existing "live" rrdweather-mod is trivial. Just untar and run the update.sh script!

CHANGELOG:
- added an update.sh script that'll just copy *.sh and weather.cgi to correct dirs. use this if you have a prev. release and don't wanna rebuild everything from scratch
- added error checking to all databases and included the spikeremoval script
- fixed small error in weather.cgi regarding precip. graph
- added a sea level line to pressure graph
- added some debug info for db_update.sh
- updated the README

Author:  opel70 [ Mon Sep 15, 2008 11:39 am ]
Post subject: 

Wow, talk about easy!

Now I need to follow Mike's example and get this pulling from my weather station instead of weather.com. This I already have historical charts for my data, and this will give some comparison abilities.

Plus I can set this up to collect info for my brother in California as well.

Anyway, thanks for putting this "package" together. It took me a whole two minutes from the time I was downloading the file, to when it was creating the first set of data.

Author:  brfransen [ Mon Sep 15, 2008 3:01 pm ]
Post subject: 

Great job graysky!

I believe that there is a typo in the install.sh script. Line 74:
Code:
        echo "Point your browser to http://IP_of_mythbox/weather.cgi?zip=12345"
Should be:
Code:
        echo "Point your browser to http://IP_of_mythbox/cgi-bin/weather.cgi?zip=12345"


Also, I added a link to /var/www/index.html just below the RRDTool link so that there is easy access to the Weather page:
Code:
      <p><a href="cgi-bin/weather.cgi?zip=56110"><b>RRDWeather for 56110</b></a>: <br>

                &nbsp; &nbsp; Weather graphs.
          </p>
It might be helpful to have install.sh do this.

Thanks,
Britney

Author:  graysky [ Mon Sep 15, 2008 3:29 pm ]
Post subject: 

@opel70 - thanks for the kind words. I'm very glad people are enjoying this too.

@brfransen - thanks for catching that! I changed it and will update the tgz soon (day or so). As to your suggestion to edit the html. How could we do so such that it would automatically see how many zips folks added and update itself if they add/remove additional ones?

Author:  brfransen [ Mon Sep 15, 2008 5:07 pm ]
Post subject: 

graysky wrote:
How could we do so such that it would automatically see how many zips folks added and update itself if they add/remove additional ones?
I didn't think about the multiple zips issue. That would take a little scripting to parse the zips line. I don't know of a way to have it update itself without the user running another script if they add/remove additional ones later.

Britney

Author:  graysky [ Sat Sep 27, 2008 5:03 am ]
Post subject: 

Updated RRDWeather-Mod to R6. For a changelog and d/l link, see the first post of this thread.

Update today :)

Page 2 of 3 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/