Ubiquitous Computing Practice - Part 4(RSSI) - Laboratory of Intelligent KUT (http://link.kut.ac.kr)http://link.kut.ac.kr Yong-hwan Kim Spring.

Slides:



Advertisements
Similar presentations
Peek into TinyOS Programs Vinod Kulathumani. 2 Basics Application consists of one or more components assembled, or wired A component provides and uses.
Advertisements

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.
TinyOS Applications Advanced Computer Networks. TinyOS Applications Outline  AntiTheft Example –LEDs, timer, booting  Sensing Example –Light Sensor.
INTRODUCTION TO TINYOS 2.X AND NESC. Anatomy of TelosB Mote  Limited computational and communication resources  MSP bit microcontroller 10kB RAM.
XBee_Interface_Multi CPUPLAZA. 제품 소개 XBee_Interface_Multi 는 PC 와 RS-232 또는 USB 로 연결되어 Digi MaxStream 사의 XBee 모듈을 설정 하거나 Firmware Update 를 할 때 사용되며, 모듈간의.
TinyOS Introduction Advanced Computer Networks. TinyOS Outline  Introduction to the Architecture of TinyOS and nesC  Component Model –Components, interfaces,
2008EECS Embedded Network Programming nesC, TinyOS, Networking, Microcontrollers Jonathan Hui University of California, Berkeley.
June 2008 WEI Short Course TinyOS Timers 1 Wireless Embedded Intrer-Networking Foundations of Ubiquitous Sensor Networks Timers and System Resources David.
TinyOS 2.1 Jun Yi Partially based on the tutorial at IPSN 2009 By Stephen Dawson-Haggerty, Omprakash Gnawali, David Gay, Philip Levis, Răzvan Musăloiu-E.,
콘솔 케이블을 이용한 NESPOT AP 개통절차 엠엠씨 - 통합형 MW-3000AP Nespot 개통기량 향상을 위한 길라잡이.
Term Project Detail Design 2 Traffic Generator So Jung LEE Dpnm Lab. CSE POSTECH
KyungHee Univ. 1-0 문자열 입 · 출력 프로그램 작성 예. KyungHee Univ. 1-1  모니터에 문자열 출력 하는 프로그램 작성  표준 출력 장치에 문자를 출력 하는 함수 함수의 기본형 : void SCI_OutChar(letter)  문자를.
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.
KyungHee Univ. 2-0 Parallel Port LED Interfaces. KyungHee Univ. 2-1 Output LEDs.
By: R Jayampathi Sampath
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.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 실 습실 습 6 WEEK 1 - INTRODUCTION TO VOID FUNCTIONS (PROCEDURES)
Architectures and Applications for Wireless Sensor Networks ( ) Sensor Node Programming II (UART and Radio) Chaiporn Jaikaeo
5. Serial Communication 충북인력개발원 전자과 공학박사 강원찬.
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.
Hanyang Univ.  강의 목표 ◦ 임베디드 개발 환경의 이해  강의 내용 ◦ 교차 컴파일 환경 구축 및 부트로더 실습 Hanyang Univ.
Upcoming Technologies Stephen Dawson-Haggerty Wireless and Embedded Systems Lab, UC Berkeley.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Light Sense Lab. Read data from light(photo diode) sensor, display using oscilloscope.
HANNAM UNIVERSITY 1 Chapter 6 Upon completion you will be able to: Delivery, Forwarding, and Routing of IP Packets Understand.
TinyOS Tutorial Lesson 8 Data logging application.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 TinyOS & NesC.
Part 2 TinyOS and nesC Programming Selected slides from:
Customer Oriented Display System Human Oriented technology Leader.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Wireless MAC Practice (MAC I)
AODVjr TinyOS Implementation
Chapter9_10 Circuit & Packet Switching
Overview A wireless sensor network (WSN) is a wireless network consisting of spatially distributed autonomous devices using sensors to cooperatively monitor.
Youn-Hee Han, In-Seok Kang {yhhan, Laboratory of Intelligent Networks Advanced Technology Research Center Korea University of Technology.
TinyOS Applications Advanced Computer Networks. TinyOS Applications Outline  AntiTheft Example {done in gradual pieces} –LEDs, timer, booting  Sensing.
Lecture 5 Sensing 石致豪. Introduction Sense application SenseAppC.nc configuration SenseAppC { } implementation { components SenseC, MainC, LedsC, new.
9 주 실습강의 XML Visualization(1) 학기, 소프트웨어 설계 및 실험 ( Ⅰ )
Kernel Programming Task Management ( 월 ) 이 병 희
Internal Device Driver
Youn-Hee Han, In-Seok Kang {yhhan, Laboratory of Intelligent Networks Advanced Technology Research Center Korea University of Technology.
영상 획득 영상 저장 카메라 파라메터 커스텀 이미지
LoCal Embedded IPv6 Bootcamp Stephen Dawson-Haggerty September 9, 2010.
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.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Lab1: LED Control ZigbeX mote has Red, Yellow, Green LED. This lab using LED control component provided by TinyOS.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 HelloWorld By using LED & Timer components, we will display “helloworld” in a manner of Morse code.
SnSDK Framework Software & System Development Kit 개발 노트 Ver. 1.2.
Presented by: © 2015 Jacob Beningo All Rights Reserved Writing Portable and Robust Firmware in C September 2, 2015 Jacob Beningo, CSDP Class 3: Uart Driver.
통신 프로토콜 김영준.
Term Project Detail Design Traffic Generator So Jung LEE Dpnm Lab. CSE POSTECH
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.
안양대학교 전기전자공학과 서 삼 준 Kernel Fusing (Boot Loader & tftp 활용 )
Data Mining : Basic Data Mining Techniques Database Lab 김성원.
Presentation by HyounSoo. Kim Embedded System Lab ChungBuk National University Practice 5~6 : 온도 및 습도 센서 제어 및 적외선 센서 제어 (ZigbeX.
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.
A Practical Introduction to Sensor Network Programming Wireless Communication and Networked Embedded Systems, VT 2011 Frederik Hermans, Communication Research,
Peek into TinyOS Programs
WSN Training: XMesh Enabled Sensor App
Ad Hoc Networking using Flooding protocol
TinyOS: Radio, Concurrent Execution, and Power control
University of California, Berkeley AIIT Summer Course - Tu1 TOS2
An Introduction to nesC
Temperature and Humidity Lab.
Shanghai Jiao Tong University-October 2016
SenseToRfm SenseToInt.Timer -> TimerC; configuration SenseToRfm {
Presentation transcript:

Ubiquitous Computing Practice - Part 4(RSSI) - Laboratory of Intelligent KUT ( Yong-hwan Kim Spring Semester, 2011

7. RF Power Control, Multichannel and RSSI RF Power Control 과 Multichannel 에 대해 이해 RSSI 값 활용 방법 예제 수행 Ubiquitous Computing

기본 지식 Power Control 무선 전파는 전송되는 거리의 제곱 or 네제곱에 반비례 어느 정도의 세기가 보장되어야수신측에서 데이터 값을 읽을 수 있다. 전송거리가 클수록 링크가 유지되기 쉬우나, 다른 노드들의 통신을 방해하며 전력 소모가 많다. CC2420 RF 인터페이스는 8 단계로 Power Control Output Power [dBm] Current Consumption [mA] Output Power [dBm] Current Consumption [mA] Ubiquitous Computing

기본 지식 Multichannel IEEE 표준 – 26 채널 CC2420 – 16 개 채널 지원  F = (k-11) Mhz, k = 11, 12, …, 26 RSSI(Received Signal Strength Indicator) RF 인터페이스에서 수신한 전파의 세기 (dBm) RSSI 가 -94dBm 이상이어야 메시지 디코딩 가능 RSSI.RSSI_VAL 레지스터에 저장  저장 값이 -20 일 경우, 실제 RSSI 는 -65dBm Ubiquitous Computing

MCH_PTRSSI 예제 소개 1 번 노드  RF_Configuration_Setting() Task 함수에서 노드 자신의 파워 및 채널을 변경  변경된 설정에 의해 1 초마다 데이터 무선 전송 0 번 노드  받은 RSSI 값을 계산하여 PC 로 전달 ( 제대로 수신 되었을 경우 Red LED 점멸 ) ZigbeX 1ZigbeX 0 시리얼케이블 무선통신 MCH_PTRSSI ID : 1 MCH_PTRSSI ID : 0 Ubiquitous Computing

MCH_PTRSSI.nc CC2420ActiveMessageC : 전송 파워 제어 CC2420ControlC : 채널 제어 무선 통신, 시리얼 통신 동시 사용 Ubiquitous Computing

MCH_PTRSSI.nc configuration MCH_PTRSSI { } implementation { components MainC, MCH_PTRSSIM, new TimerMilliC(), LedsC, BusyWaitMicroC, ActiveMessageC, new AMSenderC(AM_MCH_PTRSSI_Msg), new AMReceiverC(AM_MCH_PTRSSI_Msg), CC2420ActiveMessageC, CC2420ControlC, SerialActiveMessageC as Serial; MCH_PTRSSIM.Boot -> MainC; MCH_PTRSSIM.Timer -> TimerMilliC; MCH_PTRSSIM.Leds -> LedsC; MCH_PTRSSIM.BusyWait ->BusyWaitMicroC; // RF Component MCH_PTRSSIM.CommControl -> ActiveMessageC; MCH_PTRSSIM.RecvMsg -> AMReceiverC; MCH_PTRSSIM.DataMsg -> AMSenderC; MCH_PTRSSIM.CC2420Packet -> CC2420ActiveMessageC;// 전송 파워제어 MCH_PTRSSIM.CC2420Config -> CC2420ControlC;// 채널 제어 // Serial Component MCH_PTRSSIM.Serial_Control -> Serial; MCH_PTRSSIM.Serial_Packet -> Serial; MCH_PTRSSIM.Serial_Send -> Serial.AMSend[AM_MCH_PTRSSI_Uart]; } Ubiquitous Computing

MCH_PTRSSIM.nc MCH_PTRSSIM.nc 파일 경로 :  /opt/tinyos-2.x/contrib/zigbex/MCH_PTRSSI/MCH_PTRSSIM.nc 함수 실행순서  Boot.booted() → CommControl, SerialControl → RF configuration( 파워, 채널 설정 ) → CC2420config.sync()  CC2420config.syncDone() → Timer.startPeriodic ()  반복 Timer.fired () → task TryToSend () → DataMsg.send ()  RecvMsg.receive() → Serial_Send.sendDone() Ubiquitous Computing

MCH_PTRSSIM.nc 1: includes MCH_PTRSSI; 2: module MCH_PTRSSIM{ 3: uses { 4: interface Boot; interface Timer ; 5: interface Leds; 6: interface BusyWait ; 7: interface SplitControl as CommControl; 8: interface AMSend as DataMsg; 9: interface Receive as RecvMsg; 10: interface SplitControl as Serial_Control; 11: interface AMPacket as Serial_Packet; 12: interface AMSend as Serial_Send; 13: interface CC2420Packet; 14: interface CC2420Config; }} 15: implementation 16: { 17: message_t sendmsg, uartmsg; 18: uint16_t mySeq; 19: uint8_t myPowerLevel; 20: uint8_t myChannel; 21: task void RF_Configuration_Setting (); 22: task void TryToSend(); 7~9: RF 관련 인터페이스 10~12: Serial 관련 인터페이스 Ubiquitous Computing

MCH_PTRSSIM.nc 23: event void Boot.booted() { 24: atomic mySeq = 0; 25: call CommControl.start(); 26: } 27: event void CommControl.startDone(error_t error) { 28: call Serial_Control.start(); 29: } 30: event void Serial_Control.startDone(error_t error) { 31: post RF_Configuration_Setting (); 32: } 33: event void CommControl.stopDone(error_t error) {} 34: event void Serial_Control.stopDone(error_t error) {} 35: task void RF_Configuration_Setting () { 36: call BusyWait.wait(3000); 37: atomic myPowerLevel = 0x1f; 38: call CC2420Packet.setPower (&sendmsg, myPowerLevel); 39: atomic myChannel = 15; 40: call CC2420Config.setChannel (myChannel); 41: call CC2420Config.sync(); 42: } 23: RF 컴포넌트를 시작하기 위해 CommControl.start() 호출 ( 원형은 ActiveMessageC 와 연결되는 SplitControl) 27: Serial 컴포넌트를 시작하기 위해 Serial_Con trol.start() 호출 30: 모트의 RF 채널과 파워를 조절하기 위한 RF_ Configuration_Setting() 함수를 호출 38 : RF 파워 조절 함수 호출 실제 RF 파워는 message_t 구조체의 Meta 필드에 있는 tx_power 변수에 의해 설정되는데 이 함수 로 그 값을 조절한다 // 0x1f = 0 dBm // 0x1b = -1 dBm // 0x17 = -3 dBm // 0x13 = -5 dBm // 0x0f = -7 dBm // 0x0b = -10 dBm // 0x07 = -15 dBm // 0x03 = -25 dBm 40: RF 채널 변경 함수 호출 // Channel Ranges: 11 ~ 26 41: 설정된 값을 CC2420 RF 칩으로 전송 Ubiquitous Computing

MCH_PTRSSIM.nc 43: event void CC2420Config.syncDone ( error_t error ) { 44: if ( error == SUCCESS ) { 45:call Timer.startPeriodic(1000); 46:call Leds.led1On();//Green On 47: }else{ post RF_Configuration_Setting (); 48: }} 49: event void Timer.fired() { 50: call Leds.led1Toggle();//Green Toggle 51: post TryToSend(); 52: } 53: task void TryToSend() { 54: struct MCH_PTRSSI_Msg *pack; 55: pack = (struct MCH_PTRSSI_Msg *) call DataMsg.getPayload(&sendmsg); 56: pack->seq = mySeq++; 57: pack->SenderID = TOS_NODE_ID; 58: pack->PowerLevel = myPowerLevel; 59: pack->Channel = myChannel; 60: if (call DataMsg.send(AM_BROADCAST_ADDR, &sendmsg, sizeof(struct MCH_PTRSSI_Msg)) == SUCCESS){ 61:call Leds.led2On();//Yellow On 62: }} 43: 원하는 채널을 CC2420 RF 칩에 설정하게 되면 CC2420Config.syncDone() 이벤트 함수가 호출된다. 성공이라면, 주기적 동작을 위해 Timer.startPeriodic (1000) 을 호출하고, 실패라면 설정함수를 다시 호출 53: TryToSend() 함수에서는 MCH_PTRSSI_Msg 구조체에 seq, 자신의 주소, 설정한 파워 및 채널 정보를 넣어 RF 로 send 한다. Ubiquitous Computing

MCH_PTRSSIM.nc 63: event void DataMsg.sendDone(message_t* msg, error_t error) { 64: if (error == SUCCESS){ 65:call Leds.led2Off(); 66: }} 67: event message_t* RecvMsg.receive(message_t* msg, void* payload, uint8_t len) { 68: struct MCH_PTRSSI_Msg *recv_pack = (struct MCH_PTRSSI_Msg *) call DataMsg..getPayload(&uartmsg); 69: memcpy((void*)recv_pack, payload, len); 70: recv_pack->RSSI = call CC2420Packet.getRssi(msg); 71: recv_pack->RSSI -= 45; 72: call Serial_Packet.setSource(&uartmsg, recv_pack->SenderID); 73: if (call Serial_Send.send(TOS_NODE_ID, &uartmsg, sizeof(struct MCH_PTRSSI_Msg)) == SUCCESS) 74:call Leds.led0Toggle(); 75: return msg; 76: } 77:} 67: 만약 다른 노드로부터 RF 패킷을 받으면 RecvMsg.receive() 함수가 호출된다. 함수에 서 받은 패킷의 RSSI 값에서 -45 를 하여 dBm 단위의 RSSI 값을 만든 뒤 Serial 로 전송 Ubiquitous Computing

MCH_PTRSSI.h MCH_PTRSSI.h 에 정의된 데이터 포멧 #define MSG_LEN 6 struct MCH_PTRSSI_Msg { uint16_t seq; uint16_t SenderID; uint8_t PowerLevel; uint8_t Channel; char RSSI; //RSSI value can be a minus(a negative value). uint8_t Pending; }; enum { AM_MCH_PTRSSI_Msg = 26, AM_MCH_PTRSSI_Uart = 27 }; Ubiquitous Computing

MCH_PTRSSI 예제 실습 MCH_PTRSSI 컴파일 및 포팅 AVR Studio 를 이용하여 두 개의 센서 노드에 각각 reinstall 된 hex 파일을 program 함. SerialText 프로그램을 이용하여 ( 시리얼 통신을 통해 ) SenderID, Power Level, Channel, RSSI 확인 $ cd /opt/tinyos-2.x/contrib/zigbex/MCH_PTRSSI $ make zigbex $ make zigbex reinstall.0//0 번 아이디 $ make zigbex reinstall.1//1 번 아이디 Ubiquitous Computing

Packet HeaerSerial Header SeqSrc Power Channel RSSI(-59dBm) Pedding Data unsigned char RSSI = 197;//C5 char RSSI_Signed = (char) RSSI; printf("%d, %d\n", RSSI, RSSI_Signed); //-59 Ubiquitous Computing