You are on page 1of 20

Table of Contents

A wireless sensor network ........................................................................................... 3 Introduction: ...................................................................................................................... 3


Sensor Network and Nodes: ................................................................................................. 3 Network topologies .................................................................................................................. 4 Star Network (Single Point-to-Multipoint) .................................................................... 4 Mesh Network............................................................................................................................. 4 Power management ................................................................................................................. 4 Routings ........................................................................................................................................ 5 Node localization ....................................................................................................................... 5 Applications: ................................................................................................................................ 5
Structural Health Monitoring Smart Structures .................................................................. 5 2) Industrial Automation. ..................................................................................................... 6 3)Civil Structure Monitoring ................................................................................................ 6

Aodv(ad hoc on demand vector protocol) ........................................................... 6


Introduction: ............................................................................................................................... 6 Working description: ............................................................................................................... 7
Sequence Numbers .............................................................................................................. 9

AODV Characteristics: .......................................................................................................... 10

Zigbee ................................................................................................................................. 10
Introduction: ............................................................................................................................ 10 Working description: ............................................................................................................ 11 Zigbee modes: .......................................................................................................................... 11

Sunspot .............................................................................................................................. 12
Strong Security for Small Devices ................................................................................... 13 Sun SPOT Main Board ........................................................................................................... 13

Java ...................................................................................................................................... 14
Principles ................................................................................................................................... 14 java Platform ............................................................................................................................ 15

Net beans .......................................................................................................................... 15 Datagram and datagram connection:................................................................ 16 Radiogram connections ............................................................................................. 17 Ant commands: .............................................................................................................. 18 Initialization of LEDS and Sensors and communication of sunspots: . 19 Deploying and running of code on spot: ............................................................ 19 References: ....................................................................................................................... 20

Internship report
A wireless sensor network

Introduction:
A wireless sensor network is a Large number of mixed and independent Sensor devices spread over a large field to monitor physical or environmental conditions, such as temperature, sound, vibration, pressure, motion or pollutants and to cooperatively pass their data through the network to a main location. The more modern networks are bidirectional, enabling also to control the activity of the sensors. The development of wireless sensor networks was motivated by military applications such as battlefield surveillance; today such networks are used in many industrial and consumer applications, such as industrial process monitoring and control, machine health monitoring, and so on.

Sensor Network and Nodes:


The WSN is built of "nodes" from a few to several hundreds or even thousands, where each node is connected to one (or sometimes several) sensors. Each such sensor network node has typically several parts: 1. A radio transceiver with an internal antenna or connection to an external antenna 2. A microcontroller, an electronic circuit for interfacing with the sensors. 3. An energy source, usually a battery or an embedded form of energy harvesting. A sensor node might vary in size from that of a shoebox down to the size of a grain of dust depending upon their application and function. The cost of sensor nodes is similarly variable, ranging from hundreds of dollars to a few pennies, depending on the complexity of the individual sensor nodes. Size and cost constraints on sensor nodes result in corresponding constraints on resources such as energy, memory, computational speed and communications bandwidth. The topology of the WSNs can vary from a simple star network to an advanced multi-hop wireless mesh network. The propagation technique between the hops of the network can be routing or flooding.

Network topologies
There are a number of different topologies for radio communications networks. A brief discussion of the network topologies that apply to wireless sensor networks are outlined below.

Star Network (Single Point-to-Multipoint)


A star network (Figure 22.3.1) is a communications topology where a single basestation can send and/or receive a message to a number of remote nodes. The remote nodes can only send or receive a message from the single basestation, they are not permitted to send messages to each other. The advantage of this type of network for wireless sensor networks is in its simplicity and the ability to keep the remote nodes power consumption to a minimum.

Mesh Network
A mesh network allows for any node in the network to transmit to any other node in the network that is within its radio transmission range. This allows for what is known as multihop communications; that is, if a node wants to send a message to another node that is out of radio communications range, it can use an intermediate node to forward the message to the desired node. This network topology has the advantage of redundancy and scalability. If an individual node fails, a remote node still can communicate to any other node in its range, which in turn, can forward the message to the desired location. In addition, the range of the network is not necessarily limited by the range in between single nodes; it can simply be extended by adding more nodes to the system. The disadvantage of this type of network is in power consumption for the nodes that implement the multihop communications are generally higher than for the nodes that dont have this capability, often limiting the battery life.

