mercredi 17 décembre 2008

Installing TinyOs in Ubuntu 8.10 IntrIepid Ibex

in the ~/.bashrc file
add at the end
# Set up TinyOS environment according to
# http://5secondfuse.com/tinyos/install.html
if [ -f ~/.bash_tinyos ]; then
. ~/.bash_tinyos
fi

create a .bash_tinyos and write
# Configuration file for tinyOS 2.0.2 in Ubuntu Intrepid Ibex

#write the path corresponding to you system configuration. Use $locate for finding the java files
#as you have installed java from tinyOS repository:
# Java
export JDKROOT=/usr/lib/jvm/java-1.5.0-sun
export JAVAXROOT=$JDKROOT
#if [ "$LD_LIBRARY_PATH" == "" ]; then
# # So Java can find libtoscomm.so and libgetenv.so
export LD_LIBRARY_PATH=$JDKROOT/jre/lib/i386
#fi
echo "Setting up for TinyOS 2.0.2"
export TOSROOT=/opt/tinyos-2.0.2
export TOSDIR=$TOSROOT/tos

export CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java/tinyos.jar:$TOSROOT/support/sdk/java/:.

export PYTHONPATH=:$TOSROOT/support/sdk/python/
export MAKERULES=$TOSROOT/support/make/Makerules

#DEPENDING OF YOUR OWN CONFIGURATION!!!!

export MSPGCCROOT=/usr/msp430


export PATH="$MSPGCCROOT/bin:$MSPGCCROOT/include:/usr/include/linux:/usr/bin:$PATH"

# Helpful aliases
alias sf="java net.tinyos.sf.SerialForwarder"
alias listen="java net.tinyos.tools.Listen"

alias apps="cd $TOSROOT/apps"
alias tos="cd $TOSROOT/tos"

# Environment changing functions

# Change this shell's environment to support Tinyos 2.x development
function tos2 () {
export TINYOS_VER=2
. ~/.bash_tinyos
}

# Change this shell's environment to support Tinyos 1.x development
function tos1 () {
export TINYOS_VER=1
. ~/.bash_tinyos
}

function setMoteCom () {
MOTE=`motelist -c| cut -d, -f2`

TYPE="telosb"

export MOTECOM="serial@$MOTE:$TYPE"
}

# Change ownership of the TinyOS directories to the TinyOS group
function tos-fix-permissions () {
echo "sudo may prompt you for your password."
sudo chown -R root:tinyos /opt/tinyos-*
sudo chmod -R g+w /opt/tinyos-*
sudo find /opt/tinyos-* -type d -exec chmod 2775 {} \;
}