Reference: http://tinyos.stanford.edu/tinyos-wiki/index.php/Installing_TinyOS_2.1.1
1. Update the source
Add the following line to the/etc/apt/sources.list
Deb Http://tinyos.stanford.edu/tinyos/dists/ubuntu Lucid Main
2. Perform the update
$ sudo apt-get update
3. Install TinyOS and all support Tools
$ sudo apt-get install tinyos-2.1.2
A long wait ....
4. Setting Environment variables
Since tinyos-2.1.2 below does not tinyos.sh this file, now create a new one.
cd /opt/tinyos-2.1.2sudo vim tinyos.sh (或者使用gedit编辑)
Enter the content:
#! /usr/bin/env bashexport TOSROOT="/opt/tinyos-2.1.2"export TOSDIR="/opt/tinyos-2.1.2/tos"export CLASSPATH="$CLASSPATH:$TOSROOT/support/sdk/java/tinyos.jar:."export MAKERULES="/opt/tinyos-2.1.2/support/make/Makerules"export PATH="/opt/msp430/bin:/opt/jflashmm:$PATH"
Next, edit the. BASHRC so that each time you start bash, the tinyos.sh script above will execute.
$ sudo vim ~/.bashrc (或者使用gedit编辑)
Add the following two lines at the end of the. bashrc file:
#Sourcing the tinyos environment variable setup scriptsource /opt/tinyos-2.1.2/tinyos.sh
Then update the settings for. BASHRC:
$ source ~/.BASHRC
5. Installing JNI and g++
$ sudo tos-install-jni$ sudo apt-get install g++
6. Turn off all terminals and restart the terminal to make sure that the settings you just made are in effect 7. Perform tos-check-env check whether the installation is complete
$ tos-check-env
There are typically two warning. One is that your Java version is wrong, not 1.4 or 1.5, and the other is that you have a problem with the Graphviz version. This can be ignored.
8. Testing
The blink is an LED flashing application that is now being compiled and tested for this application.
Modify Permissions for Blink
$ 777 /opt/tinyos-2.1.2/apps/Blink$ cd /opt/tinyos-2.1.2/apps/Blink$ make micaz sim
The following error may occur
The workaround is to install the Python-dev package and execute the following command:
$ sudo apt-get install python2.7-dev
Then execute make Micaz sim, and you can see that this compilation passed the
At this point, the tinyos-2.1.2 environment is basically completed, if there is a hardware environment, need to do further compilation and download testing.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Ubuntu-14.04 under Installation TinyOS-2.1.2