Power management
The single most important consideration for a wireless sensor network is power consumption. While the concept of wireless sensor networks looks practical and exciting on paper, if batteries are going to have to be changed constantly, widespread adoption will not occur. Therefore, when the sensor node is designed power consumption must be minimized. Power reduction strategies for the sensor itself include: Turn power on to sensor only when sampling. Turn power on to signal conditioning only when sampling sensor. only sample sensor when an event occurs. Lower sensor sample rate to the minimum required by the application.

Routings
Multihop routing is a critical service required for WSN. Because of this, there has been a large amount of work on this topic. Internet and MANET routing techniques do not perform well in WSN. Internet routing assumes highly reliable wired connections so packet errors are rare; this is not true in WSN. Many MANET routing solutions depend on symmetric links (i.e., if node A can reliably reach node B, then B can reach A) between neighbors; this is too often not true for WSN. These differences have necessitated the invention and deployment of new solutions. For WSN, which are often deployed in an ad hoc fashion, routing typically begins with neighbor discovery. Nodes send rounds of messages (packets) and build local neighbor tables. These tables include the minimum information of each neighbors ID and location. This means that nodes must know their geographic location prior to neighbor discovery. Other typical information in these tables includes nodes remaining energy, delay via that node, and an estimate of link quality.

Node localization
Node localization is the problem of determining the geographical location of each node in the system. Localization is one of the most fundamental and difficult problems that must be solved for WSN. Localization is a function of many parameters and requirements potentially making it very complex. For example, issues to consider include: the cost of extra localization hardware, do beacons (nodes which know their locations) exist and if so, how many and what are their communication ranges, what degree of location accuracy is required, is the system indoors/outdoors, is there line of sight among the nodes, is it a 2D or 3D localization problem, what is the energy budget (number of messages), how long should it take to localize, are clocks synchronized, does the system reside in hostile or friendly territory, what error assumptions are being made, and is the system subject to security attacks? For some combination of requirements and issues the problem is easily solved. If cost and form factor are not major concerns and accuracy of a few meters is acceptable, then for outdoor systems, equipping each node with GPS is a simple answer. If the system is manually deployed one node at a time, then a simple GPS node carried with the deplorer can localize each node, in turn, via a solution called Walking GPS.

Applications:

Structural Health Monitoring Smart Structures

Sensors embedded into machines and structures enable condition-based maintenance of these assets .Typically, structures or machines are inspected at regular time intervals, and components may be repaired or replaced based on their hours in service, rather than on their working conditions. This method is expensive if the components are in good working order, and in some cases, scheduled maintenance will not protect the asset if it was damaged in between the inspection intervals. Wireless sensing will allow assets to be inspected when the sensors indicate that there may be a problem, reducing the cost of maintenance and preventing terrible failure in the event that damage is detected. 2) Industrial Automation. In addition to being expensive, leadwires can be constraining, especially when moving parts arei Involved. The use of wireless sensors allows for rapid installation of sensing equipment and allows access to locations that would not be practical if cables were attached. The use of wireless sensors in this application is enabling, allowing a measurement to be made that was not previously practical. 3)Civil Structure Monitoring One of the most recent applications of todays smarter, energy-aware sensor networks is structural health monitoring of large civil structures, such as the Ben Franklin Bridge (Figure 22.6.2), which spans the Delaware River, linking Philadelphia and Camden, N.J. The bridge carries automobile, train and pedestrian traffic. Bridge officials wanted to monitor the strains on the structure as high-speed traveler trains crossed over the bridge. A star network of ten strain sensors were deployed on the tracks of the commuter rail train. The wireless sensing nodes were packaged in environmentally sealed NEMA rated enclosures. The strain gauges were also suitably sealed from the environment and were spot welded to the surface of the bridge steel support structure. Transmission range of the sensors on this star network was approximately 100 meters.

Aodv(ad hoc on demand vector protocol)


Introduction:
AODV is a method of routing messages between mobile computers. It allows these mobile computers, or nodes, to pass messages through their neighbors to nodes with which they cannot directly communicate. AODV does this by discovering the routes along which messages can be passed. AODV makes sure these routes do not contain loops and tries to find the shortest route possible. AODV is also able to handle changes in routes and can create new routes if there is an error.

