Comunicación entre Motes
description
Transcript of Comunicación entre Motes
![Page 2: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/2.jpg)
NesC Lenguaje de programación
orientado a componentes.
El usuario crea un componente ayundándose de otros ya creados
![Page 3: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/3.jpg)
Componente Configuración e Implementación ( miaplicacion.nc) Módulos (miaplicacionM.nc) librerias (.h) Lógicamente 3 partes Configuración Implementación Módulos
![Page 4: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/4.jpg)
El componente La biblioteca de componentes de TinyOS
incluye protocolos de red, servicios distribuidos, drivers de sensores y herramientas de adquisición de datos.
"Un componente posee tres grandes secciones que son: Configuration, Implementation,
Module. Estas tres secciones han de estar obligatoriamente presentes en cualquier componente aunque puedan estar vacías."
![Page 5: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/5.jpg)
Tipos de Datos uint16_t , es un entero sin signo de 16 bit
uint8_t , entero de 8 bit
bool , booleano ( TRUE , FALSE )
result_t , es un boolean pero ( SUCCES , FAIL )
Tipos de C
![Page 6: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/6.jpg)
Instalación TinyOS 1.1.10 (Windows)Borrar todas las versiones previas de Cygwin.
Ir a http://www.tinyos.net/dist-1.1.0/tinyos/windows/
Descargar: tinyos-1.1.11-3is.exe 166M
Ó tinyos-1.1.11-2bis.zip 165M
Instalar *.exe,incluye Cygwin, NesC Java software.
![Page 7: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/7.jpg)
Instalación TinyOS 1.1.10 (Windows)
Java Communication API packageContiene soporte para los puertos paralelos y seriales de PC en windowsSe necesita instalar la API antes que intentar ejecutar un programa Java en el
PC para el intercambio de datos con un mote
http://java.sun.com/products/javacomm/downloads/index.html
Click en “Download Version 2.0 for Microsoft Windows and Solaris/x86”
Descargar para plataforma Windows.Descomprimir en un directorio“commapi”.Ir a “commapi”, y abrir “Readme.html”.
![Page 8: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/8.jpg)
JVM (Java Virtual Machine) Se pueden tener múltiples máquinas virtuales
instaladas en un PC. Copiar el comm.jar a: java/j2sdk1.4.0/jre/lib/ext/
Cuando se instala un jdk: C:\Program Files\Java\jdk1.5.0_01 C:\Program Files\Java\jre1.5.0_01
Para ejecutar una aplicación se usará jre C:\Program Files\Java\jre1.5.0_01\bin\java
http://www.tinyos.net/windows-1_1_0.html
![Page 9: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/9.jpg)
Instalación (Wizard) TinyOS 1.1.9 en Windows
http://www.tinyos.net/windows-1_1_0.htmlLlenar formulario
Una manera fácil de instalar todo lo necesario para TinyOS 1.1.9 es descargando todos los archivos de http://tinyos.net/telosb el cual es un wizard que incluye todo lo necesario para el desarrolo con telosb.
Autorun.inf 09-Dec-2004 15:02 1k Data1.cab 09-Dec-2004 15:32 161M Setup.skin 09-Dec-2004 15:32 67k TinyOS.msi 09-Dec-2004 15:32 1.3M setup.exe 09-Dec-2004 15:33 4.3M tinyos-1.1.9telosb-1.cygwin.noarch.rpm
![Page 10: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/10.jpg)
Wizard TinyOS 1.1.10 (Windows)Incluye todos los paquetes descritos en esta ventana
![Page 11: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/11.jpg)
Instalación TinyOS 1.1.10 (Ubuntu) Descargar desde el siguiente link:Descargar desde el siguiente link:http://www.tinyos.net/dist-1.1.0/tinyos/linux/Son paquetes .rpm (RedHat)Se debe utilizar alien para convertirlos en paquete debianLuego descargar nesc
Se puede bajar vía CVS (el paquete rpm) actualizado
![Page 12: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/12.jpg)
Instalación TinyOS 2.0 Ubuntu edgy Editar el archivo /etc/apt/sources.list con cualquier editor de texto ejm: nano /etc/apt/sources.list
Agregar la siguiente dirección:
deb http://tinyos.stanford.edu/tinyos/dists/ubuntu edgy main
Guardar y salir (CTRL+O) y (CTRL X).
Actualizar los repositorios:
$ apt-get update
Instalar los paquetes: $ apt-get install tinyos tinyos-avr tinyos-msp430 tinyos-tools nesc
![Page 13: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/13.jpg)
Instalación TinyOS 2.0 Ubuntu edgy Agregar al final de gedit $HOME/.bashrc las siguientes lineas:
TOSROOT=/opt/tinyos-2.xTOSDIR=$TOSROOT/tosCLASSPATH=$TOSROOT/support/sdk/java/tinyos.jar:.MAKERULES=$TOSROOT/support/make/MakerulesPATH=/opt/msp430/bin:$PATHexport TOSROOT TOSDIR CLASSPATH MAKERULES PATH
# Javaexport JDKROOT=/usr/lib/jvm/java-1.5.0-sunexport JAVAXROOT=$JDKROOT
# Ubuntu 6.10 comes with gcc 4.1 which is currently broken with TOSSIM so we'll# use gcc/g++ 4.0export CC=gcc-4.0export CXX=g++-4.0
![Page 14: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/14.jpg)
Script para fácil manejo entre versionesTinyOS 1.1 y TinyOS 2
http://5secondfuse.com/tinyos/install.html
Agregar en archivo .bashrc
# http://5secondfuse.com/tinyos/install.htmlif [ -f ~/.bash_tinyos ]; then . ~/.bash_tinyosfi
Crear archivo .bash_tinyos en home del usuario
Referencia: http://5secondfuse.com/tinyos/.bash_tinyos
![Page 15: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/15.jpg)
Instalación TinyOS 2.0 Ubuntu edgy Links
http://doutdex.wordpress.com/tag/tinyos/ http://jeanpaulberrios.wordpress.com/tinyos/ http://5secondfuse.com/tinyos/install.html
![Page 16: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/16.jpg)
Xubuntos CD live
XubunTOS Xubuntu 6.10 TinyOS 2.0.1 paquetes Debian + TinyOS 1.x CVS repositorio
Referencia: http://toilers.mines.edu/Public/XubunTOS
![Page 17: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/17.jpg)
Estructura Tiny OS 1.1
![Page 18: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/18.jpg)
Directorios TinyOS
/apps – Aplicaciones /tos/interfaces – Interfaces que ofrecen los interfaces al
menos para las componentes primitivos.
/tos/system – Las componentes primitivos del TinyOs /tos/types – ficheros que contiene los tipos de datos
ej: AM.h contiene la estructura de un mensaje TOSMsg )
![Page 19: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/19.jpg)
Un ejemplo de la aplicación blink
Compilar aplicación en XUBUNTOS cd /opt/tinyos-1.x/apps/blink make pc
Ejecutar aplicación Tossim: cd /opt/tiny-1X/apps/Blink/build ./main –p 1 1
uso: ./main [-h|--help] [-r <static|simple>] [-p sec] num_nodes In the projects, we will use
“–r simple” which is default “-p pause-seconds” num_nodes =1
Creación de documentación: cd /opt/tiny-1X/nest/apps/blink
$make pc docs cd /opt/tiny-1X/nesc/index.html
![Page 20: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/20.jpg)
TOSSIM simulación Compilo para PC : make pc /build/pc tendre el ejecutable Invocacion: ./ejecutable [parametros] node motas -nodbgout No debug por la stdout -gui Espera a TinyViz -b Arranca los motes en n segundos
![Page 21: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/21.jpg)
IDE para programar NesC Emacs
Eclipse plugin CATANA
![Page 22: Comunicación entre Motes](https://reader036.fdocument.pub/reader036/viewer/2022081503/568148f0550346895db60fec/html5/thumbnails/22.jpg)
FIN