Tuesday, March 25, 2008

TinyOS 2.0 Installation Problems

Following this link (http://www.tinyos.net/tinyos-2.x/doc/html/install-tinyos.html) and setting up TinyOS 2.0 on cygwin took more than 3 hours for me, mainly because of these three problems, well finally I am able set it up properly and write programs to Micaz and Mica2.

My life would have been a lot easier had I known these three issues before hand. So here we go as a public service message. Leave comments if you run into problems I will try to answer them.


Error #1 : /bin/sh is needed by msp430tools-base-0.1-20050607
Solution: rpm --ignoreos --nodeps -ivh *.rpm

***My Environment variables***
TOSROOT: /opt/tinyos-2.x
TOSDIR: /opt/tinyos-2.x/tos
CLASSPATH: C:\tinyos2.0\cygwin\opt\tinyos-2.x\support\sdk\java\tinyos.jar
MAKERULES: /opt/tinyos-2.x/support/make/Makerules
PATH: /opt/msp430/bin:$PATH

Error #2
--> WARNING: CLASSPATH may not include '.' (that is, the symbol for the current
working directory). Please add '.' to your CLASSPATH or you may experience conf
iguration problems.
--> WARNING: No java in current path.
--> WARNING: No dot in current path.
--> WARNING: tos-check-env could not find the 'dot' executable which is part of
the AT&T Graphviz package. Please install version 1.1.0 of Graphviz if you'd lik
e to use the nescdoc documentation generator. If Graphviz is already installed,
then dot may not be in your PATH.

**Path Environment variable
./opt/msp430/bin:$PATH;"C:\Program Files\Graphviz2.16\Bin";C:\Java\jdk1.6.0\bin;
C:\cygwin\opt\tinyos-2.x\support\sdk\java\tinyos.jar

--> WARNING: CLASSPATH may not include '.' (that is, the symbol for the current
working directory). Please add '.' to your CLASSPATH or you may experience conf
iguration problems.

to solve this we are changing
CLASSPATH: c:\cygwin\opt\tinyos-2.x\support\sdk\java\tinyos.jar

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

------------------------
ERROR: when we compile the first program like, Blink a lot of error messages appear
***********fixing this problem `->' token
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:3238: error: ISO C++ forbids
Declaration of `Py_INCREF' with no type

*************
SOLUTION:
1- Go to Cygwin, with TinyOS stuff install, write "Python" to check the version, something like below will appear
$ python
Python 2.3.4 (#1, Jun 13 2004, 11:21:03)
[GCC 3.3.1 (cygming special)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.

2- Note down the version of Python mine is 2.3.4

3- Search for a file "sim.extra" in cygwin/tossim directory, use windows search if you like. its usually in
C:\cygwin\opt\tinyos-2.x\support\make

4- Open it in notepad, and find the link PYTHON_VERSION=2.5 and change it to PYTHON_VERSION=2.3 (depending on the version you checked before,
if its 2.3.4 change it to 2.3 if its 2.4.5 change it to 2.4 etc.)

5- Save the file, restart cygwin and compile again.

6- VoilĂ  *** Successfully built micaz TOSSIM library.
---------------------------

6 comments:

Anonymous said...

Yeah the python problem make it work, thank you very much.
-Sue

Anonymous said...

Dear Sir

Your blog save my life because I had the same problems with Tinyos 2.1 and cygwin WXP SP3 and your comments could help me

thanks in advance

Jorge

Unknown said...

Hi I am still struggling with CLASSPATH issue and tried your method too but its not working

Any other way to deal with it?

Regards,
jain

Anonymous said...

Thanks in favor of sharing such a fastidious idea, piece of writing is fastidious, thats
why i have read it completely

my web page - book promotion

Anonymous said...

I don't even know how I ended up here, but I thought this post was great. I don't know who you are but definitely you are going to a famous blogger if
you aren't already ;) Cheers!

My page; www.1grindmattsehmichajordanbofu2.com

Unknown said...

Please help!
I follow you commend but still have problem with this message:

tos-check-env completed with errors:

--> WARNING: No flex in current path.
--> WARNING: No bison in current path.
--> WARNING: No java in current path.