第一步:安装java jdk,请移步:http://www.oracle.com/technetwork/java/javase/downloads/index.html下载
尽量下载1.6版本吧。。别太新就行。我用的1.7 台式机用的1.6都是可以用的
配置jdk很简单了,解压到/usr/lib/jvm文件夹下,(没有就新建)。然后配置环境变量
配置到.bashrc或者/etc/profile下
最后添加:
#====================jdk profile ==================
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_13
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib/:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin:$PATH
然后source .bashrc或者source /etc/profile就好了~~
然后安装python = = sudo apt-get install python-dev g++
这个我没用到。。因为我的python和g++都有了~~自带了
deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
添加到/etc/apt/source.list里就行了
然后sudo apt-get update
然后sudo apt-get install tinyos-2.1.1
然后打开/opt/tinyos-2.1.1/support/make/sim.extra找到PYTHON_VERSION=2.x改成你外面python --version看到的
然后把/opt/tinyos-2.1.1/tinyos.sh里的改成CLASSPATH="$CLASSPATH:$TOSROOT/support/sdk/java/tinyos.jar:.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar"这样子就行了~
最后tos-install-jni出现done基本结束了~
假如出现各种问题~~例如普通用户有java root没有。。那么。。环境变量的问题~~
出现
BlinkAppC.nc:45:In component `HplMsp430GeneralIOC‘:/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:227: syntax error before `;‘/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:321: cannot find `P30‘/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:322: cannot find `P31‘/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:323: cannot find `P31‘/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:324: cannot find `P32‘/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:325: cannot find `P33‘/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:326: cannot find `P33‘/opt/tinyos-2.1.1/tos/chips/ms
请dpkg -l | grep msp430这里面的都卸载掉~然后:
http://tinyos.stanford.edu/tinyos/dists/ubuntu/full-listing/去这里下载对应系统的包:
例如32位的话:
这几个包就行了~
然后去make telosb试试就好了~
原文:http://blog.csdn.net/alps1992/article/details/25505459