Topic: Widget displaying local data

I have a widget that displays data computed from locally attached sensors and stored in an XML file in the file system.

Logically, the widget could be loaded locally, since other file system additions are needed.

Could there be a version of /mnt/usb/profile.xml that merged from the writable /psp file system instead? I need the USB port for the sensor. I am using a hub for debugging.

It would be nice to grant a local widget (loaded from /mnt/usb or my proposed /psp addition) access to sys:// directly without recourse to PrivilegedCallExceptions 65535. Like another flag that says, allow local widgets the same privileges as the master, but continue to restrict foreign widgets.

Without that, I am forced to go with a CGI script that outputs the data XML file.

Furthermore, because of the bug there widgets in a local profile.xml show up as "" until you explicitly reload the channel, I have moved to running the widget from chumby.com.

Which means I need a local crossdomain.xml. I understand why the system does not ship with one. But how about a compromise where the read-only /www has a symlink to /psp/crossdomain.xml, which isn't there by default?

As a workaround, I have a userhook1 which binds over a writable /www (which has that symlink, now pointing to a permissive file).

All of which only works some of the time; I am not clear why.
If I see
  NetStreamRequest::Open(1): Opening protocol 'http://' host 'localhost' port 80 location '/crossdomain.xml'
then there follows
  NetStreamRequest::Open(1) opened http object id 24
  NetStreamRequest::ProcessHeaders(1) content-type: application/octet-stream
  player/core/splayer.cpp:22783 DBG no action context pevent=002fbd70 [param=f001:1:0]
  player/core/splayer.cpp:22783 DBG no action context pevent=002fbda8 [param=f002:1:0]
  player/core/splayer.cpp:22783 DBG no action context pevent=002fbe10 [param=f003:1:217]
  NetStreamRequest::Step(1) done, closing stream (217 of 217 bytes, avail=0) status=0 (ok)
  player/core/splayer.cpp:22783 DBG no action context pevent=002fbe10 [param=f006:1:0]
and XML.onLoad is passed false.
Alternatively, if I instead see
  NetStreamRequest::Open(1): Opening protocol 'http://' host 'localhost' port 80 location '/cgi-bin/custom/...'
right aware after XML.load, with no indication of a cross-domain check, then there follows
  NetStreamRequest::Open(1) opened http object id 14
  NetStreamRequest::ProcessHeaders(1) content-type: text/xml
  player/core/splayer.cpp:22783 DBG no action context pevent=40b4c6c0 [param=f001:1:0]
  player/core/splayer.cpp:22783 DBG no action context pevent=40b79ba8 [param=f002:1:0]
  player/core/splayer.cpp:22783 DBG no action context pevent=40b4c5b0 [param=f003:1:738]
  NetStreamRequest::Step(1) done, closing stream (738 of 0 bytes, avail=0) status=200 (ok)
  player/core/splayer.cpp:22783 DBG no action context pevent=40b4c5b0 [param=f006:1:0]
and XML.onLoad is passed true and the data is there.

The net result is that the widget just running in the normal cycle loop sometimes displays data and sometimes not. Does this suggest something?

Run directly from chumbyflashplayer.x, it succeeds 100% of the time, of course.

Re: Widget displaying local data

The problem is the Content-type. crossdomain.xml must be delivered with text/xml, not application/octet-stream.

It is not sufficient just to have a /www/crossdomain.xml.
There must also be an /etc/httpd.conf with:

.xml:text/xml

Which means that a bind over doesn't really work. It's simpler (on the Chumby One) to remount root rw long enough to put in a couple of symlinks to /psp for crossdomain.xml and httpd.conf. And then to fill in those files correctly.

It seems like there ought to be a Wiki page on how to get data from another local process.