Now that you have the plug-in installed, it's best to check for the permissions on the grabber script files. This will help avoid nasty debugging in the future. Each grabber script needs to be executable by the user that <code>mythfrontend</code> runs under. To be safe, you can just set the permissions to <code>0755</code> for all of the <code>*.pl</code> files:

+

Now that you have the plug-in installed, it's best to check for the permissions on the grabber script files. This will help avoid nasty debugging in the future. Each grabber script needs to be executable by the user that <code>[[mythfrontend]]</code> runs under. To be safe, you can just set the permissions to <code>0755</code> for all of the <code>*.pl</code> files:

# chmod -v 0755 /usr/share/mythtv/mythweather/scripts/*/*.pl

# chmod -v 0755 /usr/share/mythtv/mythweather/scripts/*/*.pl

Line 59:

Line 59:

====PERL in Taint Mode====

====PERL in Taint Mode====

−

If you have your <code>mythfrontend</code> configured to run as root, whenever it executes a PERL script (i.e. to update the weather information), PERL will run in [http://perldoc.perl.org/perlsec.html#Taint-mode-and-%40INC Taint Mode]. This causes problems for the grabber scripts, because Taint Mode removes '.' (the current directory) from the <code>@INC</code> array in PERL. For more info, see {{Ticket|4954}}.

+

If you have your <code>[[mythfrontend]]</code> configured to run as root, whenever it executes a PERL script (i.e. to update the weather information), PERL will run in [http://perldoc.perl.org/perlsec.html#Taint-mode-and-%40INC Taint Mode]. This causes problems for the grabber scripts, because Taint Mode removes '.' (the current directory) from the <code>@INC</code> array in PERL. For more info, see {{Ticket|4954}}.

To get around this, you'll need to modify your grabber scripts slightly. Edit the first line of the script to read:

To get around this, you'll need to modify your grabber scripts slightly. Edit the first line of the script to read:

Line 80:

Line 80:

#*If you happen to move between pages manually (using the left and right arrows) this kicks in. A manual page change will be displayed by this many seconds before resuming the regular rotation

#*If you happen to move between pages manually (using the left and right arrows) this kicks in. A manual page change will be displayed by this many seconds before resuming the regular rotation

#'''Retrieve data in the background'''

#'''Retrieve data in the background'''

−

#*If this is enabled, [[MythFrontend]] will automatically download new weather data in the background. This improves the startup time of MythWeather drastically, since it no longer will wait for the initial data retrieval. The grabber scripts run with <code>nice</code>, so you shouldn't notice anything while watching TV.

+

#*If this is enabled, [[mythfrontend]] will automatically download new weather data in the background. This improves the startup time of MythWeather drastically, since it no longer will wait for the initial data retrieval. The grabber scripts run with <code>nice</code>, so you shouldn't notice anything while watching TV.

#'''Skip pages still waiting for data (Not Implemented)'''

#'''Skip pages still waiting for data (Not Implemented)'''

#*As the page itself indicates, this feature isn't done yet. However, when it is, the plugin will not display pages that have no data.

#*As the page itself indicates, this feature isn't done yet. However, when it is, the plugin will not display pages that have no data.

*This script downloads XML RSS feeds from Environment Canada's Weather Office site. Location searches are powered by the <code>ENVCAN-Stations.xml</code> file, which contains a list of all defined Canadian sites. When searching, simply look for the city or town that you're closest to.

*This script downloads XML RSS feeds from Environment Canada's Weather Office site. Location searches are powered by the <code>ENVCAN-Stations.xml</code> file, which contains a list of all defined Canadian sites. When searching, simply look for the city or town that you're closest to.

*This script downloads animated map images from Environment Canada's Satellite Imagery service. The locations are all named after the regions the images cover. So, search for stuff like 'Western' or 'Eastern' to get the best results. If in doubt, take a look at the <code>ENVCAN-Maps.xml</code> file... it defines all of the animated maps.

*This script downloads animated map images from Environment Canada's Satellite Imagery service. The locations are all named after the regions the images cover. So, search for stuff like 'Western' or 'Eastern' to get the best results. If in doubt, take a look at the <code>ENVCAN-Maps.xml</code> file... it defines all of the animated maps.

+

+

===Australia===

+

You can use the weather.com settings or BOM for Australia. weather.com is the default.

Installing MythWeather

MythWeather is part of the standard set of MythTV plugins. For most users who have installed a pre-packaged binary copy of MythTV, the work of installing MythWeather is already done. If you aren't compiling it from source, skip to the Configuration section. Otherwise, read on...

Requirements

For those users who are compiling their copy of MythTV and the plugins, there are a few dependencies to worry about. The plugin itself does not depend on any external libraries (other than those common to all MythTV plugins). However, MythWeather uses external grabber script files that actually download the weather data it displays. These grabbers live in the <prefix>/share/mythtv/mythweather/scripts directory by default.

Currently, all of the grabbers are written in PERL. Their combined dependencies include:

If you would like to test for the required modules before trying to install MythWeather, below is a quick way to do so. This is the same method used by the ./configure script. If the command runs successfully with no output, all necessary modules are installed.

cat << EOF | perl
use Carp;
use Data::Dumper;
use Date::Manip;
use Exporter;
use File::Basename;
use Getopt::Std;
use Image::Size;
use LWP::Simple;
use SOAP::Lite;
use XML::Parser;
use XML::SAX::Base;
use XML::Simple;
EOF

If you need help installing PERL modules, check out the FAQ over at CPAN.

Compiling MythWeather

To compile MythWeather from source, grab a copy of the source code from the MythTV downloads page or check out a fresh copy of the plugins from SVN. If you're compiling the plugin yourself, I assume you are somewhat familiar with the process and won't explain the gory details of how to get your source tree set up. For those, check out the HOWTO, specifically the Plugins chapter.

Once you have your source tree all ready to go, do something similar to the following:

This will build the MythWeather plugin and install it using the default prefix (usually /usr/local).

Script Permissions

Now that you have the plug-in installed, it's best to check for the permissions on the grabber script files. This will help avoid nasty debugging in the future. Each grabber script needs to be executable by the user that mythfrontend runs under. To be safe, you can just set the permissions to 0755 for all of the *.pl files:

# chmod -v 0755 /usr/share/mythtv/mythweather/scripts/*/*.pl

Note:You may need to execute the command as root

PERL in Taint Mode

If you have your mythfrontend configured to run as root, whenever it executes a PERL script (i.e. to update the weather information), PERL will run in Taint Mode. This causes problems for the grabber scripts, because Taint Mode removes '.' (the current directory) from the @INC array in PERL. For more info, see #4954.

To get around this, you'll need to modify your grabber scripts slightly. Edit the first line of the script to read:

#! /usr/bin/perl -w -I./.

This should get your grabbers working again.

Configuration

Main Weather Settings screen

All configuration of MythWeather is done through the frontend. For global configuration of the plugin, go to the Utilities/Setup→Setup→Info Center Settings→Weather Settings page.

Global Settings

Global settings page

There are four options to configure on this page:

Seconds to display each page

Defines how long each page will be displayed before moving onto the next

Seconds to display each page after manual page change

If you happen to move between pages manually (using the left and right arrows) this kicks in. A manual page change will be displayed by this many seconds before resuming the regular rotation

Retrieve data in the background

If this is enabled, mythfrontend will automatically download new weather data in the background. This improves the startup time of MythWeather drastically, since it no longer will wait for the initial data retrieval. The grabber scripts run with nice, so you shouldn't notice anything while watching TV.

Skip pages still waiting for data (Not Implemented)

As the page itself indicates, this feature isn't done yet. However, when it is, the plugin will not display pages that have no data.

Screen Settings

The Screen Settings page allows you to define all of the screens that you want displayed while the plugin is running. You can mix and match screens to your heart's delight. Refer to these screen shots while reading on:

List of Inactive Screens. You can add these to the Active Screens by selecting them.

List of Active Screens. You can modify their properties by selecting them.

List of actions you can perform on this Active Screen.

Search results when changing the location.

Change the type of units used to display the weather information.

Screens

The page allows you to choose from a list of Inactive Screens. By selecting one of these items in the list, it will be copied into the Active Screens list.

There are currently seven different types of screens available:

Current Conditions

This screen displays the most recent observations of weather.

18 Hour Forecast

Displays a weather forecast of conditions and temperature for the next eighteen hours.

Three Day Forecast

Displays a weather forecast of conditions and temperature for the next three days.

Six Day Forecast

Displays a weather forecast of conditions and temperature for the next six days.

Static Map

Displays a static map image for the configured location.

Animated Map

Displays an animated map (radar, satellite imagery, etc.)

Severe Weather Alerts

Displays text warnings about severe weather in the configured location.

Actions

Once in the Active Screens list, you can modify the properties of the screen by selecting it. Some screens have more actions than others, depending on what they do. For example, the Animated Maps screen doesn't use Units, so you don't have an option to change them.

The actions you can perform on Active Screens include:

Change Location

Allows you to change the location for the selected screen. Selecting this action will prompt you to search for a new location. You can enter text into the search field with your keyboard, or using the pop-up keyboard and your remote control. Searching can usually be done with regular expressions as well.

Change Units

Allows you to toggle between SI and English units. (SI is metric, English is... well, English).

Move Up

Moves the selected screen up one position in the Active Screens list.

Move Down

Moves the selected screen down one position in the Active Screens list.

Remove

Deletes the selected screen from the Active Screens list.

Cancel

Returns you to Screen Setup.

Saving Your Changes

Don't forget to click on the Finish button on the Screen Setup page when you're done! This will save all of your screen definitions and return you to the main Weather Settings page.

Source Settings

Change settings for each configured weather source

This screen allows you to customize the settings for each weather source you have defined. The Source Setup screen will only display the sources that you are using for your configured Active Screens.

For each of theses sources, you can configure two options:

Source Update Timeout (seconds)

Defines how long the plugin will wait for this source to provide data (in seconds)

Data Retrieval Interval (minutes)

Defines how long the plugin will wait between subsequent data downloads (in minutes)

The Source Setup screen is also nice enough to provide you the credits of who wrote your configured weather source grabber and it's current version.

Note:Some grabbers will locally cache their downloaded data to limit the effect on the servers they use as a source.

Using MythWeather

Once configured, using MythWeather requires little brain-power. When the plugin is started it will begin cycling through the screens. If you wish to pause on a screen press PAUSE (p). If you wish to manually move between pages, use the left and right arrows. If you wish to manually initiate an update, press 'u'. Thats about it, to exit press EXIT (escape).

Here are some screen shots of the different screens in action:

Current Conditions screen (yes, it was very cold that day)

Three Day Forecast screen

Six Day Forecast screen

Animated Map screen (it really is animated, really!)

Sources

Sources are external programs which retrieve weather data. They can be found in the scripts/ directory of the MythWeather source tree, when installed they are in <prefix>/share/mythtv/mythweather/scripts/ where prefix is usually /usr. If you are interested in how the sources interact with the plugin there is a README in the scripts/ directory. Below is a list of sources currently included with MythWeather. If you write a source feel free to provide a link to it here.

World

These sources cover the globe. If you can't find a local provider of weather data, use these instead.

Accuweather

Accu weather has for almost any major city in the world detailed weather forecast. This script reads the accuweather forecast data for Current Conditions and Three and Six Day Forecasts.

United States

These sources are all for locations in the United States.

"Animated maps and most (if not all) of the static ones aren't listed by zip/city. Leave the search box blank and search for everything. You'll get a list of stuff by region of the US. Pick your region of the US from the search results. Took me a while to figure that one out. :)" via Brad DerManouelian

National Weather Service Current Observations XML Feeds

This script uses XML feeds provided by the National Weather Service for current observations. The NWS-Stations.xml file describes the locations supported by this script. You can also browse the above link to see avaiable locations. Locations can be searched for by their station id, station name, or state abbreviation. Searches are done using the search string as a perl regular expression. NWS updates their observations hourly

National Digital Forecast Database XML/SOAP Service

Accesses the National Weather Services XML/SOAP forecast information to give data up to 6 days in advance. It uses the same NWS-Stations.xml file and location search mechanism as the current observations script, however, since NDFD works on lat/lon

This scripts retrieves severe weather alerts from the National Weather Service. Locations are codes retrieved from bp16mr06.dbx. For an explanation of this file see http://www.nws.noaa.gov/geodata/catalog/wsom/html/cntyzone.htm. It uses this same file to do its location searches, simply checking if each line matches the search string passed to it.

Weather.com's Map Room (both static and animated images)

This script downloads and static and animated maps from weather.com. weathercommaps.pl was used to crawl weather.com's map room and generate the maps.xml file, which is then used for the static map source (maps.pl) and the animated map source (animaps.pl). Location searches look at the map name, so you'll probably want to search for things like "radar", "doppler", "northeast", etc... Maps from other sites can be added easily, just follow the format in maps.xml.

Canada

These sources are for locations in Canada.

Environment Canada's Weather Office

This script downloads XML RSS feeds from Environment Canada's Weather Office site. Location searches are powered by the ENVCAN-Stations.xml file, which contains a list of all defined Canadian sites. When searching, simply look for the city or town that you're closest to.

Environment Canada's Satellite Imagery

This script downloads animated map images from Environment Canada's Satellite Imagery service. The locations are all named after the regions the images cover. So, search for stuff like 'Western' or 'Eastern' to get the best results. If in doubt, take a look at the ENVCAN-Maps.xml file... it defines all of the animated maps.

Australia

You can use the weather.com settings or BOM for Australia. weather.com is the default.

BOM

It works for a three day listing but I cannot get the animated maps working yet.

More Questions

If there is a problem with this page, feel free to fix it. Questions about using MythWeather should be directed to the mythtv-users mailing list or #mythtv-users on freenode. Issues or bugs with the code should be directed to the mythtv-dev mailing list or #mythtv channel.