Installing tinyos on Raspberry Pi

The Raspberry Pi is a credit-card-sized single-board computer developed in the UK by the Raspberry Pi Foundation. It makes programming the motes easy because it can be connected directly to the motes and the motes can be programmed without having to install tinyos or nesc and other tools for programming. This would help a lot of people to use the same tinyos installation without screwing with their operating system.

For this tutorial I am using a RASPBIAN-Debian Wheezy and you can download it from here.

After you burn your image and boot your raspberrypi for the first time don’t forget to run a sudo raspi-config and expand your root partition to fill the SD Card.

First we will install all the essentials required to compile nesC. To do this run the following command :

1. sudo apt-get update

2. sudo apt-get install emacs gperf bison flex git

After the above files are installed reboot your raspberrypi with sudo reboot -h now

Next we will clone the git repository from this link.  Type

git clone https://github.com/tinyos/nesc.git

cd nesc/

./Bootstrap

./configure

make

sudo make install

Next we will install the essentials for tinyos.

sudo apt-get install build-essential openjdk-6-jdk openjdk-6-jre python2.7 python2.7-dev automake avarice avr-libc msp430-libc avrdude binutils-avr binutils-msp430 gcc-avr gcc-msp430 gdb-avr subversion graphviz python-docutils checkinstall

After this is done go back to your home folder and type git clone https://github.com/tinyos/tinyos-main.git 

Now type sudo nano .bashrc and add the following lines to the end of the file

export TOSROOT=”/home/pi/tinyos-main-master”
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”

Almost done.

Now type source .bashrc

Now navigate to ~/tinyos-main-master/tools and execute the following commands

./Bootstrap

./configure

make

sudo make install

You’re done! 😀

Check your TinyOS install by:

cd ~/tinyos-main-master/apps/Blink

make telosb

The code should compile successfully and at the end of the compilation, the result would be similar to that of writing a tos-image.

Cheers!

2 comments

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.