TinyOS Documentation

Not logged in

TinyOS Documentation

TinyOS Installation

Note: If you just want to get a TinyOS development environment up and running quickly, it's much faster to simply use the pre-built TinyOS VM image. The original instructions for configuring a TinyOS development machine from scratch are below.

Deploying to motes

The easiest way I've found to connect a mote to the VM is to plug it into your host machine (waiting for it to be recognized by the OS) and then, from the VirtualBox VM menu, choose "Devices", "USB Devices", "XBOW Crossbox Telos Rev.B" (the name may be slightly different on your machine). (On Windows, the first time you do this it may need to install the VirtualBox USB adapter.) Now run

motelist

It should print a list of sensor motes attached to the system, something like this:

Reference  Device           Description
---------- ---------------- ---------------------------------------------
XBS5H4QG   /dev/ttyUSB0     XBOW Crossbow Telos Rev.B

The Device column is the device name that you will use to deploy a project, e.g.

make telosb reinstall bsl,/dev/ttyUSB0

To disconnect a mote, you should disable it from the VirtualBox Devices menu before unplugging it from your machine, so that the VM has a chance to shut it down.

Documentation sources for TinyOS, nesC, and the TelosB motes:

The TelosB motes run off the MSP430 microcontroller and the CC2420 (802.15.4) radio.

##TinyOS development machine detailed install

If you're using the "automatic installation" you may find that things go wrong when you try to install the TinyOS toolchain via Eric Decker's TinyProd repository (as of 3-14-2014). These instructions provide a workaround that will allow you to install a slightly-older version of the toolchain. Note that you should follow these instructions instead of Decker's.

First, to remove any traces of a previous (failed) install:

sudo dpkg -P `dpkg -l nesc '*tinyos*' | grep ^ii | awk '{ print $2 }' | xargs`
sudo apt-get clean
sudo rm /etc/apt/sources.list.d/tinyprod-debian.list
sudo add-apt-repository -r "deb http://tinyprod.net/repos/debian squeeze main"
sudo add-apt-repository -r "deb http://tinyprod.net/repos/debian msp430-46 main"

At this point, you should be able to do grep tinyprod /etc/apt/sources.list and not get any results. If you do see anything, do sudo nano /etc/apt/sources.list and delete any lines referencing the TinyProd repository.

Now, to do the install

sudo echo "deb http://tinyprod.net/repos/debian-old squeeze main" >> /etc/apt/sources.list.d/tinyprod-debian.list
sudo echo "deb http://tinyprod.net/repos/debian-old msp430-46 main" >> /etc/apt/sources.list.d/tinyprod-debian.list

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BD4DDD22F99BE531
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB5387FB34EC655A
sudo apt-get update

At this point, things diverge depending on whether you're running 32-bit or 64-bit.

32-bit

Run

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

(Some versions of Ubuntu have a bug in add-apt-repository that will result in the tinyprod repo being added as a source repository. As a result, you may see a couple of harmless error messages about not being able to retrieve Sources from them. These can be safely ignored.)

64-bit

Unfortunately, the TinyProd debian-old packages are not setup correctly for multi-arch installation, so we have to fool them with a virtual package.

sudo apt-get install ia32-libs
sudo apt-get install msp430-binutils-46 msp430-gcc-46 msp430-gdb-46
wget -O msp-base-virtual_0.0.2_all.deb "http://fossil.twicetwo.com/csci256.pl/raw/msp-base-virtual_0.0.2_all.deb?name=48a0a21fef3c5933c5bfe53188175485bef9fdbc"
sudo dpkg -i msp-base-virtual_0.0.2_all.deb
sudo apt-get install msp430-libc-46 msp430mcu-46
sudo apt-get install nesc tinyos-tools msp430-46 avr-tinyos

(Note that the wget command is a single, very long, command line.)

Both 32- and 64-bit

Finally, when you setup the environment variables (step 3), add the following to the list of exports:

export PATH=/opt/msp430-46/bin:$PATH

(Note that you will need to either start a new terminal, or source the tinyos.env file via source tinyos.env for these variables to take effect.)

At this point, everything should be installed and you should be able to run the following commands to print the version numbers of the TinyOS compilers:

ncc -v
msp430-gcc --version