[mythtv-users] MythWeather-Revamp: Is it even partially working?
Douglas Wagner
douglasw0 at gmail.com
Sun May 20 21:56:38 UTC 2007
On 5/20/07, Douglas Wagner <douglasw0 at gmail.com> wrote:
>
>
>
> On 5/20/07, Rich West <Rich.West at wesmo.com> wrote:
> >
> > Douglas Wagner wrote:
> > >
> > >
> > > On 5/20/07, * Douglas Wagner* <douglasw0 at gmail.com
> > > <mailto:douglasw0 at gmail.com>> wrote:
> > >
> > > OK, so I have quite a bit more information now than I did about 20
> > > minutes ago.
> > >
> > > First the problem with all the scripts failing to load into the
> > > active area was due to the fact that the @INC array in perl (I
> > > sound like I know what i'm talking about, I don't) didn't include
> > > /usr/share/mythtv/mythweather/scripts and thus none of the
> > > "special" files..the .pm files, could be found by any of the
> > > scripts...the only one that either worked out of the box or didn't
> > > need any .pm file was the Severe weather forcast, which is why
> > > that worked.
> > >
> > > To fix, I went into each of the scripts and added:
> > >
> > > use lib "/usr/share/mythtv/mythweather/scripts";
> > >
> > > Following this entering mythfrontend and going back into the
> > > sources setup worked perfectly...all the scripts were able to be
> > > added to the "Active" area.
> > >
> > > From there I obtained the information below on each scripts
> > > execution parameters.
> > >
> > > The problem right now is that MythTV simply will not store any
> > > information in the locations required by the application. Once
> > > everything is setup I can see in the frontend log where it tries
> > > to run every PL script, and when those PL scripts are run from the
> >
> > > command line I can see every one of them return something proper
> > > (tho one of them only returns to std out, it does not write to the
> > > directories you specify) not a single one of them puts data into a
> >
> > > file in the .mythtv/mythweather area when run through Myth.
> > >
> > > I'm half tempted right now to setup cron jobs for those PL scripts
> > > I know produce data. For the ones that don't write files (say the
> >
> > > 3 day/6 day forecast script) how do I know what file name MythTV
> > > is looking for? I could pipe out the information returned by the
> > > script to the proper file if I know what the file names are.
> > >
> > > Speaking of cron jobs: does mythtv periodically re-run the weather
> > > data for the revamp code?
> > >
> > > --Douglas Wagner
> > >
> > > Below is information on execution of each PL script (Western
> > > Suburb of St. Louis is where this data points to specifically)
> > >
> > > nwsxml.pl - Current Conditions - **Does not Write to the proper
> > > file.**
> > > ----------------------
> > > /usr/share/mythtv/mythweather/scripts/nwsxml.pl -u ENG -d
> > > /home/mythtv/.mythtv/MythWeather/NWS-XML KSUS
> > >
> > > nws-alert.pl - Severe Weather Alerts - Properly Writes to File
> > > from Command Line Execution
> > > ----------------------
> > > /usr/share/mythtv/mythweather/scripts/nws- alert.pl -u ENG -d
> > > /home/mythtv/.mythtv/MythWeather/NWS-Alerts 29183
> > >
> > > maps.pl - Static Maps - Properly Writes to File from Command Line
> > > Execution
> > > ----------------------
> > > /usr/share/mythtv/mythweather/scripts/maps.pl -u ENG -d
> > > /home/mythtv/.mythtv/MythWeather/Map-Download
> > > http://image.weather.com/images/maps/current/cur_mw_720x486.jpg
> > > <http://image.weather.com/images/maps/current/cur_mw_720x486.jpg>
> > >
> > > ndfd18.pl - 18 Hour Forecast - Properly Writes to File from
> > > Command Line Execution
> > > -----------------------
> > > /usr/share/mythtv/mythweather/scripts/ndfd18.pl -u ENG -d
> > > /home/mythtv/.mythtv/MythWeather/NDFD-18_Hour +38.39,- 090.39
> > >
> > > animaps.pl - Animated Maps - Properly Writes to File from Command
> > > Line Execution
> > > -----------------------
> > > /usr/share/mythtv/mythweather/scripts/animaps.pl -u ENG -d
> > > /home/mythtv/.mythtv/MythWeather/Animated-Map-Download
> > > http://images.weather.com/looper/archive/us_mw_4regradar_plus_us
> > >
> > > ndfd.pl - 3 Day and 6 Day Forecast - Properly Writes to File from
> > > Command Line Execution
> > > -----------------------
> > > /usr/share/mythtv/mythweather/scripts/ndfd.pl -u ENG -d
> > > /home/mythtv/.mythtv/MythWeather/NDFD-6_day +38.39,-090.39
> > >
> > >
> > >
> > >
> > > On 5/19/07, *Robin Gilks* < g8ecj at gilks.org
> > > <mailto:g8ecj at gilks.org>> wrote:
> > >
> > >
> > > > Ok, so I tried my hand at getting mythweather-revamp
> > working.
> > > >
> > > > If you want to see HOW I got what I got read the here's what
> > > I did below.
> > > >
> > > > I've run into several problems. First all but one of the
> > > defined
> > > > plugins/scripts in the setup area currently return "the
> > > plugin doesn't
> > > > provide the needed data" or something like that and won't
> > > install in the
> > > > active plugins area (the only one that does is NWS-Alerts).
> > > >
> > > > NWS-Alerts does in fact install but when it's run by mythtv
> > > it doesn't
> > > > generate it's output into the .mythtv/MythWeather/NWS-Alerts
> > > > directory...nothing appears in there. If you manually run
> > > > NWS-Alerts.plfrom the scripts directory with the output line
> > that
> > > > MythTV seems to want to
> > > > run that WILL create the output file (you have to be outside
> > > of myth and
> > > > execute it from the command line, myth itself (tho it runs a
> > > valid
> > > > command)
> > > > will not generate the output correctly, only if it's run
> > from
> > > the command
> > > > line).
> > > >
> > > > If however you do generate the output file, mythweather will
> > > efffectively
> > > > display it, if you don't mythweather turns up completely
> > blank.
> > > >
> > > > Also: does anyone have documentation on what the command
> > > lines should look
> > > > like for each of the scripts? Since I can't get them to run
> > > properly
> > > > through myth (and most of the scripts are being beaten down
> > > my myth when
> > > > trying to be moved to the active area) it would be nice to
> > > have some
> > > > documentation on what each one is looking for so we could
> > try
> > > running them
> > > > from the local command line.
> > > >
> > > > --Douglas Wagner
> > >
> > > For documentation on the command line for the scripts, check
> > > the README
> > > file in the scripts directory.
> > >
> > > Note that the maps and animated maps scripts do NOT take a
> > > city name as
> > > the other scripts do (doh!!). I played about with all sorts of
> > > names (with
> > > a few grep's thrown in) and found that for here (New Zealand)
> > > I had to
> > > enter the country name.
> > >
> > > The *ONLY* files that should be executable in the scripts
> > > directory are
> > > those that mythweather is going to scan - make sure any files
> > > are not
> > > executable. My executable files are:
> > > animaps.pl
> > > maps.pl
> > > ndfd.pl
> > > ndfd18.pl
> > > nws-alert.pl
> > > nwsxml.pl
> > > weathercomXML.2.pl <http://weathercomXML.2.pl>
> > > The ones starting with a 'n' seem to be USA specific.
> > >
> > > Try the script from Simon Flood on svn ticket #3337 - I'm
> > > using v0.2 but I
> > > see there is an update (not tried it yet!).
> > >
> > > I've found that my frontend box wasn't doing a DNS lookup
> > > correctly (adsl
> > > modem dns proxy got lost again) which caused a blank screen -
> > > guess I'll
> > > have to adjust the timeouts in the setup or remember to reset
> > > the modem
> > > more often.
> > >
> > > --
> > > Robin Gilks
> > >
> > > Ok, that would make some sense I guess. I am getting "current
> > > conditions" even though current conditions doesn't write anything
> > > out. However if I don't forceably cache stuff to disk with cron like
> > > i'm doing, myth crashes out with a floating point error or a devide by
> > > zero error or something of that nature...so for the moment myth
> > > weather on my system seems to work with a cron job pulling the data
> > > every hour.
> > >
> > > So basically, everything right now is working except 3 day and 6 day
> > > forecast. The job returns data and it gets written to the cached
> > > area, and it looks like good data, so I know the job is working. In
> > > MythWeather, The alerts come up (first page i've set), then the
> > > current conditions come up (Second page I've set), but current
> > > conditions sits there for quite some time (The 3day and 6day are the
> > > next 2 pages and do not come up), then the static weather map comes up
> > > (the 5th page) then finally the animated map as the last page...so
> > > it's like it's trying to process the 3 and 6 day forecast, but simply
> > > can't.
> > >
> > > Are there any debug options I can set to get better information on why
> > > Myth is unable to parse or display the 3 / 6 day forecast?
> >
> > For one, before folks start really complaining, please don't top-post.
> > (See:
> > http://www.mythtv.org/wiki/index.php/Mailing_List_etiquette#Bottom_post
> > as to why).
> >
> > Anyhow, the only way to debug mythweather-revamp, or any plugin for that
> > matter, is to run mythfrontend -v all and observe the output. I've
> > found it best to run:
> > mythfrontend -v all > /tmp/mythfrontend.log 2>&1
> > When I need to see what is going on. Don't run it this way all of the
> > time.. you'll fill up /tmp. :)
> >
> > If you want to run each of the NWS scripts, you need to know your
> > station_id (as found in NWS-Stations.xml ) and provide that on the
> > command line.
> >
> > For example, if you are located in Alaska near Kake Airport (I'm just
> > pulling the first entry from the file), your station_id would be PAFE.
> > Using that station_id, you can now run the scripts:
> > ./ndfd.pl -u ENG PAFE
> > ./ndfd18.pl -u ENG PAFE
> > ./animaps.pl -u ENG PAFE
> >
> > Or, if you use the weathercomXML.pl script that I have been using (which
> > someone submitted a while back as a patch), you don't have to worry
> > about the station_id stuff from the NWS:
> > ./weathercomXML.pl -u ENG <zip code or city, state or ACCID code>
> > The ACCID code is the entry found in the "accid.dat" file that came with
> > the old mythweather.
> >
> > -Rich
> >
> >
> > _______________________________________________
> > mythtv-users mailing list
> > mythtv-users at mythtv.org
> > http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
> >
>
> Apologies for the top posting, I use Google Mail and since it thread
> tracks all the incomming messages, it actually makes more sense for google
> mail users to top post than bottom post...never even occured to me the
> problem with that. I'll be more careful in the future. :)
>
> The weather.com script I can't seem to get recognized through Myth.
>
> Well, to be exact, myth says it recognizes/found the script. It's not
> complaining about any problems in the running of them, but I never see an
> execution line for the weathercomXML.pl script either.
>
> When run from the command line it returns data, but I can't seem to get
> myth to actually use anything it returns. I also can't understand how the
> return data from the weathercomXML.pl script actually gets populated into
> the weather-ui.xml mapping...I get that the other weather scripts are
> working because myth is reading the cache files from disk, and I understand
> that it's SUPPOSED to be taking the print to STD Out and working with it,
> but as I state above and below, I don't think my install is handling the
> streamed data. This is probably something very basic with my installation.
> As I state above, i'm having to use a cron job to execute the various
> scripts to get myth weather data down into the archive files so that
> mythweather will even read anything.
>
> An example of the problem: Lets say I add a new animated map. Go into the
> new settings add a map, set the location, exit settings and save, go to
> mythweather and all of myth dies on me with a Floating Point Exception. If
> I check the cache on disk the map doesn't exist. However, if I find in
> myth's output the attempt to execute the map retrieval, and yes it has both
> executed the retrieval of the new map and says it finished, and run that PL
> script again from the command line, viola, everything is fine in mythweather
> and the map comes up.
>
> As I said there's something very basically wrong in my installation
> somewhere i'm guessing since I assume you and everyone else running
> mythweather-revamp are getting your data filled in without having to setup
> cron jobs.
>
> I also assume your 3/6 day forcast data is being properly
> displayed...which mine simply is not...the page for 18 hour, 3 day and 6 day
> won't even come up (not that it comes up blank or errors, the system hangs
> on the prior pages and then displays the next page after the 18/3/6 pages).
>
> So, i'll take your advice and run frontend through verbose logging and see
> what I come up with. More later.
>
> --Douglas Wagner
>
So to put this "on hold" for now. I ended up hacking into the code and, if
I did my printing right (i'm no C expert anymore), found that for some of
the scripts on my system "stdout" doesn't look like it contains any data for
most of the scripts (NWS-Alerts and NWSXML do consistantly produce data to
stdout that MythTV gets ahold of, the rest of the scripts do not).
*shrug* I'm mostly at a loss here now as to where to go next. There are no
problems with the -v output from mythfrontend, no errors being returned, and
I don't understand the process well enough it doesn't look like to know
where the problem may be. I do not see any of the information being
produced by the scripts making it into the database, however I assume this
is because the data isn't actually stored in the database it's processed
from stdout straight to the screen (not sure if this makes sense or not).
--Douglas Wagner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20070520/5bcc8220/attachment.htm
More information about the mythtv-users
mailing list