TinyOS (Telos) on OS X


Quick, Dirty, and Working Method for Telos
My loss is your gain! My system crashed in a big way, so this is exactly what I did to get telos back up and running.

Step 1
Install Developer tools (X Code 2.2) for os x, register here.

Step 2
Install wget, follow steps here

Step 3
Install FTDI for os x, drivers are
here

Step 4
Download TinyOS tree, I did it to my home directory, by opening a terminal and typing

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/tinyos login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x

Step 5
Install NESC whatnot, download from here. The latest build, nesc-1.1.2.tar.gz is the one to use. 1.2 is newer but I haven’t worked out how to link the ncc file to the mspgcc tools.

Step 6

Build MSPGCC toolchain. Go to the terminal, and in the tinyos-1.x directory type

cd tools/src/mspgcc
INSTALL_DIR=/usr/local/msp430

./build-mspgcc install

This step takes a while, relax, you’re halfway done!

Note: Joe includes the RCN servers to pull some files from, on 1/16/06 they were down. If they are down when you try, you need to remove build/, build-obj/ and archive/ from the mspgcc directory. Open up the .build-mspgcc script in a text editor, and change the lines that ask for the rcn server to:

http://ftp.gnu.org/gnu/gcc/gcc-3.2.3/gcc-core-3.2.3.tar.bz2

and

http://ftp.gnu.org/gnu/gcc/gcc-3.3.5/gcc-core-3.3.5.tar.bz2

and repeat the beginning of this step.

Step 7
Install javax.comm from files here.

Step 8
Install bsl (boot strap loader) in a terminal like so:

ln -s (PATH_TO_TOS)/tools/src/mspgcc-pybsl/bsl.py /usr/local/msp430/bin/msp430-bsl

Step 9
Make a .bashrc and .bash_profile. This is truly a pain in the ass. I’ve copied this garbage you’re about to encounter onto a few computer and it has worked, based on doing the steps above. YMMV. Let me know how it goes either way.

So make a file in your home directory, call it 「.bashrc」 if you don’t have one. If you do have one, add the follow data, making sure to append to variables when required. Replace the /Users/dan with whatever your homey is called.

source ~/.bash_aliases PS1=」w %」 CVS_RSH=SSH TOSROOT=/Users/dan/tinyos-1.x export TOSDIR=/Users/dan/tinyos-1.x/tos export MAKERULES=/Users/dan/tinyos-1.x/tools/make/Makerules SIMDIR=$TOSROOT/tools/java/net/tinyos/sim/ CLASSPATH=/Users/dan/tinyos-1.x/tools/java/net/tinyos/tools:/Users/dan/tinyos-1.x/tools/java:/Users/dan/tinyos-1.x/tools/java/jars/cup.jar:/Users/dan/tinyos-1.x/tools/java/jars/gwe.jar:/Users/dan/tinyos-1.x/t ools/java/jars/Jama-1.0.1.jar:/Users/dan/tinyos-1.x/tools/java/jars/javax.servlet.jar:/Users/dan/tinyos-1.x/tools/java/jars/jazz.jar:/Users/dan/tinyos-1.x/tools/java/jars/jdom.jar:/Users/dan/tinyos-1.x/tools/j ava/jars/JLex.jar:/Users/dan/tinyos-1.x/tools/java/jars/junit.jar:/Users/dan/tinyos-1.x/tools/java/jars/oalnf.jar:/Users/dan/tinyos-1.x/tools/java/jars/org.mortbay.jetty.jar:/Users/dan/tinyos-1.x/tools/java/ja rs/pgjdbc2.jar:/Users/dan/tinyos-1.x/tools/java/jars/plot.jar:/Users/dan/tinyos-1.x/tools/java/jars/plotapplet.jar:/Users/dan/tinyos-1.x/tools/java/jars/plotapplication.jar:/Users/dan/tinyos-1.x/tools/java/jar s/plotmlapplet.jar:/Users/dan/tinyos-1.x/tools/java/jars/pxgraphapplet.jar:/Users/dan/tinyos-1.x/tools/java/jars/xercesImpl.jar:/Users/dan/tinyos-1.x/tools/java/jars/xmlParserAPIs.jar:/Users/dan/tinyos-1.x/too ls/java:/Users/dan/tinyos-1.x/tools/java/jars/oalnf.jar:/Users/dan/tinyos-1.x/tools/java/jars/pxgraphapplet.jar:. export CLASSPATH PATH=/bin:/usr/X11R6/bin:usr/local/X11/bin:/Applications/Graphviz.app/Contents/MacOS:$HOME/opt/ImageMagick-6.2.5/bin PATH=$PATH:/usr/X11R6/lib:/usr/X11R6/include/X11:~/bin:/usr/local/bin PATH=$PATH:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/lib:/usr/local/msp430/bin:. umask 022 MANPATH=/usr/share/man:/usr/bin/man:/usr/local/man:/usr/local/share/man MANPATH=$MANPATH:/usr/X11R6/man:/usr/man export MANPATH export EDITOR=pico export MAGICK_HOME=」$HOME/opt/ImageMagick-6.2.5〞 export DYLD_LIBRARY_PATH=」$HOME/opt/ImageMagick-6.2.5/lib」 CFLAGS=」-traditional-cpp」 if [ ${#DISPLAY} -eq 0 ]; then export DISPLAY=’:0.0′ fi

OS X has some weirdness between X11 and Terminal. One uses .bashrc and the other .bash_profile. I forget which is which. The important thing is just to make a .bash_profile file and put this in it:

source .bashrc

Easy enough!Step 10
Make Tinyos. In the tinyos/ directory, type

make
make install

in the tinyos/tools/java/ directory edit the Makefile so it looks like this

# Top-level Makefile for tools/java

SUBDIRS = org net #jni

#INSTALLDIRS = jni

ROOT = .
include $(ROOT)/Makefile.include

and then type

make

Step 11
Go to $TOSROOT/tools/scripts. Run ./toscheck. Aside from a few errors regarding mica2’s (who uses those anyway?) you should be kosher. Congrats! Now you can gripe about nesc whatnot with the best of them!

arrow
arrow
    全站熱搜

    Bluelove1968 發表在 痞客邦 留言(0) 人氣()