Thursday, September 9, 2010

installing TinyOS on Ubuntu

In this post I explain how to install TinyOS on Debian systems (ubuntu 10.4+, debian).

The steps are quite simple and are explained as follows:

1) Make sure that you are connected to the internet.

2) Open the source.list file in root mode using:

3) Add the following text:
You can replace the lucid with hardy/gutsy depending on the Ubuntu version, lucid is for 10.4 Ubuntu LTS) you are using. You are doing this to make sure that your package installer finds the packages urls, etc(software sources).

4) Open a Terminal and type the following command:
You are doing this to update the package information (deb package) on your system.

5) Now we install TinyOS by executing the following command:
It will prompt you to install JRE (if not installed), go ahead and install it by following the instructions on the screen.

6) Open the .bashrc file in your home directory and add the source script to the file at the end. You can also do this by giving following command:

7) Now close the Terminal and open a new one. You will a message in the terminal saying: This means that tinyOS has been successfully installed on your system.


    1. Thank You yaar....:)

      Can you please help me to Install NS simulator on UBUNTU 10.04 ..

      Thax in advance :)

    2. thank u very much sir...

      can u help me how to run the tinyos application in tossim.the tinyos simulator.and how do i get tinyviz to view the simulation of nodes

    3. Hello any one
      i'm trying to install tinyos2 on ubuntu 10.04, when i type the commnad sudo gedit/etc/apt/sources.list i get the following error, can any one help me out?

      manjula@manjula-desktop:~$ sudo gedit/etc/apt/sources.list
      [sudo] password for manjula:
      sudo: gedit/etc/apt/sources.list: command not found

    4. it should be " sudo gedit /etc/apt/sources.list "

      Notice the spaces between the command gedit and /etc/apt/sources.list

      Basically the command opens a text file in super user mode.

    5. Thanks Mr Rahul
      with regards

    6. hello friends
      I have installed Ubuntu 10.10, on my system and this is accompanied with tinyos2.x.
      can any please give me the steps to write and compile nesC programs for tinyos 2.x built with ubuntu

    7. The best tutorials are available at

    8. Thanks Mr Rahul

      with regards

    9. can i use ubuntu 11.04 for tinyos2.x apps on a pc having 80GB hard disk and 512 MB ram, with window xp already being installed?'or are there any issues or problems being faced? please let me know as i have to start my research.....

    10. If you take a look at 11.04 requirements at , you can find that your system satisfies the requirements. If you are running Ubuntu on virtual mode (VirtualBox/VMWare), you may experience some slowdown. Otherwise, I don't see any problems. TinyOS is supposed to run on systems with low hardware requirements.

    11. The mentioned steps are to download tinyos 2.1.1 on ubuntu 10.04 or will it work for 11.04 also?
      Because i tired those steps the whole day but each time some or the other files are not downloading? can any one help me in this regard?

    12. The same instructions should work.

      Read the instructions carefully.

      In 3rd step instead of " deb lucid main "


      deb natty main "

    13. This comment has been removed by a blog administrator.

    14. after in updated tinyos-2.1.1 as per the 7 steps given above, i found that that the tinyos-2.1.1 folder is created in files stem i.e root directory.

      now when i try to compile it as per the instruction given in the tutorial (TinyOS homepage) i get the following message " permission denined" after the following comands
      1. cd tinyos-2.1.1/apps/Blink
      2. make micaz

      mkdir -p build/micaz
      mkdir: cannot create directory `build': Permission denied
      make: *** [builddir] Error 1

      pls help me.

      and copied the entire tinyos-2.1.1 folder into my home directroy and tried the i get the following message

      manjula@manjula-desktop:~/tinyos-2.1.1/apps/Blink$ make micaz sim
      mkdir -p simbuild/micaz
      make: python2.5-config: Command not found
      make: python2.5-config: Command not found
      make: python2.5-config: Command not found
      placing object files in simbuild/micaz
      writing XML schema to app.xml
      compiling BlinkAppC to object file sim.o
      ncc -c -shared -fPIC -o simbuild/micaz/sim.o -g -O0 -tossim -fnesc-nido-tosnodes=1000 -fnesc-simulate -fnesc-nido-motenumber=sim_node\(\) -fnesc-gcc=gcc -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=simbuild/micaz/app.c -board=micasb -DDEFINED_TOS_AM_GROUP=0x22 --param max-inline-insns-single=100000 -DIDENT_APPNAME=\"BlinkAppC\" -DIDENT_USERNAME=\"manjula\" -DIDENT_HOSTNAME=\"manjula-desktop\" -DIDENT_USERHASH=0xcbc93b00L -DIDENT_TIMESTAMP=0x4e4b6037L -DIDENT_UIDHASH=0x0c731e3eL -Wno-nesc-data-race -fnesc-dump=components -fnesc-dump=variables -fnesc-dump=constants -fnesc-dump=typedefs -fnesc-dump=interfacedefs -fnesc-dump=tags -fnesc-dumpfile=app.xml
      compiling Python support and C libraries into pytossim.o, tossim.o, and c-support.o
      g++ -c -shared -fPIC -o simbuild/micaz/pytossim.o -g -O0 -DIDENT_APPNAME=\"BlinkAppC\" -DIDENT_USERNAME=\"manjula\" -DIDENT_HOSTNAME=\"manjula-desktop\" -DIDENT_USERHASH=0xcbc93b00L -DIDENT_TIMESTAMP=0x4e4b6037L -DIDENT_UIDHASH=0x0c731e3eL /opt/tinyos-2.1.1/tos/lib/tossim/tossim_wrap.cxx -I/include/python2.5 -I/opt/tinyos-2.1.1/tos/lib/tossim -DHAVE_CONFIG_H
      /opt/tinyos-2.1.1/tos/lib/tossim/tossim_wrap.cxx:139:20: fatal error: Python.h: No such file or directory
      compilation terminated.
      make: *** [sim-exe] Error 1

    15. to solve "Python.h: No such file or directory"

      try this:
      sudo apt-get install python-dev

    16. even after using the command given by you " sudo apt-get install python-dev" i'm getting the same error which i got earlier ( above in the post)

      and when i used the install python-dev command i got the following message

      manjula@manjula-desktop:~$ sudo apt-get install python-dev
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      python-dev is already the newest version.
      0 upgraded, 0 newly installed, 0 to remove and 665 not upgraded.

      and now i'm working with ubuntu 10.04

      also can you suggest me the best simulator for wireless sensor networks? because my guide just asked me to look at Omnet++?

    17. hi rahul,
      i have ubuntu 9.04 n my tinyos is installed but prob is dat m nt abl to run a Blink program. I m not using motes now. I want to make blink program first. For dat after doin makeiris, m getting som syntactical error. How to resolve that? plz help

    18. hey ; i tried installing tinyos on ubuntu 10.04
      on adding deb http://.... as given above and running
      $sudo apt-get update
      i get message as:-
      E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
      E: Unable to lock the list directory

      please help :)

    19. @neper: I assume that you have something that is installing on the side (concurrently) or you might have opened your synaptic package manager when you are trying to add the deb http://...

      Could not get lock means the above.

      @others: Guys I'm sorry. I'm not dealing with programming in Wireless Sensors anymore. I just dealt with basics in my course. I think I might have source code of Blink program which I will post.

      Now, my research is Computer Vision and Computer Networks.

    20. I am trying installation of tinyos-2.x on Ubuntu 11.04 and after typing the command
      tinyos@tinyos-System-Product-Name:~/tinyos/tinyos-2.x/tools$ ./Bootstrap
      + aclocal
      ./Bootstrap: 1: aclocal: not found
      Is it a error? what needs to be done for correct execution?
      Pls help. its bit urgent

    21. Hello anyone
      This is Manjula, I have installed ubuntu 9.10 and trying to install tinyos-2.1 so , i made the changes to /etc/apt/soruces,list file, below are its contents ( note some lines are deleted due to space restriction


      #deb cdrom:[Ubuntu 9.10 _Karmic Koala_ - Release i386 (20091028.5)]/ karmic main restricted
      # See for how to upgrade to

      #deb karmic-security main restricted
      #deb-src karmic-security main restricted
      #deb karmic-security universe
      #deb-src karmic-security universe
      #deb karmic-security multiverse
      #deb-src karmic-security multiverse

      deb karmic main

      i have commented every thing in this file except for links for tinyos just about the star(ed) line, then when i use the command sudo apt-get update , i get the following error, below enclosed in star(ed) lines


      Err karmic Release.gpg
      Could not connect to ( - connect (111: Connection refused)
      Err karmic/main Translation-en_IN
      Could not connect to ( - connect (111: Connection refused)
      Err karmic Release.gpg
      Could not connect to ( - connect (111: Connection refused) [IP: 80]

      Err karmic/main Translation-en_IN
      Could not connect to ( - connect (111: Connection refused)
      Reading package lists... Done
      W: Failed to fetch Could not connect to ( - connect (111: Connection refused) [IP: 80]

      W: Some index files failed to download, they have been ignored, or old ones used instead.
      manjula@manjula-desktop:~$ sudo gedit /etc/apt/sources.list

      can any one tell me why am i not able to get connected to the server, i faced the same problem when i installed ubuntu 11.10, but because the tutorial on tinyos home page gives details for karmic release of ubuntu, i tried to install ubuntu 9.10, but still facing the same problem. Please any give me the solution?
      Thanks in advance
      with regards