1 (edited by agprimatic 2009-12-26 19:21:29)

Topic: Do local widgets have access to hardware?

I built my widget that needs access to the USB-serial dongle and tested it, and everything works just fine.

When I add a profile.xml to /mnt/usb and it runs, the widget runs but it has no hardware access.

Can I access hardware when the widget runs locally?  Is there something special in profile.xml that indicates it's safe to access the hardware?

Re: Do local widgets have access to hardware?

One more data point:
As an experiment, I tried adding the line

PrivilegedCallExceptions=65535

to /psp/flashplayer.cfg

but it didn't help.

Re: Do local widgets have access to hardware?

Maybe you're making calls that aren't supported by Flash Lite?

How is it accessing the USB serial dongle?

Try ssh'ing into Chumby, run stop_control_panel, then run start_control_panel. Because you're starting the control panel from the shell, you'll see a whole lot of debug output. See if they sheds any light as to why your widget isn't working.

Re: Do local widgets have access to hardware?

OK, I ran stop_control_panel, then start_control_panel.  Once my widget started, the only output was:

2009-12-31 21:46:32 TRACE: - loading widget movie "X10 Controller" from file:////mnt/usb/x10ctrl.swf
2009-12-31 21:46:33 TRACE: preload.swf v1.02
2009-12-31 21:46:33 TRACE: - using widget instance timing:
2009-12-31 21:46:33 TRACE:  - timeout, 30000 ms
2009-12-31 21:46:33 TRACE: - running the widget forever
2009-12-31 21:46:33 TRACE: Setting advance timer handler
2009-12-31 21:46:33 TRACE: ScreenManager.widgetPlayerMode()
2009-12-31 21:46:33 MemoryObject::<dtor>(mmobj=0x002bc2cc) SEVERE WARNING - destroying MemoryObject with 5 blocks still allocated!
2009-12-31 21:46:38 TRACE: (Advance timer heartbeat)
(timers repeat here)

When I ran the widget locally by stopping the control panel and running
chumbyflashplayer.x -i /mnt/usb/x10ctrl.swf

it works correctly (I can talk to hardware) and I don't get the SEVERE WARNING message.

Re: Do local widgets have access to hardware?

Some more debugging:

If I run the widget standalone, the values of output, rHandle, and wHandle (the return values from _backtick(), _pipeOpen(,"r"), and _pipeOpen(,"w")) are "", 2, and 3, respectively.

If I let it run as a local widget, the values are undefined.

It seems as though the _backtick() and _pipeOpen() calls aren't being executed.

Re: Do local widgets have access to hardware?

Hoping someone from chumby can verify this, but it looks like the only difference between local widgets and widgets served over the web are where they come from.  They both seem to have the same permissions.

May I suggest that in future software releases, widgets that come from /mnt/usb have the same permissions as the control panel?  The global PrivilegedCallExceptions is too coarse a control.

Re: Do local widgets have access to hardware?

Yes, all widgets have the same permissions for the use of the ASnative extensions no matter where they come from.  You'll need to alter the flashplayer.cfg file to grant permissions.

Re: Do local widgets have access to hardware?

Is this a change in this behavior? I thought local widgets had access to the hardware?