Basic Platform 1. Operating System: Ubuntu12.042. hardware node: Micaz node XJTUUbuntu Source: http://ubuntu.xjtuns.cn/Ubuntu12.04PrecisePangolindebhttp://ubuntu.xjtuns.cn/ubuntu/precisemainrestricteduniversemultiverse
Basic Platform
1. Operating System: Ubuntu 12.04
2. Hardware node: Micaz Node
XJTU Ubuntu Source: http://ubuntu.xjtuns.cn/
Ubuntu 12.04 Precise Pangolin
Deb http://ubuntu.xjtuns.cn/ubuntu/ precise main restricted universe multiverse
Deb http://ubuntu.xjtuns.cn/ubuntu/ precise-backports main restricted universe multiverse
Deb http://ubuntu.xjtuns.cn/ubuntu/ precise-proposed main restricted universe multiverse
Deb http://ubuntu.xjtuns.cn/ubuntu/ precise-security main restricted universe multiverse
Deb http://ubuntu.xjtuns.cn/ubuntu/ precise-updates main restricted universe multiverse
Deb-src http://ubuntu.xjtuns.cn/ubuntu/ precise main restricted universe multiverse
Deb-src http://ubuntu.xjtuns.cn/ubuntu/ precise-backports main restricted universe multiverse
Deb-src http://ubuntu.xjtuns.cn/ubuntu/ precise-proposed main restricted universe multiverse
Deb-src http://ubuntu.xjtuns.cn/ubuntu/ precise-security main restricted universe multiverse
Deb-src http://ubuntu.xjtuns.cn/ubuntu/ precise-updates main restricted universe multiverse
Procedure
1. Installation preparation:
If the system does not have python Development Environment Support and g ++ compilation tools:
$ Sudo apt-get install python-dev
$ Sudo apt-get install g ++
2. perform operations according to official steps. Make sure to modify the settings ~ /. Tinyos version number in the bashrc file: http://docs.tinyos.net/tinywiki/index.php/Installing_TinyOS_2.1.1#Two-step_install_on_your_host_ OS _with_Debian_packages
3. In the latest version 2.1.2, The tinyos. sh file is missing under/opt/tinyos-2.1.2/, You need to edit and add the following:
# Installation by substituting/opt for the actual tinyos tree
# Installation point
TOSROOT = "/opt/tinyos-2.1.2"
TOSDIR = "$ TOSROOT/tos"
CLASSPATH = "$ TOSROOT/support/sdk/java/tinyos. jar :."
MAKERULES = "$ TOSROOT/support/make/Makerules"
Export TOSROOT
Export TOSDIR
Export CLASSPATH
Export MAKERULES
Close and restart the terminal or $ source ~ /. Bashrc to make the configuration take effect.
4. Modify/opt/tinyos-2.1.2/folder permissions, $ chown-R username/opt/tinyos-2.1.2/
5. install tos-install-jni, $ sudo tos-install-jni
6. check whether the installation is correct: $ sudo tos-check-env usually has two warnings. One is that your Java version is incorrect, not 1.4 or 1.5; the other is that there is a problem with graphviz version, can be ignored.
7. Check whether the tinyos compilation system is available: $ printenv MAKERULES
"/Opt/tinyos-2.1.2/support/make/Makerules" information appears, available for normal use.
8. finally enter the/opt/tinyos-2.1.2/apps/Blink directory, compile the Blink application, enter the following command for simulation Compilation: $ make micaz sim
If the "Successfully built micaz TOSSIM library" information is obtained, the compilation is successful and the environment is installed Successfully.
Download and test on the micaz Node
1. Confirm serial port device name: $ ls/dev/ttyU *
Display:
Then, the USB port number is 0.
2. Set the port attribute to writable: $ sudo chmod 666/dev/ttyUSB0 (usb-device-name)
3. Download the program to the node: $ make micaz reinstall mib510,/dev/ttyUSB0, and the result is:
If each node is marked: $ make micaz reinstall. ID mib510, serialport
4. make tinynode reinstall device-type. The difference between serialport and make tinynode install device-type and serialport: reinstall directly writes compiled code to the serial port, while install first compiles the source file into executable code, then write it to the serial port.
5. After the program is downloaded, the node's LED lights will flash continuously based on the binary number between 2 and 7 seconds.
Enable nesC to highlight in vim
Reference: http://www.vim.org/scripts/script.php? Script_id = 1, 1847
1. Download the compressed Version 2.0 package: vim.tar.gz; If Vim is not installed, install $ sudo apt-get install vim.
2. follow these steps:
Untar the files ~ /. Vim/
Tar zxvf vim.tar.gz
Add the following into the end ~ /. Vimrc
Augroup filetypedetect
Au! BufRead, BufNewFile * nc setfiletype nc
Augroup END
If not ~ /. Vim/folder is created, $ mkdir ~ /. Vim/. If no ~ The/. vimrc file is also created.
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2