Beaglebone Black : Cloud9 and Bonescript Install Guide


beagleIn my previous post about installing the GateOne terminal emulator, I mentioned that I wanted to replicate the experience and features for the OOTB Beaglebone image of Angstrom only on Ubuntu.  Well, I’m getting a little closer day by day.  This post was originally intended to be the installation of Cloud9 but as I was reviewing my notes, I decided to try getting Bonescript installed as well.  Both installations are contained in this guide.

Since I am fairly new to the BBB, I haven’t spent much time with Cloud9 or Bonescript. I was initially attracted to it because of its power to size ratio and that Ubuntu was an option.  However, I am planning to do some maker projects with the BBB, so I will get to test my handiwork.  Just understand that even though I got them running, I have yet to extensively test them.

Like with WiFi, a lot of people have struggled with getting Cloud9 running and I am no different.  Others mentioned and blogged about their successes but I was unable to replicate their success.  However, I will include the links to a couple blogs where I gathered information and inspiration.  I hope that this method works for you.  Let’s get started.

NOTE:  We will be removing the current version of Node from this instance, so if you have any dependencies on the current installation, you may wish to think twice before you proceed.

Installing the Prerequisites

First, we need to prepare our system for the install.

sudo apt-get install -y build-essential g++ curl libssl-dev apache2-utils git libxml2-dev

Also, we will need to remove node.js if it exists:

sudo apt-get remove nodejs

One of the blogs I used (Sam’s Site) indicated that downloading NVM (Node Version nodejs-logoManager) but I wasn’t able to get this to build correctly.  So I downloaded the latest version of Node and attempted to build it but it didn’t work either.  So, I split the difference between the minimum (v.0.6.16) and the latest (v.0.10.18) and settled with v.0.8.25.  I found it on the nodejs distribution page. I unpacked it, navigated into directory created, and then ran this sequence.  A word of caution: The ‘make’ step takes a while.  I literally burned hours compiling node on the BBB while I was working out which version would work.

./configure
make
sudo make install

After the install completed, rebooted the BBB and then when it came back, I ran the command:

node --version

and the return was:

v0.8.25

Now, that node was installed, I cloned the Cloud9 repository (repo) from here:

https://github.com/ajaxorg/cloud9/

I'm on Cloud9

I’m on Cloud9

I attempted the install instructions by changing directories to Cloud9 then executing:

npm install

This resulted in a miserable failure.  However, since with the node installation came the npm (node package manager), I thought there might be a Cloud9 package and sure enough, there was. So I changed to my home directory and altered my command to:

sudo npm install Cloud9

This actually worked.  However, I was trying a bunch of stuff and it all kind of got messy and I had 3 Cloud9.sh files.  I found them by typing in:

whereis cloud9.sh

The one I was looking for was under ~/node_modules/cloud9. I changed directories to this directory and then executed:

./cloud9.sh

The resulted in the application actually starting, much to my surprise.  However, when I navigate to the site (ex. http://bbb.local:3131), nothing came up.  After going back to the Cloud9 repo page on github, I found the configuration under the Installation and Usage section.  Adding the -l hostname flag will allow you to specify what machine can access the IDE.  You can use a wildcard and allow any machine to access the IDE, like so:

./cloud9.sh -l 0.0.0.0

Going back to my browser and navigating to the BBB on port 3131, The IDE finally came up.  Allowing any workstation to access the IDE can be risky.  You can add some additional security by specifying a username and password:

cloud9.sh -l 0.0.0.0 --username test --password test2

When you open the web page, you will be challenged with a basic auth login modal.

Keep in mind, we are working on a Beaglebone Black, not an NSA network.  However, good security should always be considered.  As with the GateOne app, this one is rather new to me but when I start it up, I see the file structure of my Cloud9 folder.  I will need to figure out how to fine-tune this.

Finally, as promised, the installation of Bonescript was bloody easy.  Change your current directory to your Cloud9 folder and enter:

npm install bonescript

…and shortly, bonescript will be installed as well.  I am not going to explore the configuration or usage of bonescript yet because I simply haven’t used it yet but at least it didn’t blow up in my face when I installed it.

Bonus Round

I did some tidying up to release some space that was taken up from the install process. First I copied the the node folder from my home folder to /opt.  Next, I copied the cloud9 folder from ~/node_modules to /opt.  Then I removed the node, node_modules, tmp, and cloud9 folder from him home folder.  This released more than half of my previously free space.  What I learned here is that if you don’t  plan to use these tools, don’t bother to install them.  They use up precious space and are a bit slow.

I have yet to add cloud9 to my startup process but that shouldn’t be too difficult.  I already have a script that is kicked off from a cron job using the @reboot trick I mentioned in the Ubuntu Guide.  I will simply add this to it.

I hope that if you use the Cloud9 on the Angstrom image and are looking to moving to Ubuntu, you don’t hesitate because of this process.  I found it challenging but I learned about NodeJS, NVM, NPM, and the build/install process which I have not had much experience with before.  It’s fun and a great way to get to know your Beaglebone.  Best of all, if it fails miserably, you can always reimage and go back to the OOTB image anytime.

Let me know if you have any questions or if you discover some neat trick that expands this.  I would love to know more and to hear from you.

Related links:

http://beagleboard.org/Support/bone101/#cloud9

https://c9.io/site/features/

http://www.samclarke.com/2012/07/how-to-install-cloud-9-ide-on-ubuntu-12-04-lts-precise-pangolin/

http://www.alexvictorchan.com/2013/06/19/setting-up-cloud9-locally-on-a-chromebook-pixel-or-any-debian-system/

https://github.com/ajaxorg/cloud9

http://nodejs.org/dist/v0.8.25/

http://nodejs.org/dist/

https://www.google.com/search?q=install+bonescript&oq=bonescript+install+&aqs=chrome.1.69i57j0.6033j0&sourceid=chrome&ie=UTF-8 (Google search resulting in a log of crying and nashing of teeth)

https://npmjs.org/package/bonescript

About these ads

2 thoughts on “Beaglebone Black : Cloud9 and Bonescript Install Guide

  1. Pingback: Beaglebone Black : Cloud9 and Bonescript Instal...

  2. Pingback: Beaglebone Black : Cloud9 Running under Ubuntu | Digital Ink Splatter

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s