.
Instituto Politécnico da Guarda
Escola Superior de Tecnologia e Gestão | Departamento de Engenharia Informática
WebSensing
Plataforma de transmissão de vídeo e rede de sensores
Pedro Manuel Pinto Teixeira
.
Instituto Politécnico da Guarda
Escola Superior de Tecnologia e Gestão | Departamento de Engenharia Informática
Web
Sensing
Relatório do projecto,
Licenciatura em Engenharia Informática, 2005/2006
Autor
Pedro Manuel Pinto Teixeira Instituto Politécnico da Guarda ppinto@ipg.pt
Orientador IPG
Mestre Sérgio Augusto Bernardes Duarte Instituto Politécnico da Guarda
Escola Superior de Tecnologia e Gestão – Departamento de Informática sduarte@ipg.pt
Orientador DEI Dr. Jorge Sá Silva Universidade de Coimbra
Departamento de Engenharia Informática sasilva@dei.uc.pt
Aos meus pais
À minha irmã
A ti, Carla
.
Instituto Politécnico da Guarda
Escola Superior de Tecnologia e Gestão | Departamento de Informática
Resumo
Palavras-Chave:Streaming de vídeo, Contiki, Redes de Sensores sem fios, Embedded Sensor Board Na investigação e desenvolvimento de muitas tecnologias torna-se necessário a existência de uma plataforma de apoio que permita realizar testes reais e aplicar alguns conceitos teóricos.
A plataforma WebSensing pretende criar uma “base” onde seja possível testar transmissões de vídeo para diferentes dispositivos, assim como a transmissão de parâmetros do ambiente (temperatura, movimento) capturados por cada nó sensor. O streaming de dados é realizado através de uma webcam que exerce a função de captura de imagem e por mecanismos programados na plataforma, que permitem adaptar o fluxo de dados aos mais diversos dispositivos. No futuro pretende-se que cada nó sensor, através da câmara integrada, tenha a capacidade de envio de imagem para os mais diversos dispositivos.
Abstract
Keywords: Vídeo Streaming, Contiki, Network wireless sensor, Embedded Sensor Board
In the research and development of many technologies it is crucial the existence of a support platform that enables the accomplishment of real tests and the application of theoretical concepts.
The WebSensing platform allows the creation of a “base” where it will be possible to verify transmissions of video to several kinds of devices, as well as the transmission of environment parameters (temperature, movement) captured by each sensor node. The data streaming is sent through a webcam, that performs the image capture and by mechanisms integrated in the platform, that allow the adequacy of the data captured to several devices.
In the future it is intended that each sensor node, using the integrated camera, will have the ability of sending images to the several devices.
.
vi
Instituto Politécnico da Guarda
Escola Superior de Tecnologia e Gestão | Departamento de Informática
Índice
1. INTRODUÇÃO ... 1 1.1 AMBIENTE DO PROJECTO ... 1 1.2 OBJECTIVOS DO PROJECTO ... 2 1.3 ESTRUTURA DO RELATÓRIO ... 3 2. PROTOCOLOS E TECNOLOGIAS ... 42.1 WHYCRY –“O PONTO DE PARTIDA” ... 4
2.2 VÍDEO ... 5
2.2.1 Transmissão de vídeo para diferentes dispositivos ... 5
2.2.2 Dispositivos e formatos de vídeo ... 7
2.2.3 Técnicas para transmissão de vídeo ... 8
2.2.4 Softwares existentes para envio/recepção de vídeo ... 9
2.3 JAVA MEDIA FRAMEWORK ... 14
2.3.1 Classes e Objectos do JMF ... 17
2.3.2 Real-Time Transport Protocol (RTP) ... 20
2.3.3 Real-Time Control Protocol (RTCP) ... 22
2.3.4 Instalação da API e registo de dispositivos ... 23
2.3.5 Suporte JMF no Netbeans ... 25
2.4 ARQUITECTURA J2ME ... 26
2.4.1 Configurações ... 28
2.4.2 Perfis ... 29
2.4.3 Kilo Virtual Machine ... 31
2.5 SENSORES ... 32
2.5.1 Introdução ... 32
2.5.2 Nós sensores ... 32
2.5.3 Redes de Sensores sem fios (RSSFs)... 33
2.5.4 Plataforma ScatterWeb ... 34
2.5.5 IP em sensores ... 37
2.5.6 Sistema Operativo e IP em sensores ... 37
3. PLATAFORMA WEBSENSING ... 39
3.1 REDE DE SENSORES – TESTBED ... 40
3.1.1 Instalação de aplicações ... 40
.
vii
Instituto Politécnico da Guarda
Escola Superior de Tecnologia e Gestão | Departamento de Informática
3.2 CAMSEE (J2SE) ... 46
3.3 CAMSEEMOBILE (J2ME) ... 58
3.3.1 Serviço Webcam ... 59
3.3.2 Serviço Sensor ... 63
3.4 WEBSERVICE ... 67
3.4.1 Serviço Webcam ... 68
3.4.2 Serviço SENSOR-ESB ... 68
3.4.3 Serviço WEBCAM + SENSOR ... 69
3.4.4 Serviço Mobile WEBCAM + SENSOR ... 70
3.5 WEBSERVER EMBUTIDO NO SENSOR ... 70
4. CONCLUSÕES ... 73 4.1 TRABALHO EFECTUADO ... 73 4.2 CONSIDERAÇÕES FINAIS ... 73 4.3 TRABALHO FUTURO ... 74 5. REFERÊNCIAS BIBLIOGRÁFICAS ... 75 ANEXO A ... 78
.
viii
Instituto Politécnico da Guarda
Escola Superior de Tecnologia e Gestão | Departamento de Informática
Índice de figuras
FIGURA 1–APARELHO WHYCRY ... 5
FIGURA 2–TRANSMISSÃO DE VÍDEO PARA DIFERENTES DISPOSITIVOS ... 6
FIGURA 3–USB VERSUS FIREWIRE ... 7
FIGURA 4–APLICAÇÃO YAWCAM ... 10
FIGURA 5–APLICAÇÃO DORGEM ... 11
FIGURA 6–APLICAÇÃO WINDOWS MEDIA ENCODER ... 12
FIGURA 7 -VIDEOLAN ... 13
FIGURA 8–MODELO BÁSICO DO FUNCIONAMENTO DA JMFAPI ... 14
FIGURA 9-JAVA MEDIA FRAMEWORK ... 15
FIGURA 10–ESQUEMA BÁSICO DE PROCESSAMENTO DE UM STREAM DE DADOS ... 17
FIGURA 11-ESTADOS DE UM PLAYER ... 18
FIGURA 12–CLASSE DO JMF PARA SINCRONIZAÇÃO DE DADOS ... 20
FIGURA 13–ARQUITECTURA RTP ... 22
FIGURA 14-PROGRAMA DE INSTALAÇÃO DA APIJMF2.1.1E ... 23
FIGURA 15–OPÇÕES DE INSTALAÇÃO DO JMF ... 24
FIGURA 16-LOCALIZAÇÃO DO UTILITÁRIO JMFREGISTRY ... 24
FIGURA 17-DISPOSITIVOS DETECTADOS PELO UTILITÁRIO JMFREGISTRY ... 25
FIGURA 18-ADD LIBRARY’S NO NETBEANS ... 25
FIGURA 19- ADICIONAR SUPORTE PARA JMF AO PROJECTO ... 26
FIGURA 20–DISTRIBUIÇÕES JAVA ... 27
FIGURA 21–ARQUITECTURA DO J2ME ... 27
FIGURA 22–PLATAFORMA JAVA... 29
FIGURA 23– CICLO DE VIDA DE UM MIDLET ... 31
FIGURA 24–PERFIS,CONFIGURAÇÕES E MÁQUINAS VIRTUAIS ... 31
FIGURA 25-HARDWARE BÁSICO DE UM NÓ SENSOR ... 32
FIGURA 26 -STARTERKIT RESERACH LINE ... 35
FIGURA 27–PLATAFORMA ESB ... 36
FIGURA 28 -PLATAFORMA WEBSENSING ... 39
FIGURA 29–TESTBED REDE DE SENSORES ... 40
FIGURA 30–INSTALAÇÃO CYGWIN ... 41
FIGURA 31–INSTALAÇÃO MSPGCC ... 41
FIGURA 32–INSTALAÇÃO CONTIKI ... 42
.
ix
Instituto Politécnico da Guarda
Escola Superior de Tecnologia e Gestão | Departamento de Informática
FIGURA 34–FRONT-END DA APLICAÇÃO CAMSEE ... 47
FIGURA 35–WEBCAM PREVIEW ... 48
FIGURA 36–JMFSTUDIO... 49
FIGURA 37–FICHEIRO DE CONFIGURAÇÃO (CAMSEE.CONF) ... 50
FIGURA 38–CONFIGURAÇÃO DO SERVIÇO FICHEIRO ... 55
FIGURA 39–CONFIGURAÇÃO DO SERVIÇO RTP ... 56
FIGURA 40–CONFIGURAÇÃO SENSOR NA PLATAFORMA DESENVOLVIDA ... 57
FIGURA 41–APLICAÇÃO CAMSEE MOBILE ... 58
FIGURA 42-DEFINIÇÃO DO URL PARA IMAGEM ... 59
FIGURA 43–VISUALIZAÇÃO DA IMAGEM NO DISPOSITIVO MÓVEL ... 60
FIGURA 44–GCF(GENERIC CONNECTION FRAMEWORK) ... 61
FIGURA 45–CONFIGURAÇÃO DE DADOS DO SENSOR (CAMSEE MOBILE) ... 64
FIGURA 46–INFORMAÇÃO FORNECIDA PELO SENSOR (CAMSEE MOBILE) ... 65
FIGURA 47–DETECÇÃO DE ERROS NA CONFIGURAÇÃO (CAMSEE MOBILE) ... 66
FIGURA 48–SERVIÇO WEBCAM ... 68
FIGURA 49–SERVIÇO WEBCAM @ESBSENSOR ... 69
FIGURA 50–SERVIÇO WEBCAM +SENSOR ... 69
FIGURA 51-SERVIÇO MOBILE WEBCAM+SENSOR ... 70
.
x
Instituto Politécnico da Guarda
Escola Superior de Tecnologia e Gestão | Departamento de Informática
Índice de tabelas
TABELA 1–FORMATOS COMUNS DE VÍDEO ... 15
.
xi
Instituto Politécnico da Guarda
Escola Superior de Tecnologia e Gestão | Departamento de Informática
Acrónimos
Acrónimo Descrição
AM Aplication Manager AWT Abstract Window Toolkit.
API Application Programming Interface ASF Advanced Systems Format
CDC Connected Device Configuration CLDC Connected Limited Device Configuration CST Computer System & Telematics
DEI Departamento de Engenharia Informática DSP Digital Signal Processing ESB Embedded Sensor Board ESTG Escola Superior de Tecnologia e Gestão FP Foundation Profile
FPS Frames por Segundo
FTP File Transfer Protocol GCF Generic Connection Framework GPRS General Packet Rádio Service GSM Global System for Mobile Communications HTTP Hypertext Transfer Protocol
HTTPS Hypertext Transfer Protocol Secure IBM International Business Machines
IEEE Institute of Electrical and Electronics Engineers IETF Internet Engineering Task Force
IP Internet Protocol
IPG Instituto Politécnico da Guarda IPv4 Internet Protocol version 4 IPv6 Internet Protocol version 6 J2ME Java Micro edition
JMF Java Media Framework
JPEG Join Photographic Experts Groups JTAG Join Test Action Group
JVM Java Virtual Machine KVM Kilo Virtual Machine
LAN Local Área Network
LIIA Laboratório de Internet e Informática Aplicada MIDP Mobile Information Device Profile
MIPS Million Instruction per second MP4 MPEG-4 Part 14
MPEG Moving Pictures Experts Groups PBP Personal Basis Profile
PDA Personal Digital Assistant PDAP Personal Digital Assistant profile PP Personal Profile QoS Quality of Service
RFC Request for Comments RSSFs Redes Sensores sem Fios RTCP Real Time Control Protocol RTP Real Time Protocol
SLIP Serial Line Interface SUN Sun Microsystems, Inc. TCP Transmission Control Protocol
.
xii
Instituto Politécnico da Guarda
Escola Superior de Tecnologia e Gestão | Departamento de Informática
TTL Time to Live
UC Universidade de Coimbra UDP User Datagram Protocol UIP Micro Internet Protocol URL Universal Resource Locator USB Universal Serial Bus VLC VideoLan
VoiP Voice Over Internet Protocol WAN Wide Área Network
WEB World Wide Web