HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희.

Slides:



Advertisements
Similar presentations
1 Tomás Sánchez López July 9, 2004 Real-time & Embedded Systems Laboratory TinyOS … in deep.
Advertisements

NesC Prepared for the Multimedia Networks Group University of Virginia.
NesC: A Programming Language for Motes David Gay, Phil Levis, Eric Brewer, Rob von Behren, Nikita Borisov, Mike Chen, David Culler Intel Research, UC Berkeley.
Feb 2007WSN Training: First Steps in nesC Programming1 First Steps in TinyOS and nesC Programming Topics  Timer Application: MyApp  Application directory.
1 Lab 3 Objectives  Case study: “Hello world” program on motes  Write you first program on mote.
1 Lab4 Objectives  Learn to read light sensor data from sensor board  Learn to transmit a message containing the sensed data  through Mote serial port.
Mote Programming. 如何 compile 程式  make [re]install. : desired device address : target platform  install vs. reinstall install : compile the application.
Feb 2007TinyOS/nesC Basic Concepts1 Introduction to TinyOS Programming Topics  TinyOS execution model  Async and atomic code  Configuration and wiring.
GIIS’07 – Marrakech 3 rd July 2007 Behavioural Specification of Wireless Sensor Network Applications Nelson S Rosa and Paulo R F Cunha Universidade Federal.
Programming Motes A TinyOS and TOSSIM Tutorial By: Brent Rood.
Development of a Mica2 Mote Sensor Network Cliff Macklin Bill Ehrbar December 8, 2004 University of Colorado, Colorado Springs.
2008EECS Embedded Network Programming nesC, TinyOS, Networking, Microcontrollers Jonathan Hui University of California, Berkeley.
TinyOS Tutorial CS580S Sensor Networks and Systems February 7, 2007 Jisu Oh Dept. of Computer Science SUNY-Binghamton.
PtinyOS: Simulating TinyOS in Ptolemy II Elaine Cheong Dec 10, 2004 EE290N Project Presentation (Initial NC code generator by Yang Zhao and Edward Lee)
5/5/2003MobiSys 2003 Tutorial TinyOS Tutorial, Part II Robert Szewczyk, Joe Polastre, Phil Levis, David Culler Mobisys 2003.
TinyOS and NesC: programming low-resource sensor networks.
Advanced Topics on Information Systems Spring 2004 Dimitrios Lymberopoulos Advanced Topics on Information Systems Embedded Software: The Case of Sensor.
A Graphical Development and Simulation Environment for TinyOS-based Wireless Sensor Networks Elaine Cheong February 13, 2007 Seventh Biennial Ptolemy Miniconference.
NesC: 1.1 Bumps and Future Directions David Gay, Intel Research, Berkeley (and the nesC and TinyOS teams)
1 Lab 3 Objectives  Case study: “Hello world” program on motes  Write you first program on mote.
TinyOS Tutorial Based on Wenyuan Xu’s slides ( NetsF06/Comnet_TinyOS_Tutorial_xwy.ppt)
1 Software Development Infrastructure for Sensor Networks  Operating systems ( TinyOS )  Resource (device) management  Basic primitives  Protocols.
TinyOS Tutorial Jianping Wang (merge several tutorials found online)
The University of Iowa. Copyright© 2005 A. Kruger 1 Introduction to Wireless Sensor Networks TinyOS Overview 10 February 2005.
A Survey of Software Tools for Sensor Networks
1 Lab 5 Objectives  Use XMesh multi-hop networking service to send sensing data to a base station  Using XServe to display the sensor data message on.
Programming in nesC (and TOSSIM)
By: R Jayampathi Sampath
1 System Architecture Directions for Networked Sensors (TinyOS & Mica2) Presented by Jang Young, Kim (Chris)
April 15, 2005TinyOS: A Component Based OSPage 1 of 27 TinyOS A Component-Based Operating System for Networked Embedded Systems Tom Bush Graduate College.
1 TinyOS Computer Network Programming Wenyuan Xu Fall 2007.
TinyOS 1/2 Onsystech Sangjae Han.
1 Lab2 Objectives  Basics of TinyOS  Basics of nesC programming language.
1 Lab2 Objectives  Basics of TinyOS  Basics of nesC programming language.
Tmote Sky Doug Schultz for FWLUG (Fort Wayne Linux Users Group)
HW2: Q&A Oct. 02, Lab Machine TinyOS is installed in one machine (531AB). But, you have to bring your kit. There is a sign up sheet. Please sign.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Light Sense Lab. Read data from light(photo diode) sensor, display using oscilloscope.
Dhanshree Nimje Smita Khartad
An Introduction to nesC and TinyOS, or, A really complicated way to build very simple applications CENS Summer Internship 07/08/05 Ben Greenstein –
CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.
Lab 3 Introduction to TinyOS and nesC How to debug programs at PC Examples –Blink Timer –Blink –Hellow World Reference: 1.x/doc/tutorial/lesson1.html.
Simulation of Distributed Application and Protocols using TOSSIM Valliappan Annamalai.
TinyOS Tutorial Lesson 8 Data logging application.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 TinyOS & NesC.
Part 2 TinyOS and nesC Programming Selected slides from:
Wireless Sensor Networks with Motes Gurdip Singh and Sumeet Gujrati.
Feb 2007WSN Training: Creating a Simple Sensor Application1 A TinyOS Sensor Application called MyApp Objectives  How to create a simple Mote firmware.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Wireless MAC Practice (MAC I)
WSN Software Platforms - concepts Vinod Kulathumani Lecture uses some slides from tutorials prepared by authors of these platforms.
1 Lab2 Objectives  Basics of TinyOS  Basics of nesC programming language.
Lab 3, Part 2 Selected slides from: Wireless Sensor Networks Hardware/Software Tiny OS & NesC Programming borrowed from Turgay Korkmaz.
TinyOS Sandeep Gupta. Operating System (OS) What is an OS? Main functions  Process management  Memory management  Resource management Traditional OSs.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Gossiping Protocol.
TinyOS By Valliappan Annamalai. Hardware Mica motes (Mica2 and Mica2Dot) Hardware –Radio –Microcontroller –Flash memory –ADC –Sensor Board (MTA310)
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Lab1: LED Control ZigbeX mote has Red, Yellow, Green LED. This lab using LED control component provided by TinyOS.
Based on slides from Andreas Larsson Table from CY Chong, SP Kumar, BA Hamilton - Proceedings of the IEEE, 2003.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 HelloWorld By using LED & Timer components, we will display “helloworld” in a manner of Morse code.
Blink Blink.nc configuration Blink { } implementation { components Main, BlinkM, SingleTimer, LedsC; Main.StdControl -> BlinkM.StdControl; Main.StdControl.
Feb 2007WSN Training: XMesh Enabled Sensor App1 Lab 5 Objectives  Use XMesh multi-hop networking service to send sensing data to a base station  Using.
Presentation by HyounSoo. Kim Embedded System Lab ChungBuk National University Practice 5~6 : 온도 및 습도 센서 제어 및 적외선 센서 제어 (ZigbeX.
TOS Message Format Test: Display Raw Data Packet.
Why does it need? [USN] ( 주 ) 한백전자 Background Wireless Sensor Network (WSN)  Relationship between Sensor and WSN Individual sensors are very limited.
TinyOS Sandeep Gupta. TinyOS basics TinyOS is  Single tasking OS  Interrupt driven Written using a Component based language A set of components put.
Simulation of Distributed Application and Protocols using TOSSIM
WSN Training: XMesh Enabled Sensor App
Ad Hoc Networking using Flooding protocol
An Introduction to nesC
Temperature and Humidity Lab.
WSN Training: TinyOS/nesC Basic Concepts TinyOS and nesC
SenseToRfm SenseToInt.Timer -> TimerC; configuration SenseToRfm {
Presentation transcript:

HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희

HANBACK ELECTRONICS CO., LTD. NesC Programming Language application: configuration comp1: module comp3 comp4 comp2: configuration Components: – 구성 - module: C 로 구현 -configuration: select and wire –interfaces -provides interface -uses interface 2 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. Component 3 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. NesC Programming Language Component 의 종류 : –configuration: 컴포넌트의 연결을 나타냄 –module: 인터페이스의 동작을 기술, 이벤트 핸들러 작성 4 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. NesC Programming Language Configurations 의 연결 : configuration app { } implementation { components c1, c2, c3; c1 -> c2; // implicit interface sel. c2.out -> c3.triangle; c3 <- c2.side; } Configuration 의 부분 기술 : Component c2c3 { provides interface triangle t1; } implementation { components c2, c3; t1 -> c2.in; c2.out -> c3.triangle; c3 <- c2.side; } C1 C2 C3 C2 C3 5 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. NesC Programming Language modules: module C1 { uses interface triangle; } implementation {... } module C2 { provides interface triangle in; uses { interface triangle out; interface rectangle side; } } implementation {... } module C3 { provides interface triangle; provides interface rectangle; } implementation {... } C1 C2 C3 6 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. NesC Blink example blink.nc (configuration) configuration Blink { }implementation { components Main, BlinkM, TimerC, LedsC; Main.StdControl -> TimerC.StdControl; Main.StdControl -> BlinkM.StdControl; BlinkM.Timer -> TimerC.Timer[unique("Timer")]; BlinkM.Leds -> LedsC; } 7 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. NesC Blink example blinkM.nc (module) module BlinkM { provides { interface StdControl; } uses { interface Timer as Timer; interface Leds; } }implementation { command result_t StdControl.init() { call Leds.init(); return SUCCESS;} command result_t StdControl.start() { call Timer.start(TIMER_REPEAT, 1000); return SUCCESS; } command result_t StdControl.stop() { call Timer.stop();return SUCCESS; } event result_t Timer.fired() { call Leds.redToggle(); return SUCCESS; } } 8 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. Blink 의 구조 컴포넌트 : Main, TimerC, LedsC, BlinkM –/opt/tinyos-1.x/tos/system/Main.nc configuration Main { uses interface StdControl; } implementation { components RealMain, PotC, HPLInit; StdControl = RealMain.StdControl; RealMain.hardwareInit -> HPLInit; RealMain.Pot -> PotC; } 9 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. Main.nc Component : RealMain, PotC, HPLInit Main StdControl RealMain PotCHPLInit Pot Hardwareinit 같은 interface 이므로 = 로 연결 Provide 와 use interface 이므로 -> 로 연결 10 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. RealMain HPLInit module RealMain { uses { command result_t hardwareInit(); interface StdControl; interface Pot; } implementation{ int main() __attribute__ ((C, spontaneous)) { call hardwareInit(); call Pot.init(10); TOSH_sched_init(); call StdControl.init(); call StdControl.start(); __nesc_enable_interrupt(); while(1) { TOSH_run_task(); } /opt/tinyos- 1.x/platform/avrmote/HPLInit.nc module HPLInit { provides command result_t init(); } Implementation { // Basic hardware init. command result_t init() { TOSH_SET_PIN_DIRECTIONS(); return SUCCESS; } Simple FIFO 스케줄러 11 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. RealMain PotC module RealMain { uses { command result_t hardwareInit(); interface StdControl; interface Pot; } implementation{ int main() __attribute__ ((C, spontaneous)) { call hardwareInit(); call Pot.init(10); TOSH_sched_init(); call StdControl.init(); call StdControl.start(); __nesc_enable_interrupt(); while(1) { TOSH_run_task(); } /opt/tinyos-1.x/system/PotC.nc configuration PotC{ provides interface Pot; } implementation { components PotM, HPLPotC; Pot = PotM; PotM.HPLPot -> HPLPotC; } module PotM{ provides interface Pot; uses interface HPLPot; }implementation { …. command result_t Pot.init(uint8_t initialSetting) { setPot(initialSetting); return SUCCESS; } ….. 12 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. RealMain BlinkM module RealMain { uses { command result_t hardwareInit(); interface StdControl; interface Pot; } implementation{ int main() __attribute__ ((C, spontaneous)) { call hardwareInit(); call Pot.init(10); TOSH_sched_init(); call StdControl.init(); call StdControl.start(); __nesc_enable_interrupt(); while(1) { TOSH_run_task(); } module BlinkM{ provides { interface StdControl; } uses { interface Timer as Timer; interface Leds; } }implementation { command result_t StdControl.init() { call Leds.init(); return SUCCESS; } command result_t StdControl.start() { call Timer.start(TIMER_REPEAT, 1000); return SUCCESS; } StdControl.stop() { call Timer.stop(); return SUCCESS; } event result_t Timer.fired() { call Leds.redToggle(); return SUCCESS; } } 13 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. 사용된 Interface StdControl, Pot, hardwareInit(); interface StdControl{ command result_t init(); command result_t start(); command result_t stop(); } interface Pot { command result_t init(uint8_t initialSetting); command result_t set(uint8_t setting); command result_t increase(); command result_t decrease(); command uint8_t get(); } command result_t hardwareInit(); 14 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. Blink 의 구조 컴포넌트 : Main, TimerC, LedsC, BlinkM configuration TimerC { provides interface Timer[uint8_t id]; provides interface StdControl; }implementation { components TimerM, ClockC, NoLeds, HPLPowerManagementM; TimerM.Leds -> NoLeds; TimerM.Clock -> ClockC; TimerM.PowerManagement -> HPLPowerManagementM; StdControl = TimerM; Timer = TimerM; } 15 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. TimerC TimerC 의 구조 TimerC TimerStdControl TimerM NoLedsClockC HPLPowerManagementM Leds ClockPowerManagement 16 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. Blink 의 구조 컴포넌트 : Main, TimerC, LedsC, BlinkM module LedsC { provides interface Leds; } implementation{ uint8_t ledsOn; enum { RED_BIT = 1, GREEN_BIT = 2, YELLOW_BIT = 4 }; async command result_t Leds.init() { … return SUCCESS; } async command result_t Leds.redOn() { … } async command result_t Leds.redOff() { … } async command result_t Leds.redToggle() { … } …. async command uint8_t Leds.get() { … } async command result_t Leds.set(uint8_t ledsNum) { … } } 17 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. Blink 의 구조 컴포넌트 : Main, TimerC, LedsC, BlinkM module BlinkM{ provides { interface StdControl; } uses { interface Timer as Timer; interface Leds; } }implementation { command result_t StdControl.init() {call Leds.init(); return SUCCESS; } command result_t StdControl.start() {call Timer.start(TIMER_REPEAT, 1000); return SUCCESS; } StdControl.stop() { call Timer.stop(); return SUCCESS; } event result_t Timer.fired() { call Leds.redToggle(); return SUCCESS; } } 18 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. BlinkM LedsC module BlinkM{ provides { interface StdControl; } uses { interface Timer as Timer; interface Leds; } }implementation { command result_t StdControl.init() { call Leds.init(); return SUCCESS; } command result_t StdControl.start() { call Timer.start(TIMER_REPEAT, 1000); return SUCCESS; } StdControl.stop() { call Timer.stop(); return SUCCESS; } event result_t Timer.fired() { call Leds.redToggle(); return SUCCESS; } } module LedsC { provides interface Leds; } implementation{ uint8_t ledsOn; enum { RED_BIT = 1, GREEN_BIT = 2, YELLOW_BIT = 4 }; async command result_t Leds.init() { … return SUCCESS; } async command result_t Leds.redOn() { … } async command result_t Leds.redOff() { … } async command result_t Leds.redToggle() { … } …. async command uint8_t Leds.get() { … } async command result_t Leds.set(uint8_t ledsNum) { … } } 19 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. TinyOS 프로그래밍 20 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. TinyOS 이미 구현된 다양한 컴포넌트를 적절하게 구성 Main 컴포넌트는 반드시 포함되어야 함 –C 에서 main() 을 포함하고 있음 21 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. 개발환경과 도구 제공된 CD 를 이용하여 환경구성 ncc: NesC 컴파일러 avr-gcc: ncc 컴파일 결과 파일 app.c 를 컴파일 Main.hex 생성 BlinkM 의 컴파일 –Cygwin 의 시작 –cd /opt/tinyos-1.x/apps/Blink –Make clean;make zigbex –ls build/zigbex/ 22 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. LED 의 제어 /opt/tinyos-1.x/apps/Blink 를 변경하여 원하는 LED 를 제어한다. 23 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. Timer 의 제어 /opt/tinyos-1.x/apps/Blink 를 타이머 3 개를 사용하 도록 수정 타이머 3 개를 이용하여 세개의 LED 를 제어 24 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. Timer 의 설정 타이머의 개수 설정 /opt/tinyos-1.x/tos/interfaces/timer.h Timer 를 12 개 사용하는 경우 #ifndef NTIMERS #if NESC >= 110 #define NTIMERS uniqueCount("Timer") #else #define NTIMERS12 #endif enum { TIMER_REPEAT = 0, TIMER_ONE_SHOT = 1, NUM_TIMERS = NTIMERS }; Makefile 에서 PFLAGS += -DNTIMERS=12 25 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. TINYOS TinyOS (TOS) = atmega128 에서 수행 가능한 이미지 event-driven 구조 단일 스택 커널 없음, 프로세스관리 없음, 메모리관리 없음, 가상메모 리 사용안함 Main 함수에서 구동되는 Simple FIFO 스케줄러 26 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. TINYOS 응용 TOS application = graph of components + scheduler Communication ActuatingSensing Communication Application (User Components) Main (includes Scheduler) Hardware Abstractions m ain { // component initialization while(1) { while(more_tasks) schedule_task; sleep; } // while } // main 27 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. 스케줄러 스케줄링 : –2-level scheduling (events and tasks) –single shared stack, used by events and function calls 28 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. Event 와 task 의 관계 29

HANBACK ELECTRONICS CO., LTD. Task 타스크 : – 이벤트에 선점 가능 – 함수의 호출 –Signal 을 발생 – 타스크에 의해 선점되지 않음 (simple FIFO) 30 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. event 이벤트 – 인터럽트에 의해 발생되는 요청 INTERRUPT(_output_compare2_)() { // Hardware Timer Event Handler … TOS_SIGNAL_EVENT(CLOCK_FIRE_EVENT)(); // Software event … } 31 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. TinyOS 의 scheduling Task Queue Empty? Event Handler SleepRun Task timer ADC RF UART y task1 task2 task3 task4 task5 task6 task7 Task exist Interrupt occurs Interrupt Vectors Task Queue 32 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. TinyOS scheduler Task queue Task #1 Task #2 Task #... Task #n-1 Task #n Interrupt vectors ADC timer1 UART0 SPI compare If Task queue Empty Then sleep scheduler Task(i) Command(i) sleep Event handler Command(j) call return No task Task return If queue != empty Then execute TASK Timer0 time out !! interrup t 33 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. 하드웨어 구성 하드웨어의 개념 : –LED (pin numbering/HW wiring) –CLOCK (counter interrupt) –UART (baud rate control, transfer) –ADC (ADC interrupt handling) –RFM (abstracts bit level timing, RFM specific control logic) – 센서 Communication ActuatingSensing Communication Application (User Components) Main (includes Scheduler) Hardware Abstractions 34 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. ADC the Sensor stack: – 각종 센서를 센싱 –ADC component – 데이터 요청, 센싱이 끝날 때까지 대기 Communication ActuatingSensing Communication Application (User Components) Main (includes Scheduler) Hardware Abstractions 35 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. 통신 통신 스택 : –RFM(bit level) 부터 시작 –bit level abstracts away radio specifics –byte level radio component collects individual bits into bytes –packet level constructs packets from bytes –messaging layer interprets packets as messages Communication ActuatingSensing Communication Application (User Components) Main (includes Scheduler) Hardware Abstractions 36 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. TINYOS 의 구성 /opt/tinyos-1.x TinyOS 의 폴더 37 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. tos 의 구성 interfaces: 구현된 interface 를 모아놓은 곳 system : CPU 중심적 컴포넌트와 스케줄러 Platform : TinyOS 를 사용하는 플랫폼을 정의 Types : TinyOS 메시지 해더를 정의 38 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. Group ID, address Group ID –Makefile 에 다음과 같이 정의하여 사용한다. (default 0x7D) –DEFAULT_LOCAL GROUP = 0xgid (gid = 0~ff) Address –0x007E UART 를 의미 –0xFFFF broadcast 를 의미 –TOS_LOCAL_ADDRESS make ZigbeX reinstall.# # 이 TOS_LOCAL_ADDRESS 즉 mote ID 이다. 39 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. TOS Message 의 구성 Sync byte –TOS Message 의 시작과 끝을 알림 –0x7E – 예 –0: 항상 0x7E –1:packet type 0x42 : ack 가 필요 없는 사용자 패킷 0x41 : ack 가 필요한 사용자 패킷 0x40 : 0x41 에 대한 응답 패킷 0xFF : 형식이 없는 패킷 –2 … n-1 : payload data –N: 항상 0x7E 40 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. Sync byte 의 문제 Payload data 에 sync byte 가 포함된 경우 – 탈출 문자를 지정하여 sync byte 가 아님을 표시 – 예 0x7D 0x7E (0x7D 가 탈출문자 ) 탈출문자가 payload data 에 포함된 경우 –0x7D 다음데이터를 0x20 과 exclusive or 해서 표시 – 예 0x7E -> 0x7D 0x5E 0x7D -> 0x7D 0x5D –RFC1662 참조 41 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. RAW Data Packet 1 cygwin 에서 확인 – 먼저 모트 두 개를 준비한다. –1 번 모트에 TOSBase 를 컴파일한 후 프로그램 한다. –2 번 모트에 OscilloscopeRF 를 컴파일한 후 프로그램 한다. –1 번 모트에 시리얼 젠더와 케이블을 연결한다. –cygwin 을 시작해서 다음과 같이 입력하여 확인한다. cd /opt/tinyos-1.x/tools/java java net.tonyos.tools.ListenRaw COM1 42 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. RAW Data Packet 2 실행결과 –7E 42 FF ……… 48 7E 43 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. TOS Message 의 구조 TOS Message –RAW 패킷의 payload 데이터 –0,1 : address –2 : type-----  –3 : group ID –4 : length –5~n-2 : payload data –n-1~n : CRC16 각 type 에 대한 응용 프로그램확인 44 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. Type 과 응용 프로그램 TOS 메시지를 확인 프로그램 –java net.tinyos.tools.Listen –java net.tinyos.tools.ListenRaw 0x0A – Oscope Message - Oscilloscope –java net.tinyos.oscope.oscilloscope 0x11 – surge message – surge –java net.tinyos.surge.MainClass 125(group) 0x03 – mhop Message – surge 다른 형식의 메시지도 사용자가 정의하여 사용가 능 45 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. TOS Message 확인 cygwin 에서 다음명령으로 확인 java net.tinyos.tools.Listen –FFFF : address 0A:Oscope Message –7D : group ID 1A: Length 46 무단 복사 및 전재 금지

HANBACK ELECTRONICS CO., LTD. TOS Message 의 응용프로그램 Oscope 메시지를 받아서 표시 –java net.tinyos.oscope.oscilloscope – 파형이 안보이면 scrolling 클릭 47 무단 복사 및 전재 금지