TinyOS is an open source, BSD-licensed operating system designed for low-power wireless networks. The application areas include: sensor networks, ubiquitous computing, body area networks (BAN), smart buildings and smart meters.

 

Installation of the Ubuntu Packages

Before installing the TinyOS operating system, you must include the following TinyOS repository addresses into the repository source file. This can accomplished by editing the file /etc/apt/sources.list as follows:

1-Run the  sources.list script.

$ sudo gedit /etc/apt/sources.list

Then you’re going to get a dialog as below like the one presented bellow:

image

2-Include the following lines at the end of  the script.

#tinyOS

deb http://tinyos.stanford.edu/tinyos/dists/ubuntu lucid main

deb http://tinyos.stanford.edu/tinyos/dists/ubuntu maverick main

deb http://tinyos.stanford.edu/tinyos/dists/ubuntu natty main

3-Save and close the “gedit” application.

 

TinyOS Installation

4-Open the terminal console and execute the following command:

$ sudo apt-get update

$ sudo apt-get install tinyos

Then you’re going to a list of the TinyOS version available as presented bellow:

image

 

5-Run the following command to install TinyOS 2.1.2. During this step maybe you’ll be asked to enter the administration password and to confirm one or two steps along the way.

$ sudo apt-get install tinyos-2.1.2

6-If you don’t have the subversion installed run the command bellow, otherwise jump to step 7.

$ sudo apt-get install subversion

 

7-This will enable the installation of  the latest MSPGCC tools. We now have to download the latest TinyOS® version from the official repository, in order to be able to compile the iris based platforms as follows:

$ 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.

 

8-Now, use terminal console and execute the following command, to go inside your TinyOS installation, as follows:

$ cd /opt/tinyos-2.1.2

9-Now list the files by using the ls command and check if there is a file named ‘tinyos.sh’. If not create a new one. This can be accomplished  by using the “nano” or “pico” editors.

You have to make sure that the content of ‘tinyos.sh’ file matches with the content below:

#! /usr/bin/env bash

# Here we setup the environment

# variables needed by the tinyos

# make system

echo "Setting up for TinyOS 2.1.2 Repository Version"

export TOSROOT=

export TOSDIR=

export MAKERULES=

TOSROOT="/opt/tinyos-2.1.2"

TOSDIR="$TOSROOT/tos"

CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java:.:$TOSROOT/support/sdk/java/tinyos.jar

MAKERULES="$TOSROOT/support/make/Makerules"

export TOSROOT

export TOSDIR

export CLASSPATH

export MAKERULES

10- Save the file and exit.

 

11- Now, use terminal console and execute the following command, to go inside your TinyOS installation, as follows:

$ cd /opt/tinyos-2.x

12-Now list the files by using the ls command and check if there is a file named ‘tinyos.sh’. If not create a new one. This can be accomplished by using the “nano” or “pico” editors.

You have to make sure that the content of ‘tinyos.sh’ file matches with the content below:

#! /usr/bin/env bash

# Here we setup the environment

# variables needed by the tinyos

# make system

echo "Setting up for TinyOS 2.x Repository Version"

export TOSROOT=

export TOSDIR=

export MAKERULES=

TOSROOT="/opt/tinyos-2.x"

TOSDIR="$TOSROOT/tos"

CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java:.:$TOSROOT/support/sdk/java/tinyos.jar

MAKERULES="$TOSROOT/support/make/Makerules"

export TOSROOT

export TOSDIR

export CLASSPATH

export MAKERULES

13- Save the file and exit.

 

14-We now have to make sure that this TOSROOT is used whenever a program is compiled. Open a console and type.

$ sudo cp /opt/tinyos-2.1.2/tinyos.sh /opt/tinyos-2.x/tinyos.sh

$ sudo chmod +x /opt/tinyos-2.x/tinyos.sh

$ sudo gedit /opt/tinyos-2.x/tinyos.sh

15-In order to make that we are using this folder as your TOSROOT path, open the terminal console and execute the following command:

$ sudo gedit ~/.bashrc

 

16-Add the following lines at the end of the document that opens:

#Sourcing the tinyos environment variable setup script

source /opt/tinyos-2.1.2/tinyos.sh

#Sourcing the tinyos environment variable setup script

source /opt/tinyos-2.x/tinyos.sh

 

17-Save the file and close the editor. Close the terminal console and restart the PC.

Installation the Blink Application on the IRIS motes

 

18-If the previous steps where successful, the environment should be ready now. It’s now time to compile our first application. To test it open the terminal console and execute the following command:

$ cd /opt/tinyos-2.x/apps/Blink/

$ make iris

This will compile the Blink program, that basically blinks the leds in a iris mote.

 

19-To test it with an actual mote we have to upload the image file. Therefore, we need to connect one of your recently acquired motes, such as the IRIS.

$cd /opt/tinyos-2.x/apps/Blink/

$make iris install,17 mib520,/dev/ttyUSB0

 

Note, that we are assuming that the  mote is connected on port /dev/ttyUSB0. In Linux, serial devices are given a number in the order in that they are connected, so the first mote you connect will always be /dev/ttyUSB0, the second /dev/ttyUSB1 and so on.

If everything  goes right we should now see the leds on the mote blinking, congratulations on a successful installation!

About these ads