星期六, 十一月 21, 2009

Installing TinyOS-2.x in Ubuntu intrepid (8.10)


Thank to

http://nmlaxaman.blogspot.com/2009/01/installing-tinyos-2x-in-ubuntu-intrepid.html

To Install java on your intrepid use the following command:

sudo apt-get install sun-java5-jre sun-java5-jdk sun-java5-plugin

To verify that the correct version of Java is installed the following command can be used:
java -version

This command will print the current version of java that is active. Should there be more than one version of Java be installed on the operating system, the following command can be used to list the available java versions:

update-java-alternatives -l

This command list all the available Java runtime environments on the Ubuntu system. To change from one version to another, the following command can be used:

sudo update-java-alternatives -s < JRE version >

Mostly 'JRE version' needs to be one of the folder name under /usr/lib/jvm/

Once java is installed sucessfully the follow the points below.

1) add bellow repository to your
/etc/apt/sources.list. Though it is for hardy, it is working for intrepid also

deb http://tinyos.stanford.edu/tinyos/dists/ubuntu hardy main

2) with following commands you can update the apt-cache and search the required packages thin you can install the required version and all.

apt-get update
apt-cache search tinyos
apt-get install tinyos-2.1.0

3) then install python development package (headers)

apt-get install python-dev

4) Edit /opt/tinyos-2.1.0
/tinyos.sh and change the CLASSPATH env-variable as bellow

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

4) Import /opt/tinyos-
2.1.0/tinyos.sh in your .bashrc; include bellow code snippet to ~/.bashrc

if [ -f /opt/tinyos-
2.1.0/tinyos.sh ] ; then
. /opt/tinyos-
2.1.0/tinyos.sh
fi

5) Now execut bash again or restart the terminal and chech your enviorenment with bellow command. It will check the enviorenment and report you the status. (Ignore the WORNING returned due to graphvis version)

tos-check-env

6) Lets compile the first application

cd $TOSROOT/apps/Blink
make micaz

for simulator

make micaz sim

没有评论: