Home

Ragemaster

Recent Entries

Ragemaster

View

Advertisement

November 11th, 2008

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.
I upgraded to Ubuntu Intrepid Ibex last night and now I can't connect to any WPA2 Enterprise networks.  Unencrypted works fine, but the school's WPA2 APs seem to be more pervasive.

This issue seems to be happening to a lot of people so I'm hoping someone is working on it.  That's the best thing about open source -- if something bothers you about the software you can change it yourself.  Unfortunately this problem isn't in my area of expertise and I have plenty of programming to do for a project of my own.

I should have waited at least a month after the release to upgrade instead of jumping right in.  New builds always have some serious problems that have to be worked out.  I hear on message boards that new vehicle models and redesigns of old ones are prone to all kinds of quirks during the first model year.  It's best to wait until the second year to buy one so all the issues can be worked out.  The same seems to go with electronics -- the first iPhone had no GPS and a terrible 2G data connection, while the second version fixed these issues.  And, of course, this quirkiness happens with software.  Windows XP was a mess when it first came out and Vista was worse when it came to drivers and stability.  XP is stable today (arguably), but Vista still has its problems.

Early adopters pay a high premium to get a product with limited functionality along with some unwanted side effects.  As I sometimes forget, it's best to wait until the problems have been worked out and the price comes down (if it's not free software).  Usually new and improved features get added in as the bugs get worked out.

So now I'm not even sure if I can drag my laptop around campus until this issue gets worked out.  Serves me right for just following the appeal of something new, but not necessarily better.
Powered by LiveJournal.com