Working description:
The diagram shows a set up of four nodes on a wireless network. The circles illustrate the range of communication for each node. Because of the limited range, each node can only communicate with the nodes next to it.

Nodes y ou can communicate with directly are considered to be Neighbors. A node keeps track of its Neighbors by listening for a HELLO message that each node broadcast at set intervals. When one node needs to send a message to another node that is not its Neighbor it broadcasts Route Request (RREQ) message. The RREQ message contains several key bits of information: the source, the destination, the lifespan of the message and a Sequence Number which serves as a unique ID. In the example, Node 1 wishes to send a message to Node 3. Node 1s Neighbors are Nodes 2 + 4. Since Node 1 cannot directly communicate with Node 3, Node 1 sends out a RREQ. The RREQ is heard by Node 4 and Node 2.

When Node 1s Neighbors receive the RREQ message they have two choices; if they know a route to the destination or if they are the destination they can send a Route Reply (RREP) message back to Node 1, otherwise they will rebroadcast the RREQ to their set of Neighbors. The message keeps getting rebroadcast until its lifespan is up. If Node 1 does not receive a reply in a set amount of time, it will rebroadcast the request except this time the RREQ message will have a longer lifespan and a new ID number. All of the Nodes use the Sequence Number in the RREQ to insure that they do not rebroadcast a RREQ. In the example, Node 2 has a route to Node 3 and replies to the RREQ by sending out a RREP. Node 4 on the other hand does not have a route to Node 3 so it rebroadcasts the RREQ.

Sequence Numbers Sequence numbers serve as time stamps. They allow nodes to compare how fresh their information on other nodes is. Every time a node sends out any type of message it increases its own Sequence number. Each node records the Sequence number of all the other nodes it talks to. A higher Sequence numbers signifies a fresher route. This it is possible for other nodes to Figure out which one has more accurate information. In the example, Node 1 is forwarding a RREP to Node 4. It notices that the route in the RREP has a better Sequence number than the route in its Routing List. Node 1 then replaces the route it currently has with the route in the Route Reply.

AODV Characteristics:
Will find routes only as needed Use of Sequence numbers to track accuracy of information Only keeps track of next hop for a route instead of the entire route Use of periodic HELLO messages to track Neighbors

Zigbee
Introduction:
ZigBee is a technological standard, based on the IEEE 802.15.4 standard, which was created specifically for control and sensor networks. Within the broad organization of the Institute of Electrical and Electronics Engineers (IEEE), the 802 group is the section that deals with network operations and technologies. Group 15 works more specifically with wireless networking, and Task Group 4 drafted the 802.15.4 standard for a low data rate wireless personal area network (WPAN). The standard for this WPAN specifies not only a low data rate but also low power consumption and low complexity, among other things. The data rate is limited to 250 kbps in the global 2.4

GHz Industrial, Scientific, Medical (ISM) band, 20 kbps in the 868 MHz band used in Europe, and 40 kbps in the 915 MHz band used in North America and Australia. The ZigBee standard is built on top of this IEEE standard, addressing remote monitoring and control for sensory network applications. This standard was created by an organization known as the ZigBee Alliance, which is composed of a large number of companies and industry leaders striving to enable such control devices based on said standard. The ZigBee Alliance is an association of companies working together to enable reliable, costeffective, low-power, wirelessly networked monitoring and control products based on an open global standard. The ZigBee alliance specifies the IEEE 802.15.4 as the physical and MAC layer and is seeking to standardize higher level applications such as lighting control and HVAC monitoring. It also serves as the compliance arm to IEEE802.15.4 much as the Wi-Fi alliance served the IEEE802.11 specification. The ZigBee network specification, to be ratified in 2004, will support both star network and hybrid star mesh networks. specification and expands on the network specification and the application interface.

