Saturday 24 January 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

10 comments:

Gireesan said...

Hi pramod
I am also working in tinyos and sensor networks. Me too maintain a blog on tinyos
Nice to meet you here
regards
Gireesh

Unknown said...

Hi Pramod,

I am new to Ubuntu and TinyOS. I have to work in TinyOS, when i was searching for steps to install TOSSIM in ubuntu i saw ur blog. Going by ur steps i was able to install java. But when i come to the apt-get update
apt-get install tinyos

it throws a message 'unable to open lock'

what should i do to overcome this, i am using ubuntu 9.
i would appreciate if u could help.
Thanks
Mohanavalli

Unknown said...

root@debian:/opt/tinyos-2.1.0/apps/Blink# cd $TOSROOT/apps/Blink
root@debian:/opt/tinyos-2.1.0/apps/Blink# make micaz
mkdir -p build/micaz
compiling BlinkAppC to a micaz binary
ncc -o build/micaz/main.exe -Os -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb -DDEFINED_TOS_AM_GROUP=0x22 -finline-limit=100000 -DIDENT_APPNAME=\"BlinkAppC\" -DIDENT_USERNAME=\"root\" -DIDENT_HOSTNAME=\"debian\" -DIDENT_USERHASH=0x0dbc5c03L -DIDENT_TIMESTAMP=0x4a996362L -DIDENT_UIDHASH=0x2b0022eeL -fnesc-dump=wiring -fnesc-dump='interfaces(!abstract())' -fnesc-dump='referenced(interfacedefs, components)' -fnesc-dumpfile=build/micaz/wiring-check.xml BlinkAppC.nc -lm
avr-gcc: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.4' not found (required by avr-gcc)
make: *** [exe0] Error 1
root@debian:/opt/tinyos-2.1.0/apps/Blink#


i'm getting this error when i followed your steps.. Can u suggest me a solution?? Thanks..

Pramod ! said...

Sorry guys... saw the comments late.. I'm a bit lazy these days :)


Dear Gireesh.. Had gone through ur blog & Its nice to see your posts too.



Dear Mohana..
Sounds like you are not prefixing apt-get with sudo or running it as root? Type the following syntax:

sudo apt-get update &
sudo apt-get install tinyos

This will be followed by a request for your password.

Sudo (Super User DO) is the administrator mode.



Dear Khaja,
This is due to the lack of glibc 2.4 for AVR. Try installing the glibc from the repository.

Unknown said...

Hi Pramod,

While running the blink in simulator I am getting this error


make: *** No rule to make target `micaz'. Stop.

Please help me out.

Thanks Rajib

Pramod ! said...

@ Rajib...

Please check out this link !

http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg10881.html

Unknown said...

Hi, I have been trying to use simulator of tinyos :-TOSSIM
bt as soon as I enter command "make pc"
foloowing error occurs...




vineesh@vineesh-desktop:/opt/tinyos-2.1.0/apps/Blink$ make pc
/opt/tinyos-2.1.0/support/make/Makerules:168: ***

Usage: make
make help

Valid targets: all clean eyesIFX eyesIFXv1 eyesIFXv2 intelmote2 iris mica2 mica2dot micaz null shimmer telos telosa telosb tinynode tmote
Valid extras: appdoc cthreads docs dynthreads ident_flags nowiring safe savepp sim sim-fast sim-sf tframe threads tos_buildinfo tos_image tosboot tunit verbose wiring

Welcome to the TinyOS make system!

You must specify one of the valid targets and possibly some combination of
the extra options. Many targets have custom extras and extended help, so be
sure to try "make help" to learn of all the available features.

Global extras:

docs : compile additional nescdoc documentation
tinysec : compile with TinySec secure communication

ERROR, "pc ident_flags tos_image tosboot" does not specify a valid target. Stop.

Please help me..

Anonymous said...

Hi! І know this іs somewhat оff toρic but I was wondering which blog plаtfoгm aге yοu using for this websitе?
I'm getting sick and tired of Wordpress because I've haԁ pгoblems ωith hackеrs and Ι'm looking at alternatives for another platform. I would be fantastic if you could point me in the direction of a good platform.

Feel free to visit my page: raspberry ketone

Anonymous said...

Good dаy! Ι know thіs іs kіnda off toρic howevег , I'd figured I'd ask.
Wоuld уou be interеstеd in еxсhangіng
links oг maybe guest wгiting a blog artiсle οr vice-veгsa?
My blog ԁiscuѕses a lot of the samе topiсѕ
аs yоuгѕ аnd I bеlіeve
we could greаtly benefit fгom eaсh other.
If yоu mіght be іntereѕteԁ feel fгee to shoot mе an email.
І lοoκ forwаrd to hearing fгom you!

Awesome blοg by the ωaу!

Review my webpаge: credit card debt relief

Anonymous said...

Hi eѵerу one, here every person is sharіng these kindѕ of
knowledge, thеrefore it's fastidious to read this blog, and I used to go to see this webpage all the time.

Feel free to surf to my webpage - centrebet australia election