2011年10月1日星期六

installation & env of tinyos2

Tinyos sw has two versions, the newest one is tinyos-2.1.1. I tried to install both on my os, but the toolchain which support the tinyos would totally mess up the environment and can not proceed to compile. So I tried to uninstall the tinyos-2.1.1. However, the apt-get autoremove failed to remove the packet and also can not install the tinyos again. Finally, I reinstall ubuntu and use the initial environment to run the program.


When doing apt-get from the server, it will install the toolchain include avr-binutil, avr-gcc, avr-libc, tinyos-tools,msp430 tools and nesc. After finishing doing the installation, I used gcc-v, python -v, java-verion, and nescc -v to check the environment. At last, I used tos-check-env to check the whole env. There are two warning which is jdk version should be 1.4 or 1.5 and the graphviz version is not right. I skipped it to do the test.

Some operation record:

//bug wit apt-get install, "decode error, etc"use this to remove the list
sudo rm /var/lib/apt/lists/* -vf

apt-get update

//still have the bug,find some bug with /etc/apt.conf, since use proxy server before, change it to
APT
{
//Options for apt-get
Get
{
Download-Only "false";
Show-UPgraded "true";
};
};

//still can not install the tinyos-2.1.1, reinstall the system. Tried a lot other method, not recorded here.

add the repository in /etc/apt/source.list
# deb http://tinyos.stanford.edu/tinyos/dists/ubuntu lucid main

apt-get update

sudo apt-get install tinyos-2.1.1

//change the env of tinyos.sh

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


//test the env
/* */
configuration SkelAppC {
}
implementation
{
components MainC, SkelC;

SkelC -> MainC.Boot;
}
Save as SkelAppC.nc
Take new file in gedit. Type follwing code
/*
The SKEL application */
module SkelC

{
uses interface Boot;

}
implementation
{

event void Boot.booted()
{
1;
}
}
Save the file as SkelC.nc
Take new file in gedit
Type following

COMPONENT=SkelAppC
include $(MAKERULES)

Save as Makefile

make telosb

//wrong, error: no Makerule
echo $MAKERULES
/opt/tinyos-2.1.1/support/make/Makerules

//the env setting is right, problem is the chmod of the file,
chmod 777 -R tinyos-2.1.1

make telosb

/usr/bin/../lib/gcc/msp430/4.5.3/../../../../msp430/include/signal.h:43:2: warning: #warning msp430-libc deprecated, using


//pass, then test Blink
error : /opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:227: syntax error before `;'


//It should be the problem of the version of msp430, I will use old version to try this model tomorrow.

The android env was deleted because of the reinstall of os. :(









没有评论: