Demo: A Generic Platform for Sensor Network Applications * Rene Mueller, Jan S. Rellermeyer, Michael Duller, and Gustavo Alonso Department of Computer Science ETH Zurich, 8092 Zurich, Switzerland {rene.mueller,rellermeyer,michael.duller,alonso}@inf.ethz.ch Abstract Writing applications for sensor networks often involves low-level programming. In this demo we show a generic sensor network platform (SwissQM/SwissGate) that pro- vides a high level interface for programming sensor net- works and also provides a multi-tier architecture for effi- ciently handling and optimising the operation of the net- work. The demo is based on a small scale (deployment in a building) where the network is used concurrently by several applications to measure heating, ventilation, and air condi- tioning control (HVAC) parameters. The network also im- plements several event detection functions for fire, burglar, and user triggered alarms. In the demo we show how the sensor network can be programmed using queries in sev- eral languages (SQL, Java, XQuery), including user-defined functions (in a C-like language) and the results obtained as a stream of data tuples. We also show the ability to effi- ciently use the network concurrently. 1. Introduction The main limitations of today’s sensor networks are the difficulty in programming them and the typically single use, ad-hoc deployment nature of existing systems. The state of the art today is to set up, with considerable effort, a sensor network for a very concrete and specific purpose (e.g., [1, 3]). Such networks are generally short-lived and not designed for re-use or for extensive reprogramming of their functionality. We envision instead sensor networks as a resource that is available already (in a building, in a city, in a site) and can be used concurrently by different applica- tions for a wide variety of changing purposes. In such scenarios, however, the current limitations of * The work presented in this paper was supported (in part) by the National Competence Center in Research on Mobile Information and Communication Systems NCCR-MICS, a center supported by the Swiss National Science Foundation under grant number 5005-67322. 1-4244-1455-5/07/$25.00 c 2007 IEEE sensor networks need to be resolved. First, it must be pos- sible for multiple applications to concurrently access the WSN. Second, to facilitate application development, pro- gramming must be based on higher levels of abstraction than current languages (e.g., nesC) or operating systems (e.g., TinyOS). In this demo we present the SwissQM/SwissGate sys- tem, a complete platform for programming, deploying, and operating wireless sensor networks. The platform can be programmed using a variety of languages. In the demo we will emphasise programming through a declarative inter- face using languages like SQL or XQuery. Unlike existing declarative sensor systems like TinyDB [2] or Cougar [10], SwissQM/SwissGate supports user-defined functions and provides a more sophisticated architecture to facilitate op- timisation and extensibility. Among other features, we will show the ability of the platform to concurrently run multi- ple, dynamic queries in an efficient manner. 2. The SwissQM/SwissGate platform The backbone of the SwissQM/SwissGate system is a novel architecture (Fig. 1) for efficient data acquisition and data processing over sensor networks [4]. In its current form, users interact with the system by submitting queries. These queries are transformed, optimised, merged, and compiled in the SwissGate sub-system. Then they are dis- seminated to the sensor nodes in the form of short byte- code programs. The nodes run SwissQM [5, 8], a virtual machine for sensor networks. Such an approach gives full flexibility and control in making the network more efficient but does not impose any constraints on the language used to program the sensor network. The design of the instruc- tion set in SwissQM also leads to more compact programs, which reduces the error rates during program dissemination. Additionally, the bytecode of SwissQM provides higher ex- pressiveness compared to systems such as TinyDB where a query engine must run on the sensor nodes and only accepts SQL. Queries running on top of SwissQM can contain user- defined functions. As an example, consider the following