1 / 16

Tinyos 센싱 2

Tinyos 센싱 2. printf 활용 SenseToRadio 프로그램 분석 ListenSense.java 프로그램. printf 함수 활용 (1). USB 로 연결된 노드의 수행 코드 상의 printf 내용 출력 Tutorial 문서의 1.15 절 참조 ( http://docs.tinyos.net/tinywiki/index.php/TinyOS_Tutorials ) Makefile 에서 printf lib 포함 구현 코드에 printf.h 파일 인쿠르드.

Download Presentation

Tinyos 센싱 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tinyos 센싱 2 • printf 활용 • SenseToRadio 프로그램 분석 • ListenSense.java 프로그램

  2. printf 함수 활용 (1) • USB로 연결된 노드의 수행 코드 상의 printf 내용 출력 • Tutorial 문서의 1.15절 참조 (http://docs.tinyos.net/tinywiki/index.php/TinyOS_Tutorials) • Makefile에서 printf lib 포함 • 구현 코드에 printf.h 파일 인쿠르드

  3. printf 함수 활용 (2) • 다음과 같이 코드 상에서 printf 및 printfflush() 함수 호출 • java의 PrintClient 명령어 실행 java net.tinyos.tools.PrintClient –comm serial@/dev/ttyUSB0:telosb • 실행 예

  4. SenseToRadio 설치 • 강의자료 홈페이지에서 SenseToRadio.tar.gz 파일 다운로드 • 우분투 상의 chrome 프로그램 사용 • http://faculty.bme.pnu.edu/~wjlee/course.html접속 • “SenseToRadio 코드”-> 오른쪽 클릭 -> 다른 이름으로 링크저장 -> 위치 목록에서 “wjlee” 선택 후 저장 • 다운로드 한 파일을 tinyos의 apps 디렉토리로 복사 후, 압축 풀기 $ cp SenseToRadio.tar.gz /opt/tinyos-2.1.2/apps $ cd /opt/tinyos-2.1.2/apps $ tar –zxvf SenseToRadio.tar.gz $ cd SenseToRadio

  5. SenseToRadio 분석 (1) SenseToRadio.h

  6. SenseToRadio 분석 (2) SenseToRadioAppC.nc

  7. SenseToRadio 분석 (3) SenseToRadioC.nc

  8. SenseToRadio 분석 (4)

  9. SenseToRadio 분석 (5)

  10. SenseToRadio 분석 (6)

  11. Listen.java 코드 수정하여 센싱 값 출력 mote: 1 (SenseToRadio) mote: 0 (BaseStation) PC: Listen • Listen 코드를 수정해서 내가 원하는 정보만 출력하는 방법? SenseToRadio 값 Listen으로 출력 확인

  12. Listen.java 코드 …… 중간 코드 생략 …… /opt/tinyos-2.1.2/support/sdk/java/net/tinyos/tools/Listen.java

  13. ListenSene.java (Listen.java 수정)

  14. ListenSense.java 다운로드 및 설치 • SenseToRadio 와 동일한 방법으로 chrom에서 “ListenSense 자바 코드” 항목을 홈 디렉토리(/home/wjlee)로 다운로드 • ListenSense.java 파일을 tinyos의 자바 코드 디렉토리로 복사 $ cp ListenSense.java /opt/tinyos-2.1.2/support/sdk/java/net/tinyos/ tools • java 디렉토리로 이동 후, 재 컴파일 및 jar 파일 재생성 $ cd/opt/tinyos-2.1.2/support/sdk/java $ mv tinyos.jar tinyos.jar.org (기존 jar 파일 보관) $ make (java 재컴파일) $ jar –cvf tinyos.jar ./net (jar 파일 재생성)

  15. ListenSense.java에 의한 센싱 값 출력 앞의 SenseToRadio와 같은 동작 환경에서 Listen 대신 ListenSense 실행

  16. Term Project • 프로젝트 기능 설명 • SenseToRadio 및 ListenSense를 수정하여, 온도, 습도, 조도 측정 값을 모두 전송하여 PC 화면에 출력하는 기능 수행 • SenseToRadio 예 • Timer를 사용하여 각 1초마다 온도, 습도, 조도 값을 센싱한 후, 이 세가지 데이터가 모두 센싱되면 Sink 노드로 송신 • 즉 매 3초마다 하나의 메시지에 온도, 조도, 습도를 모두 전송 • ListenSense 예 • 수신한 프레임에서 ID, Count, 세 가지 센싱 값을 추출 • 센싱 값을 섭씨온도, 습도(%), LUX(조도) 값으로 변환하여 출력 • 제출 관련 • 각 조별 프로젝트 수행 • 12/4 일 수업 시간(PM 1: 00)에 발표 및 데모(조원 역할 명시) • 소스 코드, 프로그램 설명문, 발표 자료를 발표 후 메일로 제출

More Related