TinyOS安装
以下安装基于ubuntu12.04,在普通用户下操作:
1、首先添加源:sudo gedit /ect/apt/sources.list
打开后,在最后一行输入deb http://tinyos.stanford.edu/tinyos/dists/ubuntulucid main
2、更新 sudo apt-get update
3、sudo apt-get install tinyos-2.1.2 (这里最好选择这个,不然会出现msp430的问题,2.1.2版本貌似修复了这一问题)
4、sudo gedit ~/.bashrc
最后一行增加:source /opt/tinyos-2.1.2/tinyos.sh
然后更新下source ~./bashrc
注意:这时候有的安装情况会出现提示bash: /opt/tinyos-2.1.2/tinyos.sh: 没有那个文件或目录
这时候我们可以编写一个tinyos.sh: 执行 sudo gedit /opt/tinyos-2.1.2/tinyos.sh ,并输入:
#! /usr/bin/env bash
# Here we setup the environment
# variables needed by the tinyos
# make system
echo "hello ,walfred,Setting up forTinyOS 2.1.2"
export TOSROOT=
export TOSDIR=
export MAKERULES=
TOSROOT="/opt/tinyos-2.1.2"
TOSDIR="$TOSROOT/tos"
CLASSPATH=$CLASSPATH:/opt/tinyos-2.1.2/support/sdk/java/tinyos.jar:.
MAKERULES="$TOSROOT/support/make/Makerules"
export TOSROOT
export TOSDIR
export CLASSPATH
export MAKERULES
关闭并保存文件
执行更新:source ~./bashrc
5、安装 sudo tos-install-jni 一般情况下这个已经装好了:
6、安装g++ sudoapt-get install g++
7、安装 python sudo apt-get installpython2.7-dev (这里有好几个版本,我选择2.7的)
到这里tinyos的安装就OK了
8、可以进入Blink程序编译测试下
make telosb
eclipse for tinyos
下面开始安装eclipse 和 eclipse for tinyos
参考文档:http://en.wikipedia.org/wiki/TinyOS
安装要求:
- Eclipse 3.5 or newer. The plug-in still works on Eclipse 3.4.2, but support may stop with any new update.
- The Graphical Editing Framework, this will be installed automatically when using Eclipse 3.4
- Java 1.6. The plug-in still works with Java 1.5, but support may stop with any new update.
- If using the debugger or the search: Java 1.6
- If using the debugger: The C development tools, this will be installed automatically when using Eclipse 3.4
- A Linux system, e.g. Ubuntu or a Windows XP system. MacOS, Solaris, and Windows Vista are not tested. The plug-in is optimized for Linux.
- If using the debugger: A Linux system.
- A complete installation of TinyOS 2.x. On windows that means that cygwin has to be installed.
- TinyOS applications must compile from the command line
- The plugin has a size of ~3 MB
安装步骤:
1、sudo apt-get install eclipse 安装eclipse
2、打开ecllipse help->install new software->add
Enter the update site http://tos-ide.ethz.ch/update/site.xml into the dialog.
安装完毕,设置环境变量
Window->Preferences->TinyOS->Environments
检查各个目录,点击 Apply , OK ,设置完毕。
8 )检查 TinyOS 的安装
TinyOS->Check Installation