Even though almost all the works I was doing in sensor networks are implemented using Contiki OS, recently I had to install TinyOS and play with it as a course work. Therefore for the first time I used TinyOS and it seems OK. Even though NesC is a little bit painful than pure C used in Contiki, I think I can adapt to it.
I thought to write down the steps I followed to install TinyOS in my machine before my memory get overwritten by something new. There are different variations of TinyOS available and its installation is little bit complicated. This is the way I did as I was instructed. Here I have set up the required tool chains for AVR micro-controller based platforms. There may be different packages required to compile for different other platforms.
1) There are some repositories we have to put in our sources.list file to install TinyOS. Therefore add the two lines shown below to the sources.list file (/etc/apt/sources.list) of your Ubuntu system.
deb http://tinyos.stanford.edu/tinyos/dists/ubuntu hardy main
deb http://hinrg.cs.jhu.edu/tinyos oneiric main
2) If you don't have synaptic package manager in your system, now it's better to install it before going further,
sudo apt-get update
sudo apt-get install synaptic
3) Now in the terminal issue the following command to install TinyOS, (this step may take some time)
sudo apt-get install tinyos-2.1.1
4) The next step is to install avr-libc package. But there's problem. When you follow the previous step, some of the tools comes with avr-libc gets installed an therefore some package inconsistency problems may occur. Therefore its better to remove those unnecessary additional packages came with TunyOS installation.
sudo apt-get remove avr-binutils-tinyos avr-gcc-tinyos
5) Now lets install avr-libc package,
sudo apt-get install avr-libc
6) Now open .bashrc file of your home directory and add the following line.
To open the file,
sudo gedit .bashrc
Add the following line to the end of that file, save and close.
7) Now python-dev package is required. So, we install it by issuing the command,
sudo apt-get install python-dev
8) Python version of the system is written in a configuration file of TinyOS. Therefore we have to edit it to make it have the current python version. To find it enter the following in the terminal,
There we can see the version of python. Open the configuration file by issuing the following command,
sudo gedit /opt/tinyos-2.1.1/support/make/sim.extra
There's a line in that file which starts as PYTHON_VERSION. Change it to have the correct python version in your system.
Now we have installed TinyOS in our system. I will write a separate post about burning an example TinyOS application to a mote.