This tutorial is to install and configure the TinyOS development environment under Ubuntu11.10. Install jdk1. compile a source file sudogedit/etc/apt/sources. list. d/partner. list2. add debhttp: // us.archive.ubuntu.com/ubuntu/hardymultiverse3.to the file and return it to sudoapt-ge.
In this tutorial, install and configure the TinyOS development environment in Ubuntu 11.10.
1. Install jdk
1. Compile a source file
sudo gedit /etc/apt/sources.list.d/partner.list
2. Add:
deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
3. Save the file and exit. Execute
Sudo apt-get update
4. Final execution
Sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk
5. Configure JDK Environment Variables
Set the environment variables, modify. bashrc or. profile, and refer to the path to be decompressed by your system.
Export JAVA_HOME =/use/lib/jvm/java-6-sunexport PATH = $ JAVA_HOME/bin: $ PATHexport classPath =/use/lib/jvm/java-6-sun enter java in the terminal, javac check whether the configuration is correctIi. Install tinyosPython-dev g ++ needs to be installed,sudo apt-get install python-dev g++
Remember to check the python version, which needs to be set later in TinyOS
python --version
Next we will talk about how to install TinyOS
First, add a TinyOS Source
deb http://tinyos.stanford.edu/tinyos/dists/ubuntu natty main
Then update and install
sudo apt-get install tinyos-2.1.1
If you have not installed java before, java openjdk 1.6 is automatically installed here. After the installation is complete, tinyos will be placed under/opt /.
Open/opt/tinyos-2.1.1/support/make/sim. extra, find PYTHON_VERSION = 2.x, and change 2.x to the current python version. For example, if you use python -- version to view the result as "Python 2.7.3", you need to change it to 2.7.
Edit Environment Variables/opt/tinyos-2.1.1/tinyos.shFile, modify the CLASSPATH environment variable
export CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java/tinyos.jar:.
Note that there is a last point. Then, modify. bashrc and add
source /opt/tinyos-2.1.1/tinyos.sh
You can.
Install JNI
tos-install-jni
Use
tos-check-env
Check the environment, and the java and graphviz warning versions can be ignored directly. If you have any other errors, check whether the environment is not configured or what components are missing.
Now go to the directory/opt/tinyos-2.1.1/apps/Blink, make micaz and make micaz sim will be successful.
However, if the TOSSIM syntax is incorrect when using python, make a change.
Open the isim. extra (/support/make) file and find the PYDIR variable.
Original
# PYDIR = $ (shell python $ (PYTHON_VERSION)-config-prefix)/usr/include/python $ (PYTHON_VERSION)
Change
PYDIR =/usr/include/python $ (PYTHON_VERSION)
You can.Modify PLATFORM_LIB_FLAGS =-shared-L/usr/lib/python $ (PYTHON_VERSION)/config-L/$ (PYDIR)/config-Lstdc ++-lpython $ (PYTHON_VERSION)
SetRed part-L/$ (PYDIR)/configChange-L/binYou can.
So far, the entire installation process is complete.
3. nesC highlighted in vim
Download plug-ins of Version 2.0
Http://www.vim.org/scripts/script.php? Script_id = 1, 1847
Create a new folder named mkdir ~ in the/home directory ~ /. Vim copy the decompressed plug-in to this folder
Create a new file in the/home Directory (if it already exists, you do not need to create a new file). Add the following code in the file:
Augroup filetypedetect
Au! BufRead, BufNewFile * nc setfiletype nc
Augroup END
So far, the nesC code can be highlighted in vim.