2012 Sixth International Conference on Sensing Technology (ICST)
Web based Monitoring and Control of WSN using WINGZ (Wireless IP Network Gateway for Zigbee) Kaushik Nanda, Kiran Nayak, Shrikrishna Chippalkatti, Ramana Rao, David Selvakumar, Haribabu Pasupuleti Centre for Development of Advanced Computing Bangalore, India
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected], Abstract - Recent times ZigBee based wireless sensor networks are gaining popularity in various application domain areas like healthcare, structural health monitoring, home and commercial building automation, industrial automation, transportation, agriculture etc. ZigBee standard provides various domain specific application profiles. The sensors are interfaced to ZigBee communication modules to form a wireless personal area network. In order to control and communicate to these networks from backbone infrastructure networks viz. 2G/3G/4G/Wi-Fi a wireless enabled gateway is essential. The hardware platforms and software framework for such Gateways need to be application domain independent to make the systems generic. The work that has been presented in this paper focuses on hardware system design issues and options, software framework and application case studies. The gateway subsystem has been enabled with sufficient storage for local data buffering. The system consists of three modules namely WINGZ (Wireless IP Network Gateway for Zigbee), Ubimote (Wireless ZigBee mote with generic sensor interface) and Ubi-Sense (Generic Sensor board) for application case study. The Gateway Related hardware and software systems enable anywhere connectivity of networked sensors. The heart of the system is WINGZ which is an android based multi protocol wireless gateway supporting WLAN, HSPA (High Speed Packet Access), ZigBee and Ethernet. Keywords— WSN, wireless sensor mote, Wireless sensor network, sensors, WINGZ, Ubimote, Ubi-Sense, ZigBee, Gateway, REST, Android, Web server, Web GUI, W-PANIEEE802.15.4, home automation, wireless control and monitoring.
I. INTRODUCTION Application of wireless sensor network has been proven to be more flexible and advantageous in the domains such as home automation, building automation, healthcare etc. A wireless sensor network can be used to measure the various parameters such as humidity, temperature, light intensity, pollution monitoring and control, energy measurement and metering as well as for controlling of actuators, lighting, HVAC etc. Nowadays the wireless sensor networks are being used in many industrial and home automation scenarios to mainly automate various devices in order to monitor and optimize energy consumption [1]. Enablement of this wireless sensor network data to be available by the IP based networks over the web facilitates accessing the sensor data anytime, anywhere. Besides, it helps to access the real time status of the wireless
978-1-4673-2248-5/12/$31.00 ©2012 IEEE
sensor network on the web pages using PC, mobile phones, PDAs etc as well as to control & configure them remotely. In this article the hardware system design issues and options, software framework design to achieve this goal, has been presented. In order to efficiently interface the wireless sensor network and the IP network various software as well as hardware subsystems are used. In the present work WINGZ[2], a ZigBee[3] based multi protocol gateway (ZigBee Gateway Device i.e. ZGD) is the heart of the system which interfaces the wireless sensor network and the IP based network. WINGZ is a wireless system with support for 3G, Wi-Fi and ZigBee wireless protocols on a single PCB. It supports Android operating system. The Android application running on it enables monitoring and controlling of the web transactions to access the wireless sensor networks. The software architecture includes special features and techniques for efficient WSN data processing between ZigBee W-PAN[4] (Wireless Personal Area Network) and web servers. In this implementation the web pages can interact with the WSN devices using a GCM[5] message passing technique, which is a server push mechanism, unlike other gateways which uses server pull mechanism. The Server pull method will periodically poll the server for the new command even though it is not amiable. The efficient data base design has been implemented to present all aspects of WSN data to the user with the graphical representation of the network. Compared to the other WSN systems, our software includes web based commissioning and configuring the ZigBee nodes of the WSN, cluster management, etc. and user can get the alarm notifications on the critical data points over web as well as through SMS to mobiles. The purpose of the current work also includes establishing a wireless sensor network as a case study in home and building automation scenario and interfacing them to the IP based network using our WINGZ and Ubimote as shown in the Fig.1. In the present document, Section II provides the complete hardware design of the system. Section III explains the overall application domains as case studies that are being targeted and section IV explains the methodologies developed to interface the Zigbee wireless sensor network to the web. Section V has some of the web based GUIs for monitoring & controlling
666
WSN. Section VI highlights the unique features of the System Designed. Section VII is conclusion.
advanced PCB Manufacturing techniques, Laser drilled stacked microvia, minimum trace width as small as 3.2mils etc helps to achieve larger functionality in a smaller foot print The Fig. 3 shows the picture of WINGZ. .
Fig. 2. Block diagram of WINGZ
Fig. 1. Overall architecture of Sensor Network System Platform based on WINGZ and Ubimotes
II. HARDWARE DESIGN In the present Sensor Network System Platform two main hardware elements are designed and implemented in the overall architecture as shown in Fig. 1. • WINGZ (Gateway/Coordinator) • Ubimote[7] (End Device/ Router) A. WINGZ (Gateway/ Coordinator) WINGZ is based on a off-the-shelf high end System-onChip with both low power core and signal processing core and the system supports multiple IP network interfaces like WLAN, HSPA & Ethernet along with an off-the-shelf, on board System on Chip for IEEE802.15.4[6]/Zigbee front-end. The system has many peripheral connectivity options through interfaces like SPI, I2C, UART, USB, SD/MMC etc. WINGZ also provides multimedia interfaces like DVI-D, 24-bit parallel RGB Video, and Analog S-Video & Audio. A good Control/Monitor console can be formed using TFT-LCD display/ LCD with touch screen/Key board & mouse. The SD/MMC card interface is used as an external boot device and a local storage for data logging. Block diagram of WINGZ is as shown in Fig 2. The WINGZ hardware is designed and fabricated on a 4"x4" size, 6 Layer HDI[8](High Density Interconnect) PCB. It was possible to accommodate all the components in such a small PCB with the use of 0.4mm pitch BGA package for Processor and other high pin count devices and using PoP(Package on Package) Memory . In addition to this ,
1) Application Processor: The main application processor[9] is 720MHz ARM Cortex-A8 based with an integrated 520MHz DSP core suitable for multimedia applications. For better performance & complex application requirements, an additional PoP memory module containing 256MB SDRAM and 512MB NAND Flash has been provided. High Speed USB, Multichannel SPI, Fast I2C, UART, SDIO & MMC controllers are also integrated in the processor. Power management scheme of the processor is flexible & dynamically configurable. This processor supports many Operating systems like Linux, Windows & Android but we have opted for Android based development. 2) IEEE802.15.4 /ZigBee Module: IEEE 802.15.4 has been enabled with an off-the-shelf onboard SoC[10] with a low power 8051 MCU core & an integrated 2.4GHz IEEE802.15.4 RF Transceiver. This MCU has 8KB of RAM and 128 KB of Flash, which makes it suitable for ZigBee applications. This Module is independently programmable. This SoC is interfaced with the Application Processor through UART It is configured with the ZigBee protocol stack to act as the ZigBee network coordinator. 3) WLAN (Wi-Fi) Module: WLAN (Wi-Fi) has been enabled with off-the-shelf module. This supports the features and functional compliance with IEEE 802.11 g/n standards and has a 1T1R RF transceiver for wireless connectivity and a USB interface for the connection with the host processor. 4) HSPA (3G) Module: GSM/GPRS/EDGE/HSPA(3G) has been enabled with offthe-shelf unit for the cellular data interface. This module supports 850/1900/2100 MHz UMTS/HSPA Bands and
667
850/900/1800/1900 MHz Quad Band GSM. Though it has both USB and UART interfaces, USB has been used for both Controls and Data transfer. The device has been configured & controlled using AT commands from the host system.
single chip. An internal 8KB RAM and 128KB of program Flash is available. The SoC has peripheral interfaces like SPI, I2C, UART and GPIOs. 2) Ubi-Sense[11] board This is an externally pluggable module for Ubimote designed by CDAC, Bangalore. This is interfaced with the Ubimote board through a 20 pin board to board connector. This board contains many sensors to sense the vital environmental parameters like temperature, Humidity & Light. III. ANDROID BASED WINGZ GATEWAY SOFTWARE ARCHITECTURE The Zigbee Gateway device (WINGZ) is a suitable embedded hardware platform which supports Android and Linux operation systems. The device is used here to send the Zigbee data received from the ZigBee SoC to remote server using RESTful web services [12]. The presentation of the functionality of a Zigbee gateway[13] and the Zigbee network to the TCP/IP4 based application is achieved through a web based Protocol called REST[14][15] (Representational State Transfer), SOAP (Simple Object Access Protocol and GRIP(Gateway Remote Interface Protocol) [13].
Fig. 3. WINGZ (Wireless IP Network Gateway for Zigbee)
5) Ethernet: WINGZ system has an onboard USB Hub/Ethernet controller for the wired LAN. This 10/100 Ethernet controller has a High-Speed USB-ULPI interface with the application processor. A standard RJ-45 compatible LAN cable (parallel) can be used to connect it to the LAN switch/hub. B. Ubimote (End Device/ Router) Ubimote is a wireless sensor mote designed by CDAC, Bangalore, which is based on IEEE802.15.4 MAC and PHY layers. This board consists of a ZigBee SoC with inbuilt RF transceiver as the main component and other peripherals. Ubimote can be programmed with ZigBee stack to act as an end-device or a router. For case studies we have used these motes both as end devices and routers to support multi-hop ZigBee network.
Fig. 4. Ubimote
1) ZigBee SoC Commercial off-the-shelf ZigBee System-on-Chip for 2.4 GHz IEEE802.15.4/ZigBee has been utilized. It is based on low power 8051 microcontroller core and a RF Transceiver on
Fig. 5. WINGZ Gateway software architecture
In this design REST architectural style has been used since it is a widely adopted methodology for presenting structured data to a host or client application using XML(Extensible Markup Language) or JSON(Java Script Object Notation) based documents[14],[15]. The request directed to the gateway from the web based clients can be commands that are executed specifically on the gateway itself or are forwarded to the addressed Zigbee end node through the gateway radio interface for execution on the remote node. The REST architecture uses HTTP POST, GET, PUT, DELETE methods to interface the Zigbee data to the outside IP network. The Android based REST application is used to process the incoming Zigbee data and send it to the remote server/database using HTTP protocol. The device also has a touch screen LCD (Liquid Crystal Display) and android
668
graphical user interface that can be used to control and commission the Zigbee network. As shown in the Fig. 5, the device will receive the Zigbee packets form the Zigbee radio over the serial port and it will be sent to the android application using JNI (Java Native Interface). The android REST client application which runs on Host processor of WINGZ will get the incoming packets from the JNI and it will be pre processed to check the validity of the received packets. Later it will be sent using a unique URI (Uniform Resource Identifier) with HTTP POST request to the server. IP based communication to the server is done through 3G (HSPA) or Wi-Fi to make the system fully wireless. In case of availability of wired network, Ethernet is preferred as the interface with IP network. In outdoor usage scenario the wireless connectivity is preferred. Selection of wireless IP interface between Wi-Fi and 3G (HSPA) is decided on the basis of network availability and/or signal strength.
2) Response/Data packet: This is a packet sent by the coordinator device to the host processor. This will be used to send the sensor specific data received from the end devices on the co-ordinator to the host processor. This packet also can be used to acknowledge the command sent by the host processor. As shown in Fig 8 the group id is used to differentiate between different types of WSN parameters being sent by the end devices.
Fig. 8. Packet format of the response and Zigbee data
B. REST based communication between WINGZ Gateway and Server Each information of a Zigbee end device which is a part of a A. ZigBee transceiver and host processor communication. WSN is modelled using an object oriented approach. The java The host processor (application processor) of the gateway objects of various category of WSN information are converted will communicate with the Zigbee coordinator (ZigBee SoC) into JSON format using JSON specific libraries in java. The over the serial port using the packet format shown in the Fig 6. JSON format is used because it is proven to be more efficient Two types of packets have been used for this work. They are and less complex as compared to the XML format. The JSON command packet and response/data packet as mentioned converted data will then be sent to the server using HTTP below. POST, PUT methods by using a unique URI for each category of WSN data. Examples are shown below http://192.168.61.102:8080:/zgd/addressinfo http://192.168.61.102:8080:/zgd/sensorinfo http://192.168.61.102:8080:/zgd/simpledescriptorinfo Fig. 6. Over the serial port packet format
1) Command packet: This packet will be sent by the host processor to the ZigBee SoC slave device which is a Zigbee co-ordinator. This packet will carry the information about the command to be executed on the co-ordinator. The co-ordinator firmware will parse this packet and take the appropriate action. The header information for this packet format is shown in the Fig 7. API Id is used to select the appropriate Zigbee APIs on the coordinator to execute the command and the packet number section is used to acknowledge the command execution. Upon parsing this packet format by the firmware of the Zigbee coordinator, the respective Zigbee APS (Application Support sub-layer) layer API (Application Programming Interface) will be executed to accomplish the task. After execution of the command the result with status will be sent to the host processor using Response packet format shown in Fig4.
The server address: 192.168.61.102:8080 Path of all the resources: /zgd Path of the interested resource: /sensorinfo
Fig. 7. Packet format of the command processing
Fig. 9. WINGZ Gateway-Server communication using REST
669
C. Server side software architecture A. GCM (Google Cloud Messaging ) to control the ZigBee enabled devices. There are two ways by which a ZGD can receive the commands form the server: server pull or server push method. For the server pull method the gateway has to poll the server periodically and has to GET the command if available. In the second method i.e. server push, the server itself push the commands to the gateway when it receives from the different users. Our approach is to implement the server push method using Google’s GCM techniques [5]. GCM is a technique where an application server or android application can send a message to the other android application using some rules and registration procedure. Fig. 10. server side software architecture with database
The Fig 10 shows the Zigbee server and RESTful web processing software components used [16]. The server will get the HTTP request from both the users and the gateway. If it is request from the gateway then the servlet1 will get invoked and the REST method related to the particular incoming URI will get executed for further processing of the Zigbee data. Then it will be stored into the MySQL database for the persistent storage of the WSN data. All the user requests will be handled by the servlet2 which will render the Zigbee web pages to the users to monitor and control the various WSN related parameters. The server also receives the commands sent by the users by using the web pages and it performs the server push mechanism to send the command to the gateway’s android application. IV. WEB BASED ZIGBEE WSN MONITORING AND CONTROLLING OF ACTUATORS Fig.11. GCM for Zigbee command passing
A fully fledged MySQL data base has been designed for persistent storage of the various wireless sensor node specific data. Each will be stored in dedicated tables in the data base. Following are some of the data which will be gathered by the wireless sensor motes. • Sensor information • Address information • Battery information • Descriptor information All the data are presented to user using user friendly web pages which are implemented using Java Server Pages (JSP). The web pages also contain various important and useful provisions for the user and admin person to configure, control the WSN. Some of the important features are. • Sensor logs off all nodes over a given period of time • Binding and unbinding of cluster based network • Alarm settings and notification • Controlling actuators using GCM • Add and remove of new clusters • Graphical view of the WSN and graphs
As shown in the Fig11 the Zigbee server, Android based Zigbee gateway and the Google’s GCM servers are the three main entities present in the work. When the application server needs to push a message to the Android application, it sends the message via an HTTP POST to Google’s GCM servers. The GCM servers route the message to the device i.e. to Zigbee gateway. Once the message is received, a Broadcast Intent is created inside the application of the gateway which is registered to GCM to get the messages. Once the message or command is received it will be sent further to the Zigbee coordinator for the execution. B. Cluster based WSN data gathering and controlling The work also includes the cluster based Zigbee device monitoring and controlling. The cluster based approach[3] will be helpful in home or building scenario where different types of devices are used such as sensors, on/off lights, dimmable lights, motors etc. Each cluster will come up with configurable command sets which can be used to control the
670
Zigbee enabled devices shown in Fig 12. Using the cluster based approach we can also bind between a sensor and an actuator to automate the required action for e.g. If a fire sensor cluster device is bound to alarm cluster device, then whenever a fire sensor device detects a fire it will automatically report it to alarm cluster device using Zigbee indirect addressing method of communication. In our work the web pages are used to manually bind and unbind to control the devices of different cluster over web with the help of gateway.
systems are designed for less power consumption to suit the energy harvesting profiles. In this paper we have proposed generic gateway architecture that is based on Android platform. Unlike most of the other gateway devices that have embedded Linux platform, an android based gateway can provide control and configuration options locally at the device level. The designed gateway hardware has local data logging capability using secure digital (SD) memory card interfacing. Web based commissioning & binding of nodes is designed as per the zigbee protocol specification. VII. CONCLUSION The paper has discussed various hardware design issues and options to design multi-wireless protocol gateway and software framework enabling monitoring and controlling of sensor network end devices / routers etc. The platform developed has been generic and application domain independent and enables anywhere, anytime connectivity to field deployed sensor networks data via internet. Current hardware platforms and software framework could be made energy aware. Subsequently we are planning to investigate self-sustaining network elements from zigbee end device, router, gateway etc. incorporating energy harvesting from solar, thermal, vibration as applicable to powering these devices and optimized software to utilize these available energy efficiently.
Fig. 12. Cluster based Zigbee network
V. WSN WEB INTERFACE As a part of this work we have designed web based GUI for WSN. These GUIs provide web based monitoring and control interface for complete WSN
ACKNOWLEDGMENT We sincerely thank our funding agency Department of Electronics and Information Technology, Ministry of Communications and Information Technology, Government of India for their continuous support for this research. REFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]
Fig. 13. Web GUIs for WSN
[15]
VI. DISTINGUISHING FEATURES Total system components were designed for supporting real time sensing and control using wireless technologies. All the
[16]
671
Dae-Man Han ,Jae-Hyun Lim ,”Smart Home Energy Management System using IEEE 802.15.4 and Zigbee,” in Consumer Electronics,IEEE Transactions on Volume:56,Issue:3,2010 WINGZ System Reference Manual Ver.1, CDAC, Bangalore ZigBee Alliance ,ZigBee Specification.version r17, Jan.2008. IEEE 802.15 Working Group for WPAN http://www.ieee802.org/15/ “Google Cloud Messaging for Android”, http:// http://developer.android.com/guide/google/gcm/index.html IEEE 802.15 WPAN™ Task Group 4 (TG4)EEE 802.15 WPAN™ Task Group 4 (TG4) http://www.ieee802.org/15/pub/TG4.html Ubimote System Reference Manual, CDAC, Bangalore HDI Hand Book online version http://www.hdihandbook.com/ OMAP35x Technical Reference Manual, http://www.ti.com Texas Instruments SoC for 2.4 GHz ZigBee®/ IEEE 802.15.4 with Location Engine http://www.ti.com Ubi-Sense System Reference Manual, CDAC, Bangalore De Stefani, F.,Gamba, P.,Goldoni, et al., ” REnvDB, a RESTful Database for Pervasive Environmental Wireless Sensor Networks”, in Distributed Computing Systems Workshops (ICDCSW),IEEE ZigBee Alliance, Understanding ZigBee Gateway: How ZigBee ex tends an IP net work,Sept.2010. Bill Burke. RESTful Java with JAX-RS. Sebastopol,CA:O’Reilly Media,2009. Leonard Richardson and Sam Ruby. RESTful Web Services. Sebastopol,CA:O’Reilly Media,2009. Mihaela Cardei,Anthony Marcus,Ionut Cardei,Timur Tavtilov,”Webbased Heterogeneous WSN Integration using Pervasive Communication”,in performance Computing and Communications th Conference (IPCCC),2011 IEEE 30 International,2011