Installation of TinyOS in Ubuntu

TinyOS is becoming the defacto standard OS for sensor network platforms and Ubuntu is most popular distro in Linux flavours. The follwing steps helps to install the TinyOS environment and compile and run the programs.

After everything is done, download this skelton code and verify the installation


Distribution is Ubuntu Hardy Heron

TinyOS version is TinyOS 2.1.0/ 2.1.1

Username is "test"

If this is not, update information is given at each step with your version


  1. Go to System -> Administration-> Synaptic Package Manager ( from the Top Panel )
  2. In Synaptic Package Manager go to settings ->repositories.
  3. Take 3rd party Software . Click on Add and copy the following. Assuming that your distribution is Hardy.
                deb hardy main
    or for a different distribution of Ubuntu
    (deb * main)
  4. Click OK and then reload repositories
  5. After reload is done, Search for TinyOS and set install and apply changes.
  6. Once the installation is finished, set the shell environment. Take a shell and type
    gedit ~/.bashrc and add follwing lines at bottom
     source /opt/tinyos-2.1.0/   
       source /opt/tinyos-2.1.1/ 
Checking the Installation
  1. Close the previous shell. Take a new Shell
  2. Type echo $MAKERULES. If everything is ok, it will display the path.

First Program in TinyOS
Follwing is the simplest program which can be written for TinyOS
Take gedit, copy paste following code.
/* */
configuration SkelAppC {
components MainC, SkelC;
SkelC -> MainC.Boot;
Save as
Take new file in gedit. Type follwing code
/* The SKEL application */
module SkelC

uses interface Boot;


event void Boot.booted()
Save the file as
Take new file in gedit
Type following

include $(MAKERULES)
Save as Makefile


Assuming that username is "test" and your files ", and Makefile" are in /home/test/tinyos/apps
Take a shell. Type following
cd /home/test/tinyos/apps make telosb

If everything is fine, your output should look similar to above one.

(Same code is provided for download)

Links you may be interested
Running TinyOS Programs using Avrora
Running multiple node simulation using Avrora: Example BlinkToRadio