Ragemaster ([info]ragemaster) wrote,
@ 2008-11-11 12:50:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Entry tags:development, linux, programming, school, tinyos, ubuntu, wireless sensor networks

Installing TinyOS 2.x on Ubuntu (with Iris support)
Since upgrading my Ubuntu installation, I got plenty of compile warnings when compiling TinyOS applications.  To fix this, I just decided to reinstall TinyOS.  It can be a pain to install and each time I do it, I've got to look for resources on the internet and try a couple different things to get it working.  I'll try to keep this updated whenever I discover something new or have to upgrade or reinstall TinyOS again.  Here are the references I found to help me compile this:

All Platforms:
Installing TinyOS 2.0.2

Ubuntu:
5 Second Fuse - TinyOS Installation
Install TinyOS-2.x On Ubuntu << Udin Harun

I also got it running on my Leopard Macbook using this:
Installing TinyOS 2.x on Mac OS X (Tiger and Leopard)

This worked for me on Ubuntu 8.10 Intrepid Ibex.  I did have a previous install of TinyOS that I removed, but some stuff may have been left behind.

1.  Add the following line to /etc/apt/source.list:

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

Currently, there isn't any repository for Intrepid Ibex, but this seems to work fine.

2. Update the repository cache from a terminal window:

$sudo apt-get update

3.  Install TinyOS packages:


sudo apt-get install tinyos tinyos-avr tinyos-msp430 nesc tinyos-tools

In my case, "tinyos" caused a warning since it was an abstraction for several packages.  I installed "tinyos-2.0.2".

3a.  (Iris Support): Install TinyOS from CVS:

I also wished to have the latest TinyOS version from CVS since it seems those provided via the Stanford repository did not support the Iris mote.  To install from CVS, open a terminal window to the installation directory of your choice and run the following:

$cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login
$cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-2.x
$cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-2.x-contrib

tinyos-2.x-contrib is a library of user-contributed code that can help in designing your own applications.  If you installed as su, you may want to change the permissions of your tinyos directory if you wish to compile anything in the apps directory or modify any TinyOS code:

$chown -R <uid> tinyos-2.x

4. Add the following environment variables to ~/.bashrc:
export TOSROOT=/opt/tinyos-2.x
export TOSDIR=$TOSROOT/tos
export CLASSPATH=$TOSROOT/support/sdk/java/tinyos.jar:.
export MAKERULES=$TOSROOT/support/make/Makerules
export PATH=/opt/msp430/bin:$PATH

Depending on the directory and version you have installed, you may need to change TOSROOT to reflect the correct directory.

5. Install TinyOS Java Toolset:

I had issues with this one: you may not have to do this step if you just use the tinyos package provided by the Stanford repository.  However, I installed via CVS and had to install the TinyOS Java toolset manually.  Ensure that you have performed Step 4 and modified your .bashrc file before proceeding.

First, from the terminal, run:
$sudo tos-install-jni

This will install the Java Toolset into your Java directory.  For some reason I had Java 1.5 (5.0), Java 1.6 (6.0), and OpenJDK installed on Ubuntu.  Oddly, javac pointed to Java 1.5 and the java command pointed to OpenJDK, which was causing errors when running TinyOS Java apps like TestSerial.  To fix this, I removed Java 1.6 and OpenJDK since these seemed to be causing nothing but problems and just about everything runs on 1.4 or 1.5 (including TinyOS Java libraries).  Now java and javac point to Java 1.5 (Hopefully doing this didn't toast some other application).

You can then compile the TinyOS Java libraries by running the following in the terminal:
$cd $TOSROOT/support/sdk/java
$make

6. Install Graphviz
This step seems to be optional, but you need it if you want to run the Oscilloscope application.  In a terminal, run:
$sudo apt-get install graphviz

TinyOS wants an old version of Graphviz, but Oscilloscope seems to run fine.

7. Check your TinyOS Installation:
From a terminal, run:
$ tos-check-env

Running this, I have received errors about the Graphviz version, but the Oscilloscope application runs fine with the newer version.

To test your installation with Telos-based motes, try:
$ cd /opt/tinyos-2.x/apps/Blink
$ make telosb install.0 bsl,/dev/ttyUSB0

To test with Iris motes, try:
$cd /opt/tinyos-2.x/apps/Blink
$make iris install.0 mib510,/dev/ttyUSB0

To test the serial connection with Telos-based motes, try:
$cd /opt/tinyos-2.x/apps/tests/TestSerial
$make telosb install.0 bsl,/dev/ttyUSB0
$java TestSerial -comm serial@/dev/ttyUSB0:telos

To test the serial connection with Iris-based motes, try:
$cd /opt/tinyos-2.x/apps/tests/TestSerial
$make iris install.0 bsl,/dev/ttyUSB0
$java TestSerial -comm serial@/dev/ttyUSB1:iris

It seems that with the Iris, applications must be installed via the mib510 board (ttyUSB0) and data can be retrieved by accessing the mote itself (ttyUSB1).

7.  Issues
In addition to the Graphviz errors, for some reason the motelist command does not see the mib510 interface board or the Iris.  However, when I install to /dev/ttyUSB0 or listen to /dev/ttyUSB1, the installation works fine.  motelist does recognize the Iris on OS X, however.




(1 comment) - (Post a new comment)

tinyviz support
(Anonymous)
2009-02-25 05:28 pm UTC (link)
thanks for this blog
in internet i have read that tinyos 2.x does not work with tinyviz
andthat just tinyos 1.x work with tinyviz so is this the status
or i can work with tinyos 2.x and tinyviz together
but here i see that u are talking about 2.x and tinyviz together
so please help to know how is this
thnx in advance .
REGARDS .

(Reply to this)


(1 comment) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…