Tag Archives: Advanced Packaging Tool

Setting up TinyOS on Linux

The first step in our journey through the wondrous lands of Wireless Sensor Networks with TelosB and Micaz proved to be the most irritating and cumbersome one (for a linux n00b like me at least, I struggled for a fortnight with the setup -_- ).

Long story short, here’s the entire procedure given by Sachin.

This is what we follow for a fresh install, we are by no means saying this is the simplest or the only way to install TinyOS in Ubuntu, but we are kind of claiming its the most robust way we’ve come across.
Here’s the breakdown:
[For other people not to familiar with Linux, don’t copy the ‘$’ symbol, that just indicates you’re typing in terminal 😛 Ctrl+Alt+T to open terminal quickly by the way.]

Remove previously installed *-tinyos packages:

  • $ sudo dpkg -P `dpkg -l nesc ‘*tinyos*’ | grep ^ii | awk ‘{ print $2 }’ | xargs`
  • $ sudo apt-get clean

Edit sources.list:

Close the opened file. Now, back in terminal, use these commands

Rename the extracted tinyos directory tinyos-main and copy it into your home folder

Now, set up the tos environment

  • $ sudo gedit .bashrc

Add these lines to the end of the opened file :
[ ‘#’ is used to initiate comments]

  • # Here we setup the environment
  • # ‘<your_username>’ should be replaced with your own username
  • # like in my case its ‘sj’ so my ‘<your_username>’ is ‘sj’
  • # variables needed by the tinyos
  • # make system
  • export TOSROOT=“/home/users/<your_username>/tinyos-main“
  • 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”

Close the file.
Restart terminal.

You’re done! 😀

Check your TinyOS install by:

  • $ cd ~/tinyos-main/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!

Advertisements