If you already have a 1.x tree or an existing 2.x tree, you are better off following the upgrade instructions at upgrade-tinyos.html. There are several ways to install TinyOS. The first way is to install a live CD that gives you a virtualized Linux with a complete TinyOS install. Note that since this is on a CD, you can't modify anything; you can, however, make a LiveUSB device to use as your TinyOS install. The second way is to a Ubuntu-based virtual machine directly on your hard drive. The final way is to install TinyOS on your host operating system. When installing on a host operating system, you can either use a debian package repository or manually instally with RPMs.
Of the four options, installing a VM image is simplest. Using a Live CD lets you try out TinyOS without installing it on your drive. Debian packages are the simplest and best way to install TinyOS on your host operating system. RPMs are mostly a stand-by for RedHat or other Linux distributions, as well as Windows/Cygwin users. If you are using Cygwin, we strongly recommend using a VM image, unless you are completely unfamiliar with UNIX tools such as editors (xemacs, vi) and the shell,
Download a Linux live CD that has a TinyOS installation on it. All you need to do is download the CD image, burn it onto a CD, and install from there. This saves you all of the complexities of installation, and it's the recommended way to install TinyOS. The link above has complete instructions. The live CD is provided by the Toilers group at the Colorado School of Mines.
If you are running a version of Linux that supports Debian packages, then you may want to use the TinyOS package repository. There is a story on www.tinyos.net that describes how to use it. If you do this, then you do not have to install the instructions here, except that you will need to check that your environment is set up correctly (the end of step 5 in the manual installation.
Currently, the TinyOS Core Working Group supports TinyOS on two platforms: Cygwin (Windows) and Linux. There have been some successful efforts to getting TinyOS environments working on Mac OSX, but OSX is not supported by the Core WG.
Installing a TinyOS enviromnent has five basic steps; Windows requires an extra step, installing Cygwin, which is a UNIX-like environment. The steps are:
Linux Download and install IBM's 1.5 JDK from http://www-128.ibm.com/developerworks/java/jdk/.
We have put online the cygwin packages that we've confirmed to be compatible with TinyOS. The instructions below use those packages. You can also upgrade your cygwin environment according to the instructions at www.cygwin.com and your environment will most likely work. A large number of TinyOS users, upgrade their cygwin packages at least monthly from cygnus. However, since we can't test what packages are compatible as they become available daily, we can't confirm that today's set will work.
$ cd /cygdrive/c/newcygpkgs $ tar zxvf cygwin-1.2a.tgzThis unzips the packages.
Install the appropriate version of the following (Windows or Linux, avr or msp430 or both) with the rpm command 'rpm -ivh rpm>'. On windows, if you get an error claiming that the rpm was build for an NT computer and you're on a windows NT computer, bypass the erroneous error by using 'rpm -ivh --ignoreos rpmname'. (We have xscale compiler tools online at http://www.tinyos.net/dist-1.2.0/tools/ but they have not yet been extensively tested by a large community.)
Atmel AVR ToolsTool | Windows/Cygwin | Linux |
avr-binutils† | avr-binutils-2.15tinyos-3.cygwin.i386.rpm | avr-binutils-2.15tinyos-3.i386.rpm |
avr-gcc | avr-gcc-3.4.3-1.cygwin.i386.rpm | avr-gcc-3.4.3-1.i386.rpm |
avr-libc | avr-libc-1.2.3-1.cygwin.i386.rpm | avr-libc-1.2.3-1.i386.rpm |
avarice | avarice-2.4-1.cygwin.i386.rpm | avarice-2.4-1.i386.rpm |
insight (avr-gdb) | avr-insight-6.3-1.cygwin.i386.rpm | avr-insight-6.3-1.i386.rpm |
rpm -Uvh --force
TI MSP430 Tools
--ignoreos
option.
Finally, there are two Linux versions of tinyos-tools, depending
on whether you have a 32-bit or 64-bit machine. The first is the
i386 RPM and the second is the i686 RPM. If you have a 64-bit
Java VM, it is important that you install the i686 RPM or otherwise
the Java support may not work properly.
TinyOS-specific Tools
Tool | Recommended Windows/Cygwin | Other Windows/Cygwin | Linux | Command |
NesC | nesc-1.2.8a-1.cygwin.i386.rpm | nesc-1.2.8b-1.cygwin.i386.rpm | nesc-1.2.8a-1.i386.rpm | rpm -Uvh rpm -Uvh --ignoreos (if Cygwin complains) |
Tool | Windows/Cygwin | 32-bit Linux | 64-bit Linux | Command |
tinyos-tools | tinyos-tools-1.2.4-2.cygwin.i386.rpm | tinyos-tools-1.2.4-3.i386.rpm | tinyos-tools-1.2.4-3.i686.rpm | rpm -ivh --force (1.x tree)rpm -Uvh (no 1.x tree) |
Now that the tools are installed, you need only install the tinyos 2.x source tree and then set your environment variables. Install the appropriate version of the following (Window or Linux) with the rpm command 'rpm -ivh rpm'. As with the previous rpms, if you get an error claiming that the rpm was build for an NT computer and you're on a windows NT computer, bypass the erroneous error by using 'rpm -ivh --ignoreos rpmname'.
Windows/Cygwin | Linux | |
TinyOS | tinyos-2.0.2-2.cygwin.noarch.rpm | tinyos-2.0.2-2.noarch.rpm |
Ideally, you'll put these environment variables in a shell script that will run when your shell starts, but you needn't put such a script under /etc/profile.d.
The example settings below assume that the tinyos-2.x installation is in /opt/tinyos-2.x. Change the settings to be correct for where you've put your tinyos-2.x tree. Note that the windows CLASSPATH must be a windows-style path, not a cygwin path. You can generate a windows style path from a cygwin-style path using 'cygpath -w'. For example:
export CLASSPATH=`cygpath -w $TOSROOT/support/sdk/java/tinyos.jar` export CLASSPATH="$CLASSPATH;."TinyOS 2.x
Environment Variable | Windows | Linux | |
TOSROOT | /opt/tinyos-2.x | same as in Cygwin | |
TOSDIR | $TOSROOT/tos | same as in Cygwin | |
CLASSPATH | C:\tinyos\cygwin\opt\tinyos-2.x\support\sdk\java\tinyos.jar;. | $TOSROOT/support/sdk/java/tinyos.jar:. | |
MAKERULES | $TOSROOT/support/make/Makerules | same as in Cygwin | |
PATH† | /opt/msp430/bin:$PATH | same as in Cygwin |
In addition to the above environment variables, do the following on Linux machines:
chown -R <your uid> /opt/tinyos-2.x
chmod 666 /dev/<devicename>
Finally, if you have installed TinyOS 2.0.1, there is a bug in TOSSIM (which will be fixed in 2.0.2). The bug is in file tos/chips/atm128/sim/atm128_sim.h. Change these lines 22 and 23 from:
#define _SFR_IO8(io_addr) _MMIO_BYTE((io_addr) + 0x20) #define _SFR_IO16(io_addr) _MMIO_WORD((io_addr) + 0x20)
to
#define _SFR_IO8(io_addr) _MMIO_BYTE((io_addr)) #define _SFR_IO16(io_addr) _MMIO_WORD((io_addr))
If you do not do this, then timers will not work correctly.
Go to download page of the Graphviz project and download the appropriate RPM. You only need the basic graphviz RPM (graphviz-); you don't need all of the add-ons, such as -devel, -doc, -perl, etc. If you're not sure what version of Linux you're running,
uname -a
might give you some useful information. Install the rpm with rpm -i rpm-name. In the case of Windows, there is a simple install program, so you don't need to deal with RPMs.