Working description:
ZigBee basically uses digital radios to allow devices to communicate with one another. A typical ZigBee network consists of several types of devices. A network coordinator is a device that sets up the network, is aware of all the nodes within its network, and manages both the information about each node as well as the information that is being transmitted/received within the network. Every ZigBee network must contain a network coordinator. Other Full Function Devices (FFD's) may be found in the network, and these devices support all of the 802.15.4 functions. They can serve as network coordinators, network routers, or as devices that interact with the physical world. The final device found in these networks is the Reduced Function Device (RFD), which usually only serve as devices that interact with the physical world.

Zigbee modes:
ZigBee operates in two main modes: non-beacon mode and beacon mode. Beacon mode is a fully coordinated mode in that all the device know when to coordinate with one another. In this mode, the network coordinator will periodically "wake-up" and send out a beacon to the devices within its network. This beacon subsequently wakes up each device, who must determine if it has any message to receive. If not, the device returns to sleep, as will the network coordinator, once its job is complete. Non-beacon mode, on the other hand, is less coordinated, as any device can communicate with the coordinator at will. However, this operation can cause different devices within the network to interfere with one another, and the coordinator must always be awake to listen for signals, thus requiring more power. In any case, ZigBee obtains its overall low power consumption because the majority of network devices are able to remain inactive over long periods of time.

Sunspot
The possibilities for wireless sensors have excited scientists and researchers, the business community, military and government officials, and consumers alike for many years. The potential applications for wireless sensors and transducers (sensors combined with actuator mechanisms) are limited only by the imagination. Sensing alone is not enough for many applicationsthe ability to act on the sensory data is also required. A small, battery-powered platform capable of actuation is needed. Just a few examples: Smart dust networks of tiny wireless microelectromechanical sensors (MEMS) could track and report on everything from cold areas in rooms to enemy movements in a military operation. Wireless sensors could catch manufacturing defects by sensing out-of-range vibrations in industrial equipment, monitor patient movements in a hospital room, track fertilizer runoff from farms into lakes, or ascertain the origins of a gunshot. Used in conjunction with RFID tags and actuation mechanisms, they could intelligently control light, heat, and appliances in buildings, making rooms come alive just before people enter. Gesture interfaces harnessing wireless sensors could make it possible to control devices by hand gestures, eliminating the distraction of finding and turning dials and knobs. Swarms or large numbers of autonomously functioning vehicles could be deployed to carry out a prescribed mission and respond as a group to high-level management commands. Researchers at Sun Microsystems Laboratories (Sun Labs) are developing a system that takes major strides toward solving the key challenges that are inhibiting development of wireless sensor and transducer applications. Based on a 32 bit ARM-7 CPU and an 11 channel 2.4GHz radio, Sun SPOT radically simplifies the process of developing wireless sensor and transducer applications. The platform enables developers to build wireless transducer applications in JavaTM using a sensor board for I/O, an 802.15.4 radio for wireless communication, and use familiar Integrated Development Environments (IDEs), such as Net- BeansTM to write code. The Sun SPOT system uses JavaTM technology to up-level programming. Developers can write a program in Java, load it on a wireless sensor device, run it, debug it, as well as access low-level mechanisms, with standard Java IDEs. The inherent portability of JavaTM makes it simpler to migrate applications among platforms and enables developers to build new wireless sensors devices using off-the-shelf hardware components. Java also eliminates or streamlines many of the low-level tasks of traditional development languages such as C, and for the millions of developers who already write code in Java there is little additional learning curve for building wireless sensor/transducer programs. The Sun SPOT system features the Squawk VM, a small J2METM virtual machine (VM) written almost entirely in Java. It provides the ability to run wireless transducer applications on the metal, (directly onthe CPU without any underlying OS), saving overhead and improving performance. End users also gain the flexibility to experiment with different implementations of low-level services, such as networking protocols, which are typically buried inside an OS. A set of Java libraries under development will provide access to the sensors, the I/O pins on the sensor application board, and the integrated on-board radio.

By running multiple applications on the one virtual machine, and by using a more compact representation of class files, the Squawk VM makes better use of the small memory space available on SPOT devices. Sun Labs researchers are working on additional tools that will further simplify development of wireless transducer programs and broaden the scope of possible applications. Examples include: Debugging tools that allow developers to debug a wireless transducer application as it runs on the device. A discovery mechanism that will enable any Sun SPOT operating within the radio field and running a special meta-isolate application to report its statuseven pause and resume applications. Migratable application capabilities that enable applicationswith their complete state informationto move from one Sun SPOT device to another while theyre still running. Over-the-air (OTA) reprogramming capability for sensor devices deployed in large numbers, or in difficult to access or hostile environments. Mesh networking among the Sun SPOT devices in order to use an efficient algorithm for power efficiency and fault-tolerance in the network. Developing new architecture for auto-configuration of the sensor network and its global connectivity to the Internet.

Strong Security for Small Devices


Security is particularly important for wireless transducer applicationsand particularly challenging. With limited memory and computational capabilities, a limited energy supply, and the need to operate in potentially hostile or hazardous environments with unattended operation, wireless transducers require strong security with extremely small overhead. Sun Labs has unique expertise in several security technologies and is applying this expertise to wireless sensors and transducers. One such technology is public-key cryptography which is essential for bootstrapping secure communication between a large number of devices, a problem referred to as scalable key management.

Sun SPOT Main Board


32 bit ARM7 core - 256K RAM/2M Flash Chipon CC2420 802.15.4 radio Integrated antenna Double sided connector for stackable boards Can be powered from a variety of power sources including 1.5V batteries Requires 25-90mA of power depending on operation 35x25 mm in size General Purpose Sensor Application Board

3D accelerometer 9 I/O Pins (PWM capable) Temperature sensor Light sensor 2 3-color LEDs 2 momentary switches Mainly for experimental purposes --All SPI driven peripherals --Experimental application boards available.

Java
Java is a programming language originally developed by James Gosling at Sun Microsystems(which is now a subsidiary of Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are typically compiled to bytecode (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture. Java is a general-purpose, concurrent, class-based, object-oriented language that is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere". Java is currently one of the most popular programming languages in use, particularly for client-server web applications. The original and reference implementation Java compilers, virtual machines, and class libraries were developed by Sun from 1995. As of May 2007, in compliance with the specifications of theJava Community Process, Sun relicensed most of its Java technologies under the GNU General Public License.

Principles
There were five primary goals in the creation of the Java language: 1. It should be "simple, object-oriented and familiar". 2. It should be "robust and secure". 3. It should be "architecture-neutral and portable". 4. It should execute with "high performance". 5. It should be "interpreted, threaded, and dynamic".

java Platform
One characteristic of Java is portability, which means that computer programs written in the Java language must run similarly on any hardware/operating-system platform. This is achieved by compiling the Java language code to an intermediate representation called Java bytecode, instead of directly to platform-specific machine code. Java bytecode instructions are analogous to machine code, but are intended to be interpreted by a virtual machine (VM) written specifically for the host hardware. End-users commonly use a Java Runtime Environment(JRE) installed on their own machine for standalone Java applications, or in a Web browser for Java applets. Standardized libraries provide a generic way to access host-specific features such as graphics, threading, and networking. A major benefit of using bytecode is porting. Programs written in Java have a reputation for being slower and requiring more memory than those written in C. However, Java programs' execution speed improved significantly with the introduction of Just-in-time compilation in 1997/1998 for Java the addition of language features supporting better code analysis (such as inner classes, StringBuffer class, optional assertions, etc.), and optimizations in the Java Virtual Machine itself, such as HotSpot becoming the default for Sun's JVM in 2000. Currently, Java 2.0 code had approximately half the performance of C code. However, Java 5.0 has been shown to run at native speeds that sometimes match and occasionally beat the speed of C and C++. Java uses an automatic garbage collector to manage memory in the object lifecycle. The programmer determines when objects are created, and the Java runtime is responsible for recovering the memory once objects are no longer in use. Once no references to an object remain, the unreachable memory becomes eligible to be freed automatically by the garbage collector. Something similar to a memory leak may still occur if a programmer's code holds a reference to an object that is no longer needed, typically when objects that are no longer needed are stored in containers that are still in use. If methods for a nonexistent object are called, a "null pointer exception" is thrown

Net beans
Net Beans refers to both a platform framework for Java desktop applications, and an integrated development environment (IDE) for developing with Java JavaScript ,C, C++, Scala, Clojure, and others. The NetBeans IDE is written in Java and can run anywhere a JVM is installed, including Windows, Mac OS, Linux, and Solaris. A JDK is required for Java development functionality, but is not required for development in other programming languages.

The NetBeans platform allows applications to be developed from a set of modular software components called modules. Applications based on the NetBeans platform (including the NetBeans IDE) can be extended by third party developers. The NetBeans Platform is a reusable framework for simplifying the development of Java Swing desktop applications. The NetBeans IDE bundle for Java SE contains what is needed to start developing NetBeans plugins and NetBeans Platform based applications; no additional SDK is required. Applications can install modules dynamically. Any application can include the Update Center module to allow users of the application to download digitally-signed upgrades and new features directly into the running application. Reinstalling an upgrade or a new release does not force users to download the entire application again. The platform offers reusable services common to desktop applications, allowing developers to focus on the logic specific to their application. Among the features of the platform are:
      

User interface management (e.g. menus and toolbars) User settings management Storage management (saving and loading any kind of data) Window management Wizard framework (supports step-by-step dialogs) NetBeans Visual Library Integrated Development Tools

Datagram and datagram connection:


This is the generic datagram interface. It represents an object that will act as the holder of data to be sent or received from a datagram connection. The DataInput and DataOutput interfaces are extended by this interface to provide a simple way to read and write binary data in and out of the datagram buffer. An additional function reset() may be called to reset the read/write point to the beginning of the buffer. It should be noted that in the interests of reducing space and speed concerns, these mechanisms are very simple. In order to use them correctly the following restrictions should be observed: 1) The use of the standard DataInput and DataOutput interfaces is done in order to provide a familiar API for reading and writing data into and out of a Datagram buffer. It should be understood however that this is not an API to a Java stream and does not exhibit all of the

features normally associated with one. The most important difference here is that a Java stream is either an InputStream or an OutputStream. The interface presented here is, essentially, both at the same time. As the datagram object does not have a mode for reading and writing, it is necessary for the application programmer to realize that no automatic detection of the wrong mode usage can be done. 2) The DataInput and DataOutput interfaces will not work with any arbitrary settings of the Datagram state variables. The main restriction here is that the offset state variable must at all times be zero. Datagrams may be used in the normal way where the offset is non-zero but when this is done the DataInput and DataOutput interfaces cannot be used. 3) The DataInput and DataOutput read() and write() functions work by using an invisible state variable of the Datagram object. Before any data is read from or written to the datagram buffer, this state variable must be zeroed using the reset() function. This variable is not the offset state variable but an additional state variable used only for the read() and write() functions. 4) Before data is to be received into the datagram's buffer, the offset state variable and the length state variable must first be set up to the part of the buffer the data should be written to. If the intention is to use the read() functions, the offset must be zero. After receive() is called, the data can be read from the buffer using the read() functions until an EOF condition is found. This will occur when the numbers of characters represented by the length parameter have been read. 5) To write data into the buffer prior to a send() operation, the reset() function should first be called. This will zero the read/write pointer along with the offset and length parameters of the Datagram object. Then the data can be written using the write() functions. When this process is complete, the length state variable will be set to the correct value for the send() function of the datagram's connection, and so the send operation can take place. An IndexOutOfBoundsException will be thrown if the number of characters written exceeds the size of the buffer.

