Dallan’s weblog

Archive for June, 2009

Red5 + Arduino

by dallan on Jun.01, 2009, under Flex & Flash, Red5

I have been working on a little project that ‘pushes’ Arduino data from a USB connected PC to a server running Red5. Red5 treats each Arduino pin as a shared object. So when a pin (the Arduino has 6 analog pins and 14 digital pins) updates, every visitor viewing a subscribing webpage gets live data. I wanted to see how fast I could publish sensor data using Red5. I’m also interested in the performance with regards to bandwidth usages (to/from the server), speed of updates, CPU usage on the client to display the rapidly updating data in the browser, etc…

Click Here to Start Streaming Live Arduino Data
Analog Pin0: n/a
Analog Pin1: n/a
Analog Pin2: n/a
Analog Pin3: n/a
Analog Pin4: n/a
Analog Pin5: n/a

how it works:

First the server side stuff –  I wrote a .NET DLL so I can communicate easily with the Arduino using .NET. Next, I created a simple .NET winforms app that includes my DLL. I will use this application to get the data from the Arduino. The Arduino itself is running Standard Firmata V1.0 (http://firmata.org/wiki/Download). A Flex/Flash Actionscript 3 swf is used to connect to Red5 and create a shared object for each each Arduino pins (i.e. AnalogPin0, AnalogPin1, …, DigitalPin0, …, DigitalPin13). This Flex swf is embedded into the .NET (C# in this case) WinForm (using ActiveX or OLE or whatever) and the ExternalInterface is used to pass messages from C# to Actionscript running in the swf. When the .NET app gets data from the Arduino, it passes it immediately to the swf. The swf is connected to the remote Red5 server and updates the appropriate shared object (pin) immediately. I’ve attached a couple of images of my setup (I’m using a ASUS eee box as my control PC (little black box with the blue LED). Ignore the TED display box for now, I’ll post about that later.

img_0082img_0083img_0084

(continue reading…)

Comments Off more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...