One of the things I like about the BeagleBone(Black) is that it comes with Cloud 9 IDE off the shelf which means that you do not need to install any kind of software (other than a browser) on your host system to start developing something on the board.
What is Cloud 9 IDE?
By following the instructions on this blog, we will have Edison hosting the Cloud 9 IDE using which you will be able to write and execute code from your browser.
The remainder of this post talks about how I went about setting up and preparing the Edison to setup the Cloud 9 IDE.
The preparation process involves downloading and compiling certain packages which can easily take up the allocated space for the root file system on eMMC of the Edison so you’ll have to boot from the SD card to complete this process.
You can refer to this post if you want to boot from SD card.
First thing to do is update the repo list, if you have not done already. Refer to this link if you want to add the repos.We need to install git once the repos are added:
opkg install git
sh Setup_Cloud9_On_Edison.sh install
During the process of installation, you’ll be prompted to enter your choice if you want to install “ps” program with full set of options, as opposed to installed busy box version on the Edison. It is strongly recommended that you accept the default and install the suggested “ps” without which the IDE would not identify the spawned process and will not be able to stop it.
The script will take 4-5 hours complete.
Start the server with following command:
Stop the server by pressing ctrl-c in the console.
Your workspace will be placed in directory “/home/root/c9wks” by default.
What does the script do?
If “install” argument is passed:
The Clod 9 SDK expects node v0.12.0. The node that is shipped with Eidson is v0.10.0 so the first thing it does is, gets the node source, compiles and installs it on Edison.Then libevent and tmux packages are installed. While the default LD path on Edison is /usr/lib, we also need to export the lib path /usr/local/lib where the libevent will be installed and tmux config file for some reason is only able to detect it from this path and passing the libevent location to config din’t work. The Edison already comes with slightly older version of libevent so you will now have two versions of libevent.
If the script is not passed any argument:
Then the server is started with following command:
./server.js -p 8080 -l 0.0.0.0 -a $USR_NAME:$PSWD -w $WKS
There are two things that are configurable in the script:
- WKS: Workspace path – This is where all the files created will be stored
- USR_NAME, PSWD : User name and password : When specified, you will be prompted to enter these when the Edison is accessed from the browser
You will find these variables at the very beginning of the script.
What do I do next?
Start up the browser and navigate to your board with 8080 as port:
You can use ifconfig to know the IP address of the Edison or read the log message printed out when you started the Cloud 9 server in the previous step.
You can start this script every time the Edison boot up using cron.
If you have been following my blog for some time, you might have noticed the trend that I tend to do same project on both the Galileo and Edison. I started out with Galileo on this one but soon discovered that the node 0.12.0 version required by c9sdk cannot be installed on Galileo since node does not work on non SSE2 and CMOV architectures (on Intel based processors). Need to explore if c9sdk can still be used with older version of node.
You can find step by step instructions for setting up the Cloud 9 IDE on Edison here.