Presentation is loading. Please wait.

Presentation is loading. Please wait.

Feb 2007WSN Training: XMesh Services1 Lab6 Objectives:  Route Control Interface  Understand XMesh transport services 1.Upstream 2.Upstream with end-to-end.

Similar presentations


Presentation on theme: "Feb 2007WSN Training: XMesh Services1 Lab6 Objectives:  Route Control Interface  Understand XMesh transport services 1.Upstream 2.Upstream with end-to-end."— Presentation transcript:

1 Feb 2007WSN Training: XMesh Services1 Lab6 Objectives:  Route Control Interface  Understand XMesh transport services 1.Upstream 2.Upstream with end-to-end acknowledgement 3.Downstream 4.Downstream with end-to-end acknowledgement Note: we’ll not cover services 3 and 4; if you’d like to understand them, read “MoteWorks getting started”

2 WSN Training: XMesh Services2 Feb 2007 RouteControl Interface User can make application level decisions based on network conditions. RouteControl interface extracts information from the routing component. Example Wiring: MyAppM.RouteControl -> XMeshRouter; Example Usage: parent = call RouteControl.getParent();

3 WSN Training: XMesh Services3 Feb 2007 RouteControl Interface Interface: command uint16_t getParent() Description: Returns parent’s address (0xffff for broadcast) Interface: command uint16_t getDepth() Description: Number of hops away the mote is from the base station. Interface: command uint16_t getSender(TOS_MsgPtr) Description: Returns address of the mote that sent the message Interface: command uint8_t getOccupancy() Description: Returns the length of the routing forwarding queue

4 WSN Training: XMesh Services4 Feb 2007 RouteControl Interfaces Interface: command uint8_t getQuality(uint8_t type) Description: Gets a measure of goodness for the current parent. Returns value between 0 to 255, where 255 represents that 100% of messages has been heard.  Type = 1: Send goodness  Type = 2: Receive goodness Interface: command result_t setUpdateInterval(uint16_t Interval) Description: Sets the routing component’s internal route update interval = interval duration in seconds.

5 WSN Training: XMesh Services5 Feb 2007 XMesh Service Identifier: AM type Predefined AM types  QoS Service Types: 1.UPSTREAM 2.UPSTREAM_ACK 3.DOWNSTREAM 4.DOWNSTREAM_ACK Explanation of the predefined AM types  See tos/types/Messages.h for predefined AM types.  All these predefined AM types have been wired to the GenericComm by XMesh  Note: Application must not wire it again.

6 WSN Training: XMesh Services6 Feb 2007 End-to-end acknowledgement Source code: under /MoteWorks/apps/tutorials/lesson_5 What does it do?  send upstream packet (from nodes to base station), requesting end-to-end ack  Use XMesh UpstreamAck service wirings and APIs  Yellow LED toggles when an acknowledgement message is received back from the base station

7 WSN Training: XMesh Services7 Feb 2007 Required Hardware and PC Setup 1.Three MICA Motes: MICA2 (MPR4x0) or MICAz (MPR2600) 2.One sensor or data acquisition board: MTS300 or MTS310, MDA100 is OK too 3.One gateway board: MIB510, MIB520, or MIB600 and the associated hardware (cables, power supply) for each 4.A Windows PC with MoteWorks installed

8 WSN Training: XMesh Services8 Feb 2007 Top-level configuration The ReceiveAck interface is required to implement an event callback function that will be generated by XMesh when the acknowledgment message has arrived from the base station. configuration MyApp_MeshAck { } implementation { //… MyApp_MeshAckM.RouteControl -> MULTIHOPROUTER; MyApp_MeshAckM.Send -> MULTIHOPROUTER.MhopSend[AM_XMULTIHOP_MSG]; MyApp_MeshAckM.ReceiveAck -> MULTIHOPROUTER.ReceiveAck[AM_XMULTIHOP_MSG]; MULTIHOPROUTER.ReceiveMsg[AM_XMULTIHOP_MSG] -> Comm.ReceiveMsg[AM_XMULTIHOP_MSG]; } The only change to the configuration file is the addition of the ReceiveAck interface wiring.

9 WSN Training: XMesh Services9 Feb 2007 Top-level Module  The first change is the transport mode of MODE_UPSTREAM_ACK. This tells XMesh to send an acknowledgement message back to the message originator when the message is received at the base station.  The second change is the addition of the ReceiveAck.receive event function. This is the event called by XMesh when the acknowledgement message has arrived from the base station for the most recently sent message. The yellow LED is toggled upon receiving this acknowledgment message. void task SendData() { … if (call Send.send(BASE_STATION_ADDRESS, MODE_UPSTREAM_ACK, &msg_buffer, sizeof(XDataMsg)) != SUCCESS) … event TOS_MsgPtr ReceiveAck.receive(TOS_MsgPtr pMsg, void* payload, uint16_t payloadLen) { call Leds.yellowToggle(); … Add handling of end-to-end acknowledgement received from base station. Switch service type to MODE_UPSTREAM_ACK

10 WSN Training: XMesh Services10 Feb 2007 Compile & flash motes 1.Compile with designated radio frequency in MakeXbowlocal and typing make Or by typing make route,hp 2.Program the remote nodes by typing make reinstall,1,com# 3.Compile and program a separate base station with XMeshBase by typing make install,0,com#

11 WSN Training: XMesh Services11 Feb 2007 Visualize traffic Visualize the traffic in the Mesh: Use the XSniffer GUI.  Program a mote with application (TOSBase) found in MoteWorks/apps/general/XSniffer.  Start XSniffer GUI, connect it to the gateway board with the XSniffer (i.e., TOSBase) mote. Receive upstream packet from your PC  Start XServe  Connect it to the base station mote.

12 WSN Training: XMesh Services12 Feb 2007 What you need to do? Finish Lab 6 (posted in HuskyCT)


Download ppt "Feb 2007WSN Training: XMesh Services1 Lab6 Objectives:  Route Control Interface  Understand XMesh transport services 1.Upstream 2.Upstream with end-to-end."

Similar presentations


Ads by Google