2011-03-07

Node.JS-based Cloud9 JavaScript IDE running on a BeagleBoard

Yesterday, I decided I was going to get Cloud9 running on my BeagleBoard. I didn't document every step, but below are a few helpful hints. I'm working with a recent Angstrom Distribution build with Node.JS v0.2.6.

At first, I tried using Node.JS v0.2.1 and I found that the 'connect' module wasn't present. I went to install 'npm', but the install attempts failed silently. When I found that v0.2.6 was in the feeds, I tried installing 'npm' again and it succeeded without much of a headache. I installed v0.2.19 of 'npm'.

Since the node-o3-xml package needs to be compiled for Cloud9, I installed a bunch of native tools onto my BeagleBoard, including 'opkg install task-sdk-native nodejs-dev', but I don't remember 100% of what I installed. My confusion began around an error on 'import Scripting' when running node-waf. Fortunately, someone already figured the issue out for me when they were trying to build node-inotify on a Gumstix board. I installed the extra Python tools and copied the .py code from my Mac. I did need to edit wscript to remove any x86 specific optimization flags and remove any .pyo files that accidentally got copied over.

Once I built o3, I installed it into my Cloud9 directory, which I checked out following the online directions. I am working from the Cloud9 0.2.0 tag. Since the submodules of Cloud9 include a set of pre-built binaries for o3, I added a repository that included my newly built ARM binaries.

I think this was pretty much it to getting Cloud9 invoked, but using the latest Firefox 4 beta as a client wasn't working. I tried using the '-d' flag at invocation and moving Cloud9 to a user account instead of root, but that didn't help. Based on a blog post that described invoking Cloud9 on an Ubuntu machine, I was using this command-line to perform the start-up:

node ~/cloud9/bin/cloud9.js -c ~/cloud9/config.js -w ~/testproject -d

I decided to install Chrome to see if it was a browser dependency and viola!


After a simple web server app, I decided to poke the LED SYSFS entries. I needed to change the SYSFS file entry permissions to 777 to enable my user account to set the state, but I was easily able to do so.

Next step is to show how JavaScript closures can be used to create a web page that responds quickly when the USER button is pressed, generating a Linux input event.

Am I the only one that gets how cool it will be to be able to distribute pre-configured SD cards you can drop into your BeagleBoard, plop it onto a network and start editing code to peek and poke hardware using an IDE without ever installing *anything*?

3 comments:

  1. Hi Jadon,

    I just noticed in another blog (http://montamer.blogspot.com/2009/01/opencv-on-beagleaboard.html) that you once mentioned that there are developers optimizing OpenCV for ARM? Do you know if that happened, or who did it, because I am thinking of doing it also. Please email me at "shervin.emami@gmail.com" if you still know about it.

    ReplyDelete
  2. Hello, Jadon,
    I'm using node.js on windows (dev and production), and can not find node-waf win build or instructions how to build it anywhere!
    Would you have any info/suggestion where can I get windows version of node-waf, or how to build it (I'm new to python, also...)
    Thank you.

    ReplyDelete
  3. I don't believe node.js runs on windows today, but you can try cygwin.

    ReplyDelete