Pages

Sunday 30 December 2012

Node.js Raspberry Pi Tutorial 1 - Installing Node

 


Okay so here is the first in a series of tutorials I am going to do on the Raspberry Pi using the node.js programming language.

The ultimate goal of these blogs will be to show how to run a website off the raspberry pi which will be able to communicate with the GPIO and the serial port so that you will be able to turn things on and off online.

Once this is done I will show how to make the site secure and then some basics on sessions.. the site doesn't have to be a GPIO site, It could just as easily be a blog you want to host on the pi.. I will be using libraries such as ExpressSocket.ionode-serialport and then some GPIO libraries I have found.

So let's dive in..

INSTALLING NODE

Pre-installation info

  • I am using the latest Raspbian image found here.. (2012-12-16-wheezy-raspbian.zip)
  • I am also using the 512MB Version of the pi (overclocked to 1GHz with 16mb GPU RAM), however I have also completed all of this on the 256MB pi so don't worry if that's all you have.
  • Everything on my pi is up to date so make sure you run update and upgrade on the pi.
I think the version of node in the raspbian archives is 0.6 but the latest version is 0.8 so we are going to want to install that. It's pretty easy to do so don't worry..

Okay so we are going to need to actually get the file for download, so create a directory on your pi, or just install it wherever in home and once in your directory just enter the following..

So then after that is completed, we need to untar the downloaded file and go into it's directory with the following commands..

After you have untarred the archive, its just a case of installing the thing.. note-this takes a long time (usually about an hour or more) so go make some noodles or something for a while..

Just enter these commands to install the thing, one after the other..

That's it, node.js installed.. to make sure just type in "node -v" into the terminal and it should say 0.8.16..
Please checkout part 2 in this series of tutorials..

1 comment: