Using Cloud9 3.0 IDE on Raspberry PI
I was really amazed at this introduction of Beaglebone and Cloud9 and therefore by the simplicity of programming that it offered, that I instantly decided to try it out on my Raspberry PI. I have a RPi B+, but I think the instructions should work on all versions.
What I am presenting below is the result of a day of my efforts, has been tested on my system only, and unless, you are too deep in your node programming, and too stupid not to use git/github (or other DVCS), you should stop reading further and go play minesweeper.
- Update and Upgrade: Alright, so first off, its always good to do this, if you haven’t done this in a long time, but remember that this can break a few things, so only do this if you aren’t on a mission critical system.
sudo apt-get update && sudo apt-get upgrade
2. Get the right Node: NodeJS, if you are aware, is the new cool thing in programming, and is really changing quickly, and well, not all other things are moving at the same rate. So, you might often find, that some things work well with one version better than another. I am finding this more at an intermediate level of understanding of NodeJS, and frankly, it is a little disconcerting, but I am too deep to turn away. And so happened with Cloud9. After a few trials and errors, and after a day of tinkering, I found that v0.10 works, so here it goes,
tar -xzf ~/node-v0.10.28-linux-arm-pi.tar.gz —-strip=1
A quick check to make sure that you installed the correct version besides, a non-red or warning type installation output is to do the following:
which should print v0.10.28 meaning, we got the correct version of NodeJS, and this command should run from any directory on your PI.
3. The latest Cloud9 SDK: The official Github repo: https://github.com/c9/core and from there the suggested method of installation
git clone git://github.com/c9/core.git c9sdk
After a good long time, you should see you screen emit an all OK message. You are ready to roll with something like,
This should get things rolling. For being able to work in a headless situation, like remotely programming into your RPi like in the video above, the owners were very helpful in suggesting:
./server.js -l 0.0.0.0
and with some modifications of my own and drum-roll…… the command that works is:
./server.js -l 0.0.0.0 -a :
which prevents any authentication whatsoever, which might be good or not depending on your use-case. What you should get is the latest Cloud9 IDE thanks to the great effort of the developers and you should get most of the functionality of c9.io in an offline mode.
So if all the steps above worked for you, then please comment. If they didn’t work, please definitely comment on what didn’t work. If you find a fault in any step, please comment exhaustively.
My tryst with hardware is a work in progress, and as I test Cloud9 on my RPi through my laptop browser, I am discovering that the i2c package doesn’t work on my RPi, yet and I am trying to work that out.
Also, am trying to learn the Cloud9 interface to use it to its full efficiency, and especially want to learn how to use github through point and click mode.
- **EDIT 1** : I have written a bash script to make the job of setting up even simpler. Here it is. and the github repo: https://github.com/chintanp/Cloud9-on-RPi/
I wanted to make this process persistent on RPi and auto-start on startup but I hit a road-block and if you can help, here is the ask-ubuntu question: http://askubuntu.com/questions/679345/debugging-upstart-script-for-nodejs-process
- **EDIT 2** : Cloud 9 IDE supports editing for default runners. Runners are nothing but configuration files that documents the various run-time parameters and options. The default runner can be seen as in the orange box in the image, in-line options to read command, CWD and ENV.
When you click on this portion of the IDE, a long list of (default) runners can be seen, based on the so many languages that Cloud9 supports. And guess what, the good news is — these runners can be edited, rather easily to suit our requirements. This post explains how to do that.