Re: [mh] Weather and Weather_Chance_Of_Rain
Brian M <[email protected]>
| Newsgroups | gmane.comp.misc.misterhouse.user |
|---|---|
| Message-ID | <[email protected]> |
Stephen,
I can clarify about fallback, and hopefully put you on the path to the
right solution.
MH has a long standing philosophy of having it "just work out of the
box". (Others can probably represent this perspective better than I can
as it's not mine, but I'll give it a shot and trust others to correct me
where necessary.) What that meant was that they didn't want to have a
lot of Perl pre-requisite modules. So instead, they packaged the
commonly needed modules in with MH, so that when you unpack it, you get
them too.
The problem lies in that no one ever wanted to keep the packaged
CPAN/distro modules embedded in MH up-to-date, so that for example the
version of LWP::UserAgent (for interfacing with web-sites) provided with
MH was so old it didn't support SSL, even though the version you or I
would install via CPAN or our distro has supported SSL for years.
To make things worse, MH explicitly set the Perl library path, so that
the supplied versions preempted system versions (e.g. /usr/lib/perl or
whatever from your distro or CPAN), so that the only way to update the
MH version was to make and maintain a local mod to MH yourself. In my
case, finding this out that meant many hours of trying to figure out why
a piece of my code worked perfectly outside of MH (because it used the
CPAN LWP::UserAgent), but not in MH (because it used a really old
version that didn't support SSL). That's my perspective, at least.
I wanted a solution that would be acceptable to those with the "just
work out of the box/provide modules" perspective, while still allowing
people that needed a newer version of a module to install it without
hacking MH every time it updates. What I implemented to please everyone
was to identify all the external Perl modules that MH packaged into it's
distribution but wasn't maintaining. It's a long list. I then moved
all of these that I could from MH's normal library into the newly
created "fallback" library, which I listed at the end of the Perl5
library list. That way, if you have a newer version in the system
libraries, your code could find it. If you didn't, the out-dated
versions in fallback libraries would still get picked up and used.
Essentially, the fallback libraries become the library of last resort
instead of preempting the system libraries.
That code went in in April (I think), and this is the first incident
I've heard of where it broke something. What that tells me is that
get_weather calls on a module that exists broken in fallback. By
removing fallback, you've removed access to broken code, and it works
again. How it works without the module it found in fallback is beyond
me since there are no libraries to search after fallback. It may have
some "if I can't find module X, use Y instead" logic in it, and you
deleted access to X.
Removing fallback is the wrong solution, however. The best and easiest
solution is to identify the outdated, broken module get_weather is using
out of the fallback library, and install a newer one via CPAN or your
distro. get_weather will automatically pick up the newer one instead
and I think you should be in good shape. Or find just delete the
reference to the broken module so get_weather doesn't use it, since
get_weather isn't using it when you removed fallback and appears to work
fine.
In any case, moving the outdated CPAN modules into fallback gives you
options. If we hadn't implemented that change, get_weather would still
break (because it would still find bad module X, just in lib instead of
fallback/lib), but then you wouldn't be able to fix it by just
installing a newer version of X. Moving the module from lib to fallback
didn't break get_weather, it just made some other breakage you
discovered easier to fix.
-Brian M
On 12/6/20 7:45 PM, Stephen Switzer wrote:
> A month later I was able to piece together a commit that seems to have
> all the needed changes from master.
>
> https://github.com/pmatis/misterhouse/commit/bbd8f73942cbe304403d953f7c614268c3783fde
>
> There are still some significant unanswered questions in my mind, but
> first...
>
> 1. I discovered that the Geo:WeatherNOAA module that I received was
> older than what was in master.
> 1. I only added a line for gracefully failing a little early,
> since continuing on is wasted cycles.
> 2. The get_weather script was out of date in master, lacking a change
> from 08/17/16 by Rick, but contained a nws_rwr_zone parameter that
> seems to be ignored in this file.
> 3. internet_weather.pl <http://internet_weather.pl> was calling
> "print_current($parms{city}, $parms{zone}..." instead of
> "print_current($parms{city}, $parms{state}..." in one copy of that
> file I had. I can't seem to put my eye on it right now, though.
>
> The main thing that I'm questioning is the addition of
> '$Pgm_Path/../lib/fallback' in get_weather. While comparing versions
> of files that I had, I finally stumbled upon this difference and
> noticed that when I removed this from the path, the forecast was
> retrieved successfully. I went into the fallback directory and tried
> to determine what was in there that was seemingly too old. I looked
> into WeatherNOAA.pm to see what it depended on and removed the 2 LWP
> modules, then tried again with the entire LWP directory. I moved on
> Tie::IxHash, then the entire Tie directory, Text... I was removing
> huge chunks of these files and nothing changed the results except
> removing the fallback directory from the path.
>
> I have a sneaking suspicion that I missed something. At least for now
> I have something that makes master work for me. There's a bunch of
> commits that I can cherry pick into my running code and have it work.
> Anyone else care to peek at this?
>
> Thanks!
> Steve
>
> On Tue, Nov 3, 2020 at 4:40 PM Rick Steeves via misterhouse-users
> <[email protected]
> <mailto:[email protected]>> wrote:
>
> D'oh, I had also updated the internet_weather page - I should have
> sent
> that to you as well! sprry...
>
> Rick
>
>
> On 11/3/2020 11:14 AM, Stephen Switzer wrote:
> > An update to everyone, I incorporated these two files,
> experimented and
> > modified them along with internet_weather.pl
> <http://internet_weather.pl>
> > <http://internet_weather.pl> and finally have it working. I'll
> have to
> > diff things and boil down what really mattered then submit a pull
> > request. Meanwhile, if anyone else is interested, please let me
> know.
> > I'll share.
> >
> > Thanks, Rick!
> >
> > Steve
> >
> > On Mon, Nov 2, 2020 at 10:37 AM Rick Steeves via misterhouse-users
> > <[email protected]
> <mailto:[email protected]>
> > <mailto:[email protected]
> <mailto:[email protected]>>> wrote:
> >
> >
> > Set you my copies of get_weather and weatherNOAA.pm under
> separate
> > email.
> >
> > rick
> >
> >
> >
> > On 11/2/2020 8:51 AM, Stephen Switzer wrote:
> > > I'm still recovering my system and would like this portion to
> > work now.
> > > Are there any updates to this since then? I checked out the
> > current GIT
> > > repo and that version doesn't work for me with
> get_weather either.
> > >
> > > Would appreciate any pointers to getting back up with
> forecasts
> > so I can
> > > enjoy the "chance of rain" announcements a little more
> before it
> > changes
> > > over to the "s" word for winter. ewwww.
> > >
> > > Thanks!
> > >
> > > On Wed, Sep 28, 2016 at 9:18 PM Wayne Gatlin
> <[email protected] <mailto:[email protected]>
> > <mailto:[email protected] <mailto:[email protected]>>
> > > <mailto:[email protected] <mailto:[email protected]>
> <mailto:[email protected] <mailto:[email protected]>>>> wrote:
> > >
> > > Sorry, forgot to attach the file.
> > >
> > > _Wayne
> > >
> > > On Wed, Sep 28, 2016 at 8:17 PM, Wayne Gatlin
> > <[email protected] <mailto:[email protected]>
> <mailto:[email protected] <mailto:[email protected]>>
> > > <mailto:[email protected] <mailto:[email protected]>
> <mailto:[email protected] <mailto:[email protected]>>>> wrote:
> > >
> > > These URLs seem to work, I updated WeatherNOAA.pm
> with
> > the new
> > > URLs and attached it to this email. Let me know if it
> > works for you.
> > >
> > >
> >
> http://forecast.weather.gov/product.php?site=LIX&issuedby=LIX&product=ZFP&format=txt&version=1&glossary=0
> > >
> >
> http://forecast.weather.gov/product.php?site=LIX&issuedby=LIX&product=RWR&format=txt&version=1&glossary=0
> > >
> > > _Wayne
> > >
> > > On Wed, Sep 28, 2016 at 6:39 AM, Brian Klier
> > > <[email protected]
> <mailto:[email protected]> <mailto:[email protected]
> <mailto:[email protected]>>
> > <mailto:[email protected] <mailto:[email protected]>
> <mailto:[email protected] <mailto:[email protected]>>>> wrote:
> > >
> > > I should correct myself, it looks like it WAS
> working
> > until
> > > just recently. I noticed some of the RIDGE
> graphics have
> > > changed to new sites at NOAA, so it sounds
> like they
> > might
> > > be doing some sort of refresh of their
> website this week.
> > >
> > > Brian
> > >
> > > On Tue, Sep 27, 2016 at 10:32 PM, Eloy Paris
> > > <[email protected] <mailto:[email protected]>
> <mailto:[email protected] <mailto:[email protected]>>
> > <mailto:[email protected] <mailto:[email protected]>
> <mailto:[email protected] <mailto:[email protected]>>>> wrote:
> > >
> > > Same here. I tried around 6 PM EDT and it
> didn't
> > work.
> > >
> > >
> > > On September 27, 2016 10:22:50 PM EDT,
> Wayne Gatlin
> > > <[email protected]
> <mailto:[email protected]> <mailto:[email protected]
> <mailto:[email protected]>>
> > <mailto:[email protected] <mailto:[email protected]>
> <mailto:[email protected] <mailto:[email protected]>>>> wrote:
> > >
> > > I'm not sure how I missed Ricks
> email, but I just
> > > set it up and its not working for me.
> I'm not
> > able
> > > to get to the URLs in the email or
> the one that's
> > > built from my zone.
> > >
> > > I get a 404 for both of these urls:
> > > http://www.srh.noaa.gov/data/LIX/ZFPLIX
> > > http://www.srh.noaa.gov/data/RAH/ZFPRAH
> > > <http://www.srh.noaa.gov/data/RAH/ZFPRAH>
> > >
> > > cat data/web/weather_conditions.txt
> > > Error getting data from
> > > http://www.srh.noaa.gov/data/LIX/RWRLIX
> > >
> > >
> > > Unless there's just an issue at NOAA
> right
> > now, I'm
> > > not sure what else could be wrong.
> > >
> > >
> > > _Wayne
> > >
> > >
> > >
> > > On Tue, Sep 27, 2016 at 5:09 PM,
> Brian Klier
> > > <[email protected]
> <mailto:[email protected]>
> > <mailto:[email protected] <mailto:[email protected]>>
> > > <mailto:[email protected]
> <mailto:[email protected]>
> > <mailto:[email protected]
> <mailto:[email protected]>>>> wrote:
> > >
> > > I've been using it since Rick
> posted his
> > fix and
> > > it's been working perfectly here.
> > >
> > > Brian
> > >
> > > On Tue, Sep 27, 2016, 2:01 PM Lieven
> > Hollevoet
> > > <[email protected]
> <mailto:[email protected]> <mailto:[email protected]
> <mailto:[email protected]>>
> > <mailto:[email protected] <mailto:[email protected]>
> <mailto:[email protected] <mailto:[email protected]>>>> wrote:
> > >
> > > Hello all,
> > >
> > > is there somebody who has
> tested this
> > > already? Would be nice if we
> could
> > add it to
> > > toe upcoming 4.2 stable release.
> > >
> > > Kind regards,
> > > Lieven.
> > >
> > > > Op 19 aug. 2016, om 18:34
> heeft Rick
> > > Steeves
> <[email protected] <mailto:[email protected]>
> > <mailto:[email protected] <mailto:[email protected]>>
> > >
> <mailto:[email protected] <mailto:[email protected]>
> > <mailto:[email protected]
> <mailto:[email protected]>>>> het
> > > volgende geschreven:
> > > >
> > > > The two correct URLs (for when
> > your zone
> > > is RAH) used for queries now:
> > > >
> > http://www.srh.noaa.gov/data/RAH/RWRRAH
> > > >
> > http://www.srh.noaa.gov/data/RAH/ZFPRAH
> > > >
> > > > See attached. Updates for
> weather NOAA
> > > website changes:
> > > >
> > > > Updated GEO::WeatherNOAA to
> > confirm with
> > > new website, replace inside
> the base
> > MH code
> > > /lib/site/Geo.
> > > > Used the CPAN 4.38
> as the base
> > > (which is wildly newer than
> what's
> > included
> > > in MH).
> > > > Note - the NOAA no
> longer uses
> > > "State", but is instead using
> > regional three
> > > digit zone codes.
> > > > You can get those
> codes here:
> > >
> http://forecast.weather.gov/product_sites.php?site=CRH&product=ZFP
> > > > You must include
> that zone
> > value
> > > in your mh.private.ini file.
> > > > Example: zone=RAH for
> > Raleigh-Durham
> > > > Updated get_weather to
> incorporate
> > using
> > > zone instead of state,
> located in /bin
> > > >
> > > > Note that foundation I
> used for
> > > get_weather is likely out of
> date, as
> > I have
> > > yet to work with the new (Git?)
> > repository,
> > > so I'm working off my 2.105
> (-ish)
> > personal
> > > environment. The WeatherNOAA.pm I
> > built from
> > > the most current version of
> > GEO::WeatherNOAA.pm
> > > >
> > > >
> > > > If anyone still uses this
> code, please
> > > use and let me know how it
> goes. You can
> > > tell if it's working by
> looking at
> > > > \data\web\weather_forecast.txt
> > > >
> \data\web\weather_conditions.txt
> > > >
> > > > Rick
> > > >
> > > >
> > > > At 02:10 PM 8/18/2016, Rick
> > Steeves wrote:
> > > >> The NOAA has provided
> URLs which
> > return
> > > raw text for the forecast and
> point
> > information.
> > > >> For when the location is RAH:
> > > >>
> > http://www.srh.noaa.gov/data/RAH/PFMRAH
> > > >>
> > > >>>>
> > http://www.srh.noaa.gov/data/RAH/ZFPRAH
> > > >>
> > > >> Shouldn't take me much
> from there
> > to fix
> > > Geo::WeatherNOAA
> > > >>
> > > >> Rick
> > > >
> > >
> >
> <get_weather.txt><WeatherNOAA.pm>------------------------------------------------------------------------------
> > > >
> > >
> > ________________________________________________________
> > > > To unsubscribe from this
> list, go to:
> > >
> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
> > > >
> > >
> > >
> > >
> >
> ------------------------------------------------------------------------------
> > >
> > ________________________________________________________
> > > To unsubscribe from this
> list, go to:
> > >
> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
> > >
> > >
> > >
> >
> ------------------------------------------------------------------------------
> > >
> > >
> > ________________________________________________________
> > > To unsubscribe from this list, go to:
> > >
> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
> > >
> > >
> > >
> > >
> >
> ------------------------------------------------------------------------
> > >
> > >
> >
> ------------------------------------------------------------------------
> > >
> > > To unsubscribe from this list, go
> >
> to:https://lists.sourceforge.net/lists/listinfo/misterhouse-users
> > >
> > >
> > > --
> > > Sent from my Android device with K-9
> Mail. Please
> > excuse
> > > my brevity.
> > >
> > >
> > >
> > >
> > >
> >
> ------------------------------------------------------------------------------
> > > ________________________________________________________
> > > To unsubscribe from this list, go to:
> > >
> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
> > >
> > >
> > >
> > > --
> > >
> > > Best regards,
> > > Steve Switzer
> > >
> > > ---
> > > Get world-class business I.T. services and a phone system
> with
> > awesome features that won't challenge your budget!
> > > http://www.sbsROC.com
> > >
> > >
> > >
> > > ________________________________________________________
> > > To unsubscribe from this list, go to:
> > https://lists.sourceforge.net/lists/listinfo/misterhouse-users
> > >
> >
> > --
> > Rick Steeves
> > https://www.irelandbybicycle.com
> >
> > It's all fun and games until someone ends up wearing a cone.
> >
> >
> > ________________________________________________________
> > To unsubscribe from this list, go to:
> > https://lists.sourceforge.net/lists/listinfo/misterhouse-users
> >
> >
> >
> > --
> >
> > Best regards,
> > Steve Switzer
> >
> > ---
> > Get world-class business I.T. services and a phone system with
> awesome features that won't challenge your budget!
> > http://www.sbsROC.com
> >
> >
> >
> > ________________________________________________________
> > To unsubscribe from this list, go to:
> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
> >
>
> --
> Rick Steeves
> https://www.irelandbybicycle.com
>
> It's all fun and games until someone ends up wearing a cone.
>
>
> ________________________________________________________
> To unsubscribe from this list, go to:
> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>
>
>
> --
> Best regards,
> Steve Switzer
>
> ---
> Get world-class business I.T. services and a phone system with awesome features that won't challenge your budget!
> http://www.sbsROC.com
>
> This body part will be downloaded on demand.
>
> This body part will be downloaded on demand.
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users