[mythtv-users] MythWeather-Revamp: Is it even partially working?

Rich West Rich.West at wesmo.com
Sun May 20 15:59:53 UTC 2007


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




More information about the mythtv-users mailing list