Topic: X10 mini-controller widget

I am developing an X10 mini-controller widget in flashdevelop, and I have the buttons sending trace commands for light-on, light-of, bright/dim, etc.

I would like to interface this to either the serial port (which connects to an X10 controller), a USB serial dongle, or to an ethernet-to-serial converter (to the same X10 controller).

It looks like there's a path to get this connected using a C++ shell to manage the serial port and ASnative() calls in the widget.  Does anyone have a working example of how to send and receive from either the serial port or a USB-to-serial dongle?


Thanks,

Ag Primatic

Re: X10 mini-controller widget

A *widget* streamed from our server does not have sufficient privileges to access the serial port.  They are treated as "network untrusted", just like Flash movies in a web page.

There are a couple of ways around this:

1) Modify flashplayer.cfg to grant widgets privileged access to the necessary ASnative calls (see the second post in this thread.  You should probably make a small program in C++ and use the the ASnatives to access pipes to talk to it.

2) Create a small HTTP service to use standard unprivileged Flash XML calls to manipulate the serial port.  You can do this by adding CGIs to the little built-in server, or create a custom one by using the "chumbhttpd" library as found in the source code.

Re: X10 mini-controller widget

Thanks for the quick response, Duane.

I couldn't find any info on modifying flashplayer.cfg in the thread your referenced: http://forum.chumby.com/viewtopic.php?id=428.  That thread had to do with https access (unless I'm really missing something obvious).

I did see some discussion from the thread: (http://forum.chumby.com/viewtopic.php?id=3125) where Henry Groover mentioned that he had code for interfacing a GPS unit through a C++ executable to a widget.  That's very similar to what I would like to do.

It looks like I'll have to run both the widget and the C++ exectuable locally to get access to the serial port.

Re: X10 mini-controller widget

Sorry, cropped off a digit.

It's this thread.