Tuesday 15 January 2013

Install TinyOS in Ubuntu

1) Remove any old tinyos repository from /etc/apt/sources.list and add the following: 
A common pool supports all Ubuntu distributions based on Debian Squeeze. Specifing lucid as the distibrution should work fine. 
       deb http://tinyos.stanford.edu/tinyos/dists/ubuntu lucid main 
 
2) Update your repository cache : 
       sudo apt-get update 
3) Run the following to install the latest release of tinyos and all its supported tools: 
       sudo apt-get install tinyos
 
This will likely give you a message telling you to choose between the two available versions.  An example to then execute is:
       sudo apt-get install tinyos-2.1.1
 
 
4)(Optional)This should install the latest MSPGCC tools. We now have to download the
 latest TinyOS® version from the official repository, in order to be 
able to compile for telosb based products. Open a console and type:
 
cd /opt
sudo svn checkout http://tinyos-main.googlecode.com/svn/trunk/ tinyos-main-read-only
sudo cp -R /opt/tinyos-main-read-only /opt/tinyos-2.x
 
This will add the latest Tinyos® code, which include the new msp430x chip drivers.
 
 5) Then we need to change the environmental variables. For this we open the .bashrc file
$ gedit ~/.bashrc
and paste the following lines to the bashrc file.
export TOSROOT=/opt/tinyos-2.1.1
export TOSDIR=$TOSROOT/tos
export CLASSPATH=$TOSROOT/support/sdk/java:.:$TOSROOT/support/sdk/java/tinyos.jar : . : $CLASSPATH
export MAKERULES=$TOSROOT/support/make/Makerules             
export PATH=/opt/msp430/bin:$PATH    
 
  Add the following line to your ~/.bashrc or ~/.profile file in your home directory to set up the environment for TinyOS development at login 
        #Sourcing the tinyos environment variable setup script
        source /opt/tinyos-2.1.1/tinyos.sh 
 
6)Change the permission
 
sudo chmod 777 $TOSROOT 
 
7) Finally, to check if the installation was done , run the command
$ tos-check-env
 
For further help visit to :
http://docs.tinyos.net/tinywiki/index.php/Installing_TinyOS_2.1.1 

No comments:

Post a Comment