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

Mythweather errors
http://forum.linhes.org/viewtopic.php?f=17&t=14912
Page 1 of 5

Author:  mihanson [ Thu Apr 12, 2007 6:19 pm ]
Post subject:  Mythweather errors

For some inexplicable reason, my mythweather does not work from mythweb anymore. It was working fine yesterday, but today... nada. When I select mythweather from the icon in the upper center of the mythweb home page, I get the following errors printed at the top of the screen and my current conditions are "unknown" and forecast is blank. Interestingly, the radar map seems correct.

Quote:
Error at /usr/share/mythtv/mythweb/modules/weather/handler.php, line 96:
file() [function.file]: HTTP request failed! HTTP/1.1 404 NotFound

Error at /usr/share/mythtv/mythweb/modules/weather/handler.php, line 96:
file(http://www.msnbc.com/m/chnk/d/weather_d ... d=USCA0638) [function.file]: failed to open stream: Success

Error at /usr/share/mythtv/mythweb/modules/weather/handler.php, line 98:
Invalid argument supplied for foreach()


Anyone have any ideas? I have not changed anything, but I do not know if it works properly from the frontend as I'm not home. Looks like MSNBC changed their website. I thinkered with the handler.php file a little, but have yet to make any real headway.

Author:  thornsoft [ Thu Apr 12, 2007 6:25 pm ]
Post subject: 

Same here. I've been noticing some errors lately, with "no information" or some such for certain days. Then today, bomb.

Author:  slowtolearn [ Thu Apr 12, 2007 9:07 pm ]
Post subject: 

Ditto here. I hadn't used Mythweather in about a week, but just checked and have no data except the radar seems OK. I'm guessing mihanson is spot on with MSNBC changing their site.

Author:  simonflood [ Fri Apr 13, 2007 4:07 am ]
Post subject:  Re: Mythweather errors

mihanson wrote:
For some inexplicable reason, my mythweather does not work from mythweb anymore. It was working fine yesterday, but today... nada. When I select mythweather from the icon in the upper center of the mythweb home page, I get the following errors printed at the top of the screen and my current conditions are "unknown" and forecast is blank. Interestingly, the radar map seems correct.

..snip..
mihanson wrote:
Anyone have any ideas? I have not changed anything, but I do not know if it works properly from the frontend as I'm not home. Looks like MSNBC changed their website. I thinkered with the handler.php file a little, but have yet to make any real headway.

slowtolearn wrote:
Ditto here. I hadn't used Mythweather in about a week, but just checked and have no data except the radar seems OK. I'm guessing mihanson is spot on with MSNBC changing their site.

Looks like something has changed with MSNBC.com (again - Google threw up some references to problems last August). From MythTV's Installing and using MythTV: MythWeather page:
Quote:
MythWeather uses MSNBC.com as its source for weather data and weather.com for its radar image.

This would explain why radar images are available via both MythWeb and the Information Centre but current conditions, extended forecast, and tomorrow's outlook are not working.

Simon

Author:  tscholl [ Fri Apr 13, 2007 8:47 am ]
Post subject: 

Same thing here no data since Monday. And I though it was something that I did! Sounds like it's a provider problem.

Author:  simonflood [ Fri Apr 13, 2007 9:13 am ]
Post subject: 

tscholl wrote:
Sounds like it's a provider problem.


It looks like the URL that both MythWeb and MythWeather use http://www.msnbc.com/m/chnk/d/weather_d_src.asp?acid=UKXX0028 (replace UKXX0028 with your weather location ID) is broken (it's now giving a Page not found error).

You can find this URL by
Code:
# grep msnbc /usr/share/mythtv/mythweb/modules/weather/handler.php

Looking at the source for the MythWeather plugin (http://svn.mythtv.org/trac/browser/trunk/mythplugins/mythweather/mythweather/weather.cpp) the same MSNBC URL is hardcoded in there too (line 2382).

I've found a reference via Google to a different URL http://weather.msn.com/weatherdata.aspx?src=msn_wx&wealocations=wc:UKXX0028&culture=en-us (again change UKXX0028 to suit your location) but it doesn't appear to provide the same information - MythWeb/MythWeather look for the string this.swLastUp but this isn't present and I believe the information returned is different anyway.

Now whether it's permanently broken or not we can only hope it's the latter. I haven't found any reference to this recent problem on other lists though!

Simon

Edit: MSNBC URL is now producing an error rather than blank page

Author:  simonflood [ Fri Apr 13, 2007 1:46 pm ]
Post subject: 

simonflood wrote:
Now whether it's permanently broken or not we can only hope it's the latter. I haven't found any reference to this recent problem on other lists though!

It looks like this might be a permanent change by Microsoft since the URL now gives an error page.

However it seems that it might be possible to fake up a suitable web response as someone has done this in order to get better and more reliable weather information from Environment Canada for Canadian users.

See this archived posting to the mythtv-dev mailing list for details.

I'm thinking that we could use the same process to either pull the data from the new style MSNBC web site or perhaps switch to something else like The Weather Channel (weather.com) or BBC ... ?

In the longer term it looks like mythweather-revamp is the future except that it's currently US only. See also Weather sandbox on the MythTV Wiki.

Simon

Author:  mihanson [ Fri Apr 13, 2007 1:49 pm ]
Post subject: 

I just posted this issue on the mythtv-users mailing list. We'll see what comes of it.

Author:  mihanson [ Sat Apr 14, 2007 11:23 am ]
Post subject: 

Someone else already has a ticket in on this. See http://svn.mythtv.org/trac/ticket/3303

Author:  ianmidd [ Sat Apr 21, 2007 8:35 am ]
Post subject: 

Ticket 3303 was initially opened for an issue with weather in MythWeb.

A new ticket has been created with a the patches attached.

You can find it here:

http://svn.mythtv.org/trac/ticket/3327

Author:  ianmidd [ Sat Apr 21, 2007 8:41 am ]
Post subject: 

I'm using R5D1 and I just tried installing the patch withouth success.

I don't really know the ins and outs of knoppmyth yet, but it looks like the patch is looking for /mythplugins-orig/mythweather/mythweather/Makefile

Does KM include the source for the Myth plugins?

Author:  auttila [ Sun Apr 22, 2007 11:25 pm ]
Post subject: 

Since my only experience in Linux in KnoppMyth, I'm a wee bit lost applying this patch. Could someone please post detailed instructions for me (and propably many more) noob's on how to get this working?

Author:  simonflood [ Mon Apr 23, 2007 3:23 am ]
Post subject:  How to fix MythWeb's weather module (R5E50) for weather.com

auttila wrote:
Could someone please post detailed instructions for me (and propably many more) noob's on how to get this working?


Since I've been providing some input with SVN ticket 3303 I guess I'm in as good a position as anyone to help out.

Here's are the steps that I followed to fix MythWeb's weather module in KnoppMyth R5E50 so that it works with weather.com. Since KM doesn't come with the latest code I pull some updated PHP scripts (there are others, not sure if they're required).
Code:
# cd /usr/share/mythtv/mythweb/modules/weather/
# mv handler.php handler.php.orig
# wget http://svn.mythtv.org/trac/export/13313/trunk/mythplugins/mythweb/modules/weather/handler.php
# mkdir -p includes/objects
# cd includes/objects
# wget http://svn.mythtv.org/trac/export/13313/trunk/mythplugins/mythweb/modules/weather/includes/objects/Forecast.php
# wget http://svn.mythtv.org/trac/export/13313/trunk/mythplugins/mythweb/modules/weather/includes/objects/WeatherSite.php
# cd /usr/share/mythtv/mythweb/modules/weather/tmpl/default/
# mv weather.php weather.php.orig
# wget http://svn.mythtv.org/trac/export/13313/trunk/mythplugins/mythweb/modules/weather/tmpl/default/weather.php
# cd /usr/share/mythtv/mythweb/modules/
# wget http://svn.mythtv.org/trac/raw-attachment/ticket/3303/weather.3.patch
# patch -p1 < weather.3.patch
# cd /tmp/
# wget http://svn.mythtv.org/trac/raw-attachment/ticket/3303/icons1.zip
# wget http://svn.mythtv.org/trac/raw-attachment/ticket/3303/icons2.zip
# wget http://svn.mythtv.org/trac/raw-attachment/ticket/3303/icons3.zip
# wget http://svn.mythtv.org/trac/raw-attachment/ticket/3303/icons4.zip
# unzip icons\?.zip -d /usr/share/mythtv/mythweb/skins/default/img/weather/
# unzip icons\?.zip -d /usr/share/mythtv/mythweb/skins/grey/img/weather/

Note that the end result is not perfect but at least it works. Things that could/should be improved are the retrieval of data from weather.com (it doesn't quite conform to their directions - no data is cached) and layout of the web pages themselves (logo placement).

I haven't yet taken a look at fixing MythWeather itself but will do so. If I get it working and no-one else has posted a HowTo I'll then do so.

HTH

Simon

Author:  simonflood [ Mon Apr 23, 2007 4:41 am ]
Post subject:  How to fix MythWeather module (R5E50) for weather.com

simonflood wrote:
I haven't yet taken a look at fixing MythWeather itself but will do so. If I get it working and no-one else has posted a HowTo I'll then do so.


Guess I'm the first to work this through!?

OK here's how to fix MythWeather itself (again KnoppMyth RE50) so that it works with weather.com.

Download latest version of MythWeather
Code:
# cd /tmp/
# mkdir mythweather
# cd mythweather
# wget http://svn.mythtv.org/trac/export/13313/trunk/mythplugins/mythweather/mythweather/main.cpp
# wget http://svn.mythtv.org/trac/export/13313/trunk/mythplugins/mythweather/mythweather/mythweather.pro
# wget http://svn.mythtv.org/trac/export/13313/trunk/mythplugins/mythweather/mythweather/weather.cpp
# wget http://svn.mythtv.org/trac/export/13313/trunk/mythplugins/mythweather/mythweather/weather.h

Auto-create the Makefile
Code:
# qmake

Download patch file & images from SVN ticket 3327
Code:
# wget http://svn.mythtv.org/trac/raw-attachment/ticket/3327/mythweather3.patch
# wget http://svn.mythtv.org/trac/raw-attachment/ticket/3327/icons1.zip
# wget http://svn.mythtv.org/trac/raw-attachment/ticket/3327/icons2.zip
# wget http://svn.mythtv.org/trac/raw-attachment/ticket/3327/icons3.zip
# wget http://svn.mythtv.org/trac/raw-attachment/ticket/3327/icons4.zip

Apply patch - you'll get 2 errors (Hunk #1 FAILED at 187, Hunk #2 FAILED at 260, 2 out of 2 hunks FAILED ...) which can be safely ignored (they relate to copying some images which we'll do by hand)
Code:
# patch < mythweather3.patch

Create & install new MythWeather module
Code:
# make
# cp libmythweather.so /usr/lib/mythtv/plugins/

Copy required images
Code:
# unzip icons\?.zip -d /usr/share/mythtv/themes/default

Reboot to bring new MythWeather module into play - instead of rebooting there may another of way of using the new version but it works for me!
Code:
# reboot

If you hadn't already been using a later version of the MythWeather plugin (from SVN) you'll find that you've now got a few more screens of weather info.

HTH

Simon

Edited to reflect availability of mythweather2.patch that removes need to edit patch file (though will still get errors but they can be ignored)
Further edited to reflect availability of mythweather3.patch to fix wind speed in forecast (Thanks Kirk!)

Author:  auttila [ Mon Apr 23, 2007 5:43 am ]
Post subject: 

Simon, thanks a million - the solution worked perfectly!

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