Radiogram connections
This interface defines the "radiogram" protocol - the radiogram protocol is a datagram-based protocol that allows the exchange of packets between two devices. This protocol is provided for test purposes and to allow creation of simple demonstrations. It is NOT designed to be used as the base for higher level or more complex protocols. To establish a point-to-point connection both ends must open connections specifying the same port No and corresponding IEEE addresses. Port numbers between 0 and 31 are reserved for system services. Use by applications may result in conflicts. Once the connection has been opened, each end can send and receive data using a datagram created on that connection, eg:

DatagramConnection conn = (DatagramConnection) Connector.open("radiogram://" + targetIEEEAddress + ":10"); Datagram dg = conn.newDatagram(conn.getMaximumLength()); dg.writeUTF("My message"); conn.send(dg) conn.receive(dg); String answer = dg.readUTF(); The radiogram protocol also supports broadcast mode, where radiograms are delivered to all listeners on the given port. Because broadcast mode does not use I802.15.4 ACKing, there are no delivery guarantees. DatagramConnection sendConn = (DatagramConnection) Connector.open("radiogram://broadcast:10"); dg.writeUTF("My message"); sendConn.send(dg); DatagramConnection recvConn = (DatagramConnection) Connector.open("radiogram://:10"); recvConn.receive(dg); String answer = dg.readUTF();.

