Adobe AIR Accent [mood] Light

I’m posting a small AIR project I did a while back. In fact, this was my first AIR app. To that end, there’s no reason this couldn’t be compiled as a Flex app, the use case made more sense as a desktop app and I wanted to get my feet wet with AIR.

Source Code for AirRGB

The application allows the user to select the color displayed of some attached (via serial connection) tri-color LEDs. The program also has the ability to randomly pick two colors and “transition” from one color to the next over a user specified amount of time.

Flash / Air doesn’t allow read / writing to serial ports. The program uses a serial proxy by by Stefano Busti(1999) and David A. Mellis(2005) found at http://www.arduino.cc/en/Main/Software to make this possible. The AIR app then can utilize a socket connection to the proxy.

For those interested here’s a list of the parts used for the light itself:

Arduino USB Board $34.95
LED Light Bar (Tri-Color) $4.95
Darlington Driver 8-Channel ULN2803 DIP $1.95
USB Cable A-B $6.95

PHPbb over 443 (https)

Quick heads up for anyone having trouble getting phpbb to working under a secure (https) installation. You may have to manually go in and change cookie_secure from 0 to 1 in the database table `_config`.

403 Forbidden Error with Adobe AIR app.

Here’s another issue I recently ran across. I was porting an existing (working) Flex 3 project to AIR. Under AIR my RPC calls (via AMFPHP) stopped working, and would return a 403 Permission denied error.

Using ethereal verified the 403 error. The were minor differences in the headers sent when executing the NetConnection.call() from Flex and AIR. One of those differences happened to be the “user-agent.” My gateway is hosted on a shared webhost, so this was my first guess as to what might be the problem.

I launched charles, and sure enough, the server would reject (via 403) any POSTs made with a user-agent of “Shockwave Flash.” Changing the user-agent (via charles) to pretty much anything else fixed the problem.

I contacted both Adobe and my webhost. The Adobe engineers stated the default user-agent has been changed for the final release of air. My webhost was gracious enough the give me a line to add to my .htacess to revoke this “filter”

Everything is now working.

Client.Data.UnderFlow

I ran across the following error today, Client.Data.UnderFlow undefined? I’m using AMFPHP to enable my RPC calls. As it turns out, I the variable I was returning was of a different type than I had declared in my methodTable.

PHP – Large File Uploads

Okay, here’s a quick check list of php.ini variables that may need tweeking for allowing large file uploads…

file_uploads (You’ll want this set to “On”)
upload_max_filesize (2MB default)
post_max_size (8MB default)
max_execution_time
max_input_time
memory_limit

My $_FILES array kept turning up empty, turned out to be the post_max_size still set at 8MB.