wiki:node-tinyos

Version 8 (modified by fornasiero, 14 years ago) (diff)

--

FIRST DRAFT (poor english!!!)

Sensei Node Cookbook

This document includes instructions how to install and to run the SENSEI's tmotes software.

Table of Contents

  1. Introduction
  2. Installation steps: Ubuntu 10.04
    1. Setup TinyOS
    2. Install SENSEI software
  3. Usage:
    1. Launch the bridge
    2. Compile SENSEI tinyOS-node

Introduction

SENSEI's telosb node software is an applications that brings IPv6 network connectivity on telosb motes. When programmed with SENSEI software nodes can interact on the network like a COaP compliant webserver. Mote's resources can be reached from the web using a normal browser. Interaction with mote's resources is achieved using normal HTTP requests with GET, PUT and POST methods.

Installation steps: Ubuntu 10.04

Setup TinyOS

To install the software on telosb motes need a tinyOS 2.1 working copy see: http://www.tinyos.net for informations on tinyOS installation.

Add the following line to /etc/apt/sources.list

deb http://tinyos.stanford.edu/tinyos/dists/ubuntu lucid main
sudo apt-get update
sudo apt-get install tinyos-2.1.1
sudo apt-get install subversion

Set up your .bashrc variables to enable tinyos compilation toolchain:

# add the following line at the end of the file
source /opt/tinyos-2.1.1/tinyos.sh

To use tinyOS's java utilities you need sun java6: enable PARTNER repository: menu->system->administration->Software sources

install java6

sudo apt-get install sun-java6-jdk

# setting sun-java as default java provider
sudo update-alternatives --set java /usr/lib/jvm/java-6-sun/jre/bin/java
sudo update-alternatives --set javac /usr/lib/jvm/java-6-sun/bin/javac
sudo update-alternatives --set javac /usr/lib/jvm/java-6-sun/bin/java
#
sudo tos-install-jni

Install SENSEI software

To test the software you will need 3 things:

  • one or many nodes equipped with node-tinyos software
  • a program called "gateway" that needs to be running on a local machine
  • a bridge program that connects your sensei node with your local machine using another mote compiled with BaseStation? App

TODO: insert picture here?

You can checkout a copy of this software at:

$ svn --username [username]  co https://svn-batch.grid.pub.ro/svn/Sensei-WP5/

[The above command if ask for some security certificate exchange; Accept it [yes]]
[otherwise it prompt for the password for svn access]
Enter your password.

Compile and install the bridge

# you have to be root to do this
$sudo -i
$apt-get install build-essential automake
$cd /opt/tinyos-2.1.1/support/sdk/c/sf/
$./bootstrap
$./configure
$make
$cd /opt/tinyos-2.1.1/support/sdk/c/6lowpan/serial_tun/
$make
$exit

now you should have a working copy of "serial_tun"

Compile SENSEI gateway

The steps to compile the gateway are quite straightforward

# move to gateway folder
$cd gateway/
$sudo apt-get install g++ libssl-dev libxml2-dev

# Install socket++ library
gateway$ cd lib/Socket-2.3.7
gateway/lib/Sockets-2.3.7$ make clean
gateway/lib/Sockets-2.3.7$ make 
gateway/lib/Sockets-2.3.7$ sudo make install

# compile the gateway
gateway/lib/Sockets-2.3.7$ cd ../../
gateway$ make

Usage:

Launch the bridge

To test the software you have to equip a node with BaseStation? App that can be found in:

Sensei-WP5$ cd node-tinyos/BaseStation
Sensei-WP5/node-tinyos/BaseStation$  make telosb install.0 bsl,/dev/ttyUSB0

Now you can create the Bridge

$ sudo /opt/tinyos-2.1.1/support/sdk/c/6lowpan/serial_tun/serial_tun /dev/ttyUSB0 telosb

Compile SENSEI tinyOS-node

To compile and install the executable you've to move to node-tinyos directory

Sensei-WP5$cd node-tinyos

make install.NODE_ADDRESS bsl,NODE_USB_DEVICE