Ant commands:
y y y y y y

Ant is the ubiquitous build tool in Java environments Ant is implemented in Java Ant is Open Source, maintained by Apache Ant is cross platform and portable Ant is well suited to a large number of automation and scripting tasks. Ant is not a programming language.

Ant can get source code from version control o CVS, Subversion, Synergy, Perforce, ClearCase and many more.
y y y

Ant can compile source code Ant can run unit tests o JUnit3, JUnit4, TestNG, or any arbitrary test application Ant can package compiled code and resources o jars, wars, ears, tars, zips, whatever.

Initialization of LEDS and Sensors and communication of sunspots:


y y y

y y y y y y y

For the initialization of leds and sensors following templates and codes are used ,which are related to java, SunSPOT() Initializes the communication between Base Station and the free-range SunSPOT. getAccelerometerValue() Reading the value of the Accelerometer (vector sum of single vectors on all axes, intensity). getAccelX() Reading the value of the acceleration on the X axis. getAccelY() Reading the value of the acceleration on the X axis. getAccelZ() Reading the value of the acceleration on the X axis. getLightSensorValue() Reading the value of the Light Sensor. getTemperatureSensorValue() Reading the value of the Temperature Sensor (in Celzius degrees). setLEDOff (int LEDNr) Turning off the LED. setLEDOn (int LEDNr,int r,int g,int b) Turning on the LED.

