Architectures and Applications for Wireless Sensor Networks (01204525) Sensor Node Programming II (UART and Radio) Chaiporn Jaikaeo

Slides:



Advertisements
Similar presentations
Phil Buonadonna, Jason Hill CS-268, Spring 2000 MOTE Active Messages Communication Architectures for Networked Mini-Devices Networked sub-devicesActive.
Advertisements

Hardware and Python Steve Granda. Why would I want to do this? You want to make something interactive. You want to recreate sputnik. You want to measure.
JED Microprocessors Pty Ltd Presenting the JED T430 low-cost Projector Controllers Nov 22nd, 2009.
Optimization of intrusion detection systems for wireless sensor networks using evolutionary algorithms Martin Stehlík Faculty of Informatics Masaryk University.
DATA COLLECTION USING ZIGBEE NETWORK Timothy Melton Moscow, ID.
Handheld TFTP Server with USB Andrew Pangborn Michael Nusinov RIT Computer Engineering – CE Design 03/20/2008.
Technion – Israel Institute of Technology Department of Electrical Engineering High Speed Digital Systems Lab Project performed by: Safi Seid-Ahmad Emile.
7/13/2007AIIT Summer Course - D#1 Wireless Embedded Systems and Networking Lab Day 5: Part 1: TinyOS Programming on Open Source Distribution Jaein Jeong.
P09311: Interface for Multi-Purpose Driver/Data Acquisition System Adam Van FleetProject Leader, EE DAQ Hardware Development David HoweElectrical Engineer.
2008EECS Embedded Network Programming nesC, TinyOS, Networking, Microcontrollers Jonathan Hui University of California, Berkeley.
A Framework for Patient Monitoring A. L. Praveen Aroul, William Walker, Dinesh Bhatia Department of Electrical Engineering University of Texas at Dallas.
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Jirasak Raksachum Prince of Songkla University.  XBee ?  Specifications of the XBee®/XBee ‐ PRO®  Pin Signals  Serial Communications  ZigBee & Network.
CCNA 2 v3.1 Module 2.
Robotics Research Laboratory Louisiana State University.
Lab 4 ZigBee & with PICDEM Z Boards 55:088 Spring 2007.
1 Semester 2 Module 2 Introduction to Routers Yuda college of business James Chen
SERIAL BUS COMMUNICATION PROTOCOLS
Ch. 5 – Access Points. Overview Access Point Connection.
Little arduino microcontrollers Meghan Jimenez 12 February 2014.
DPNM Lab., POSTECH 1/25 CS490K - Internet of Things (IoT) Jonghwan Hyun DPNM Lab. Department of Computer Science and Engineering, POSTECH
J2ME Messaging Khanh Le. Objective  The objective of wireless messaging is to extend the networking and I/O capabilities of J2ME applications to send.
NetBurner MOD 5282 Network Development Kit MCF 5282 Integrated ColdFire 32 bit Microcontoller 2 DB-9 connectors for serial I/O supports: RS-232, RS-485,
Objectives Define IP Address To be able to assign an IP address with its Subnet Mask and Default Gateway to a PC that operates using Windows 7 or Fedora.
Project #2 Mobile Multiplayer Game: Tic-Tac-Toe Project #3 TinyOS Sensing Application EE194WIR Matt Magpayo
Institute of Computer and Communication Network Engineering OFC/NFOEC, 6-10 March 2011, Los Angeles, CA Lessons Learned From Implementing a Path Computation.
Lab 4 ZigBee & with PICDEM Z Boards 55:088 Fall 2006.
How to setup Genesis LC1 and Genesis Flex with the Buffalo Access Point to maximize wireless performance…
Lab 5 System Design Thomas Watteyne EE290Q – Spring 2010
1.Overview 2. Hardware 3. Software Interface 4. Triggering 5. Installation 6. Configuring.
Introduction to Network Programming Asst. Prof. Chaiporn Jaikaeo, Ph.D. Computer Engineering Department.
Cisco S2 C4 Router Components. Configure a Router You can configure a router from –from the console terminal (a computer connected to the router –through.
2007 Oct 18SYSC2001* - Dept. Systems and Computer Engineering, Carleton University Fall SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices.
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.
1. Insert the Resource CD into your CD-ROM drive, click Start and choose Run. In the field that appears, enter F:\XXX\Setup.exe (if “F” is the letter of.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
Data Streams David Meredith Source Chapter 19 of – Shiffman, D. (2008). Learning Processing. Morgan Kaufmann, Burlington, MA. ISBN:
Checking Zigbee network What to do if the system is not working…
Robotics Research Laboratory Louisiana State University.
2009 Sep 10SYSC Dept. Systems and Computer Engineering, Carleton University F09. SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices 7.2.
Simulation of Distributed Application and Protocols using TOSSIM Valliappan Annamalai.
4BP1 Electronic & Computer Engineering Paul Gildea th Year Interim Project Presentation.
Done By: Amnon Balanov & Yosef Solomon Supervisor: Boaz Mizrachi Project ID: d02310.
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 2 Module 2 Introduction to Routers.
 “Zigbee is a suite of high level communication protocols using small, low power digital radios based on an IEEE 802 standard.”  Basically- short-range.
Architectures and Applications for Wireless Sensor Networks (204525) Sensor Node Programming Chaiporn Jaikaeo Department of Computer.
Lab 4 ZigBee & with PICDEM Z Boards 55:088 Spring 2006.
Wireless LANs and PANs : Data Communication and Computer Networks Asst. Prof. Chaiporn Jaikaeo, Ph.D.
Team Scribacious Rabble Design Constraint Analysis Paul Rosswurm Mitch Erdbruegger Ben Kobin William Hess.
Final Report Passakon Prathombutr, Ph.D NECTEC
Architectures and Applications for Wireless Sensor Networks ( ) Sensor Network Programming and MoteLib Simulator Chaiporn Jaikaeo
COLONYWIRELESS September 26, Outline 1.Motivation and Goals 2.Introduction to the XBee 3.The Wireless Library 4.Example Packet Group 5.The Token.
IMetos Wireless sensor Networks. Definitions I : Radio WAP(W ireless A ccess P oint ) The WAP is the radio interface needed to command the iMetos3 radio.
Network Kernel Architectures and Implementation ( ) Node Programming Chaiporn Jaikaeo Department of Computer Engineering Kasetsart.
Our Project Next generation communication system for vehicles ▫Simple, real-time visual communication Multi-touch input ▫Driver’s gestures produce an.
Thermal Detecting Wireless Sensor Network
Hands-on Session 1 Boot Linux Connect to Linux via USB-to-UART and Putty Compile and run a simple program.
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.
Final Presentation Smart-Home Smart-Switch using Arduino
Connecting A ZigBee Sensors Network To A Cellular Modem For Remote Control Presenting: Eli Zuaretz Gilad Tiomkin Advisor: Dr. Chen Avin Co Advisor: Ilan.
1 Data Communications and Network Programming: Course Introduction Asst. Prof. Chaiporn Jaikaeo, Ph.D.
Compute Node Tutorial(2) Agenda Introduce to RocketIO How to build a optical link connection Backplane and cross link communications How to.
Why does it need? [USN] ( 주 ) 한백전자 Background Wireless Sensor Network (WSN)  Relationship between Sensor and WSN Individual sensors are very limited.
Timothy Kritzler and Joseph Mintun Sponsor: Martin Engineering, Illinois Advisors: Dr. Malinowski and Dr. Ahn Bradley University Electrical and Computer.
Jeremy Sandoval University of Washington May 14, 2013
Chip Config & Drivers – Required Drivers:
LEGO Education - Mindstorms EV3 - Computer/control center – The Brick
Presentation transcript:

Architectures and Applications for Wireless Sensor Networks ( ) Sensor Node Programming II (UART and Radio) Chaiporn Jaikaeo Department of Computer Engineering Kasetsart University

2 Outline UART communication UART communication Single-hop radio communication Single-hop radio communication

3 Connecting Mote to PC Via USB dongle Via USB dongle

4 UART API ( motelib/uart.h ) Enable UART (both TX and RX) Enable UART (both TX and RX) Send a single byte over UART Send a single byte over UART Send multiple bytes over UART Send multiple bytes over UART uartEnable(true,true); uint8_t buf[10]; : uartWrite(buf, 10); uartWriteByte(50);

5 UART API (cont'd) Check whether there is any data received from UART Check whether there is any data received from UART Read a single byte from UART input buffer Read a single byte from UART input buffer Send formatted string over UART using Standard I/O library Send formatted string over UART using Standard I/O library uint8_t byte = uartReadByte(); #include : printf("Hello, world\n"); printf("i = %d\n", i); if (uartInputLen() > 0)...

6 Processing UART Data on PC Locate UART device file Locate UART device file  Run dmesg to find out  Usually /dev/ttyUSB0 or /dev/ttyACM0 For textual data For textual data  Run terminal program such as screen, gtk-term, putty on UART device For binary data For binary data  Any UART library can be used  E.g., Python's serial package $ dmesg : [ ] usb 4-1: new low speed USB device using uhci_hcd and.. [ ] usb 4-1: config 1 interface 1 altsetting.. [ ] usb 4-1: config 1 interface 1 altsetting.. [ ] cdc_acm 4-1:1.0: ttyACM0: USB ACM device

7 USB-UART Implementation MoteLib provides UART-via-USB implementation (>= rev. 388) MoteLib provides UART-via-USB implementation (>= rev. 388)  Emulated using V-USB library by Objective Development  Based on AVR-CDC project ( Requires no USB dongle Requires no USB dongle Build your app with UART_VIA_USB=1 Build your app with UART_VIA_USB=1 $ make UART_VIA_USB=1...

8 Example: sense-to-uart.c Sense light intensity every second; send values to display via UART Sense light intensity every second; send values to display via UART #include Timer t; void senseDone(uint16_t value); void sense(Timer *t); void boot() { uartEnable(true,true); timerCreate(&t); timerStart(&t, TIMER_PERIODIC, 1000, sense); } void senseDone(uint16_t value) { printf("Light = %d\n", value); actorSetState(ACTOR_0, 0); } void sense(Timer *t) { actorSetState(ACTOR_0, 1); sensorRequestAnalog(SENSOR_1, senseDone); }

9 Testing sense-to-uart Build with UART_VIA_USB option Build with UART_VIA_USB option Capture UART output using screen (or gtk-term or putty) Capture UART output using screen (or gtk-term or putty) $ make UART_VIA_USB=1 flash $ screen /dev/ttyACM0

10 Radio Communication Microchip's MRF24J40 controller Microchip's MRF24J40 controller IEEE 2.4 GHz, 250 kbps IEEE 2.4 GHz, 250 kbps 16 non-overlapping channels 16 non-overlapping channels 16-bit node ID 16-bit node ID 16-bit PAN (Personal Area Network) ID 16-bit PAN (Personal Area Network) ID

11 Configuring Radio Use config-mote.py script located in $MOTELIB_DIR/platforms/iwing- mrf/tools Use config-mote.py script located in $MOTELIB_DIR/platforms/iwing- mrf/tools Have mote enter bootloader, then run: Have mote enter bootloader, then run: E.g., set address to 234 and PAN ID to 555 E.g., set address to 234 and PAN ID to 555 Set channel to 0x1A Set channel to 0x1A $ cd $MOTELIB_DIR/platforms/iwing-mrf/tools $./config-mote.py $./config-mote.py --address panid 555 $./config-mote.py --channel 0x1A

12 Radio Message Format Type and application data are provided by the application via Radio API Type and application data are provided by the application via Radio API Type (1 byte) Header Seq No. (1 byte) App Data (max ~100 bytes)

13 Radio API ( motelib/radio.h ) Broadcast a message (type=7) containing "HELLO" to all neighbors Broadcast a message (type=7) containing "HELLO" to all neighbors  Call txDone() when message has been sent  Use NULL when callback is not needed radioRequestTx(BROADCAST_ADDR, 7, "HELLO", 5, txDone); : void txDone(RadioStatus status) { : } radioRequestTx(BROADCAST_ADDR, 7, "HELLO", 5, NULL);

14 Radio API (cont'd) Set a handler to process received messages Set a handler to process received messages radioSetRxHandler(receive); : void receive(Address src, MessageType type, void *msg, uint8_t len) { : }

15 Example: sense-to-base.c Every second, each sensor node measures light intensity and reports to the base station Every second, each sensor node measures light intensity and reports to the base station  Assume base station has address = 0 Base station reports light measurements over UART Base station reports light measurements over UART Base station Sensor nodes measuring light intensity Sensor node

16 sense-to-base.c void sense(Timer *t) { actorSetState(ACTOR_0, 1); sensorRequestAnalog( SENSOR_1, senseDone); } void senseDone(uint16_t value) { radioRequestTx(0, 1, &value, sizeof(value), NULL); actorSetState(ACTOR_0, 0); } #include Timer t; void sense(Timer *t); void senseDone(uint16_t value); void boot() { timerCreate(&t); timerStart( &t, TIMER_PERIODIC, 1000, sense); }

17 base.c #include void receive(Address src, MessageType type, void *msg, uint8_t len) { if (type == 1) { printf("Node %d: Light = %d\n", src, *((uint16_t*)msg)); } void boot() { uartEnable(true,true); radioSetRxHandler(receive); }

18 Exercise: Voting Machine Create an application for wireless voting machine Create an application for wireless voting machine  Allow user to cast a vote using the USER button  Voting choices are: Red (1), Yellow (2), Green (3), or No Vote (0)  When the USER button is pressed,  Set LED status accordingly  Report current vote to the base station (#1) with message type 50