Manual installation using RPM packages
Manual installation on your host OS with RPMs
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:
- Installing a Java JDK. Java is the most common way of interacting with mote base stations or gateways that are plugged into a PC or laptop.
- Windows only. Install Cygwin. This gives you a shell and many UNIX tools which the TinyOS environment uses, such as perl and shell scripts.
- Installing native compilers. As you're compiling code for low-power microcontrollers, you need compilers that can generate the proper assembly code. If you using mica-family motes, you need the AVR toolchain; if you're using telos-family motes, you need the MSP430 toolchain.
- Installing the nesC compiler. TinyOS is written in nesC, a dialect of C with support for the TinyOS concurrency model and component-based programming. The nesC compiler is platform-independent: it passes its output to the native compilers, so that it can take advantage of all of the effort put into their optimizations.
- Installing the TinyOS source tree. If you want to compile and install TinyOS programs, you need the code.
- Installing the Graphviz visualization tool. The TinyOS environment includes nesdoc, a tool that automatically generates HTML documentation from source code. Part of this process involves drawing diagrams that show the relationships between different TinyOS components. Graphviz is an open source tool that nesdoc uses to draw the diagrams.
Step 1: Install Java JDK
Download and install Sun's JDK from http://java.sun.com.
Step 2: Install Cygwin
This step is required for Windows installations only. If you are installing on Linux, skip to step 3.
- Download setup.exe and run it to install Cygwin.
- When the window pops up to allow you to select what packages to install, be sure to select:
Step 3: Install native compilers
Install the appropriate compiler based on your hardware and operating system.
Atmel AVR Tools
†If you receive an rpm error that indicates that you have a newer version already installed, try
rpm -Uvh --force
††If you receive an rpm error that indicates that you are missing /bin/sh, try
rpm -Uvh --force --nodeps
PXA27x Tools (iMote2)†
† Newer versions of GCC can be installed in certain cases. For further info see section iMote2 Compiler from this wiki.
††Copy jflashmm.tgz to /opt directory, untar it (tar xzf jflashmm.tgz), and make sure it's on your path (see Step 5). If the download link above doesn't work, try the cvs.
TI MSP430 Tools
...wow this is outdated. Don't use any of this. Use the debian packages or install from source. See the packaging folder in tinyos-main.
|jtag||Not yet available||msp430tools-jtag-lib-20031101cvs-20050610.i386.rpm|
|gdb||Not yet available||msp430tools-gdb-6.0-20050609.i386.rpm|
Renesas M16C (m32c-elf-gcc)
Step 4: Install TinyOS toolchain
The TinyOS-specific tools are the NesC compiler and a set of tools
developed in the
tinyos-2.x/tools source code repository. They are
also installed using rpms.
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.
Step 5: Install the TinyOS 2.x source tree
Now that the tools are installed, you need only install the tinyos 2.x source tree and then set your environment variables.
- Get the code from the TinyOS release repository:
wget http://github.com/tinyos/tinyos-release/archive/tinyos-2_1_2.tar.gz tar xf tinyos-2_1_2.tar.gz
This will extract the actual TinyOS code in a folder named
tinyos-release-tinyos-2_1_2inside the directory the command was iussed. Feel free to rename this folder to
- You will need to add some enviroment variables to your shell. The following file includes the necessary ones. Substitute the placeholder
<local-tinyos-path>with the path where you chose to place the code in the previous section (full path recommended).
# Here we setup the environment # variables needed by the tinyos # make system export TOSROOT="<local-tinyos-path>" export TOSDIR="$TOSROOT/tos" export CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java export MAKERULES="$TOSROOT/support/make/Makerules" export PYTHONPATH=$PYTHONPATH:$TOSROOT/support/sdk/python echo "setting up TinyOS on source path $TOSROOT"
Suppose you named this file
tinyos.env. There are now at least two possibilites to have these variables accessible in your shell:
- Place it as root user in
- Place it in
<local-tinyos-path>and add the following line to your
You can also add the contents of the file directly to the .bashrc.
To make the changes work, the easiest way is to open a new terminal window.
- Place it as root user in
- In order to program motes you will need to access the serial ports. This can be done by joining the group that grants this privilege. sudo gpasswd -a <your-user> dialout This change only takes effect when log out and log in again.
Step 5b (optional): Post-install fixes in Windows/Cygwin environment
If you later experience problems when building some tutorials, running Java tools, ... see Geoffrey Lo's excellent blog post, especially step 2.
Step 6: Installing Graphviz
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,
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.
you may need to download graphviz 1.1.0 here