Deploying and running of code on spot:


y

y y

A host application is a Java program that executes on the host computer (e.g. a desktop PC). Host applications have access to libraries with a subset of the api of the libraries used by SPOT applications. This means that a host application can, for example, communicate with a SPOT via a basestation using code identical that which you would use to communicate between two SPOTs. Note that the host application does not run on the basestation; it sends commands to the basestation over a USB connection. The directory Demos/CodeSamples/SunSpotHostApplicationTemplate contains a simple host application. Copy this directory and its contents to a new directory to build a host application. You should base your host application on the template provided. Your host application can open connections in the usual way. The classes required to support this are in spotlib_host.jar, spotlib_common.jar and squawk_common.jar (all in the lib sub-directory of the SDK install directory). These are automatically placed on the build path by the ant

y y y y

scripts but you might want to configure host projects in your IDE to reference them to remove compilation errors. If your application requires non-standard Java VM parameters, then you can add these like this: ant host-run Dhost.jvmargs=-Dfoo=bar Xmx20000000 Creating an executable jar file for a host application It is possible to make make an executable jar file of a desktop application. To do so you must manually set some Java system properties that are normally setup by the ant scripts. You need to do so before attempting to access the radio. If you are using a shared basestation then you need to set the properties "spot.basestation.sharing" to "true" and "SERIAL_PORT" to "dummyport". You also need to launch the shared basestation manager (via "ant start-shared-basestation") before starting your application. If your application is using a dedicated basestation, then set the properties spot.basestation.sharing" to "false" and "SERIAL_PORT" to the port that the basestation is connected to, e.g. COM2 (Windows) or /dev/cu.usbmodem1d11 (Mac). You also need to make sure the application's classpath includes the following files from your SDK/lib directory: multihop_common.jar, spotlib_host.jar, spotlib_common.jar, squawk_common.jar, RXTXcomm.jar,spotclient_host.jar & signing_host.jar. This can be done either on the command line used to launch your application or inside your application's manifest file. Finally you need to tell Java how to find the RXTX native library: librxtxSerial.jnilib (Mac) or rxtxSerial.dll (Windows). This can be done by adding the path to your SDK/lib directory to the system property "java.library.path" or by placing a copy of the library in a folder that Java will look in (e.g. /System/Library/Java/Extensions on the Mac)

References:
1. Wireless Sensor Networks (John A. Stankovic Department of Computer
Science University of Virginia Charlottesville, Virginia 22904.

2. Wireless Sensor Network Principles and Applications; ( Chris Townsend, Steven ArmsMicroStrain, Inc.).
3. www.sunspotworled.com

4.

A Quick Guide to AODV Routing(Luke Klein-Berndt


Wireless Communications Technologies Group National Institute of Standards and Technology).

5. http://www.exubero.com/

6. http://www.wikipedia.com/.

7. Sun Small Programmable Object Technology (Sun SPOT) Developers Guide.

You might also like