Topic: My widget only runs correctly when I start it manually via SSH

I've been developing an "Aussie Weather" widget for my chumby classic.  It uses the XMLConnector class to import an RSS feed with the current weather and forecast information.  I've coded it in ActionScript v2 and published it for Flash Player v8.

It works fine in my Flash IDE, but it won't run properly on the chumby when I load it onto a channel.  After I SSH in to determine the problem, it still won't run properly when I load it via "chumbyflashplayer.x -i http://widgets.chumby.com/xml/movies/...".

The problem is that I get the following error around the time when the XMLConnector instance attempts to retrieve the RSS weather data: 2011-11-24 10:25:01 HTTPCurlObject::Done(id=2) returning true due to error condition, response code=404.

I then used 'wget' to download the SWF file, which I ran from "/tmp/" on the chumby.  The widget worked properly, meaning that the weather data was imported from the RSS feed.  Why won't it do this when I load it onto a channel normally?

Re: My widget only runs correctly when I start it manually via SSH

It sounds like it might be a crossdomain issue.

When a widget is run manually from the device, it is treated as "local trusted" and can therefore reach any URL.  When it comes from the server, it's treated as "network untrusted" from the chumby.com domain, and therefore any web service is access needs to have a "crossdomain.xml" file that grants with widget permission to access the service.

This is not a chumby-specific issue - it's true of all Flash movies hosting on the network, like those embedded in web pages.

If you have access to the server hosting the feed, you should add the file "/crossdomain.xml" with the contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-access-from domain="*"/>
</cross-domain-policy>

This will grant any Flash movie on any domain the ability to fetch the feed.

If you don't have access to the server, you may be able to use some other service that has a compatible crossdomain.xml file (such as Yahoo Pipes) to proxy the feed for you.

Re: My widget only runs correctly when I start it manually via SSH

Thanks for the prompt and informative reply.  I did like the idea of using another service to proxy the feed for me.  The drawback is that other people - who live in different cities - would also need to proxy their feeds.

For this and other reasons, I've modified my application to use another weather provider.  I've tested it on my chumby classic and it works as expected.  I'll release it for the public once I've spent more time refining it.