Model Based Development of A Tinyos-Based Wireless M-Bus Implementation
Model Based Development of A Tinyos-Based Wireless M-Bus Implementation
Model Based Development of A Tinyos-Based Wireless M-Bus Implementation
This contribution is organized as follows: Ch. II describes the background and the overall objectives of the project, ch. III describes the state of the art in LMN platforms and their development, where ch. IV elaborates on the state and the first experiences of the current work in progress. II. SCOPE OF THE PROJECT
I.
INTRODUCTION
Smart metering is a stepping stone towards a more efficient use of the natural resources and of the existing ressoureces of energy distribution installations. Various technologies are currently used and are competing for their place in the market. However, for current and future projects, it can be anticipated that standardized communication protocols will continue to enjoy a rapidly increasing popularity. This especially holds true for the so called primary communication (Local Metrological Network, LMN), which connects local sensors (i.e. meters) or actuators and a data collector or gateway. Major contenders for these LMNs are protocols like ZigBee or Wireless M-Bus. For the protocol implementations, to our best knowledge up to now, mostly legacy engineering processes and technologies are used, and modern approaches such as model driven design processes or open software platform are disregarded. Where the authors team is working on a variety of projects within the field of wireless smart meter protocols [1], it shall be demonstrated within the WiMBex project [2] that it is possible to develop a commercial class Wireless M-Bus implementation following state-of-the art design process and using TinyOS as an open source platform.
The activities in the WiMBex project are partly funded from the European Commission in 7th Framework Program under contract number FP7-SME-2011-286753. The authors and all project partners are grateful for this support.
A. Overall Project Description The aim of the WiMBex project (Remote wireless water meter reading solution based on the EN 13757 standard, providing high autonomy, interoperability and range) is to add a powerful new set of new features to the Wireless M-Bus platforms developed by the consortium SMEs, to enable them to keep pace, and even surpass the needs of the emergent Automatic Water Meter Reading (AWMR) market in Europe, and also to license the developed technology. WiMBex shall exploit the powerful new features of the EN 13757 Wireless M-Bus standard, and in this manner, extend the use and impact of the European standard. B. System Architecture The scientific objective of this proposal is to implement a time-synchronized energy-aware routing protocol based on a Time Division Multiple Access (TDMA) MAC scheduling scheme, to reduce the overall network consumption without degrading network throughput. Research into energy use in wireless sensor networks has demonstrated that most energy is used in the awake state during reception and sending of data. Ongoing research into energy efficient channel access, routing, topology management and in-network processing has resulted in 10+ year battery life-time for many wireless sensors. However, in the AWMR market only single-hop technologies achieve this result. One of the limiting factors in many AWMR multi-hop technologies (i.e. in the ZigBee protocol stack) is the lack of accurate network time synchronization, allowing the mote to enter an ultralow power sleep or idle state for lengthy periods, and to achieve multiyear battery lifetimes. By introducing the new network Q-mode protocol which enables precise network time synchronization the high-power requirements typically associated with multi-hop wireless networks can be significantly reduced via implementation of a Time Division Multiple Access (TDMA)
91
MAC protocol and a efficient energy-aware routing protocol. Energy aware routing protocols have been developed by the research community over the past decade, and have proven to be effective in large-scale network deployments. The metrics for the proposed energy-aware routing protocol are based on link quality and mote energy use (energy harvesting backup) introducing fairness in the way energy is consumed across the network when determining optimal routing schedules.
III.
A. Network Hierarchies and Protocols The focus of this paper is in the further development of the protocols for the Local Metrological Network (LMN), which connects local sensors (i.e. meters) or actuators and a data collector or gateway. It is especially for the LMN, that a broad variety of wireless protocols exists. The most important amongst them are M-Bus, its recent brother Wireless M-Bus [3] and their derivatives, Radian, Wavenis [4], ZigBee over IEEE802.15.4 [5] [6], and Z-Wave [7]. Amongst those, especially ZigBee and Wireless M-Bus are standardized from vendor-independent associations and thus enjoy a high popularity. Both protocols seem to have found their predominant position in various regions of the world.
TABLE I. LAYERS OF M-BUS [8], [9], [10], [11] AND [3]
The WiMBex project develops an automatic water meter reading (AWMR) technology which addresses the limitations of existing AWMR solutions. Many of the WiMBex advantages derive from implementation of recently released and planned parts of the EN 13757 Wireless M-Bus Standard: WiMBex implements EN 13757-5:2009, which specifies the Q-mode Protocol for network time synchronization, and which enables significant power savings. Low power operation will enable WiMBex to operate independently of the electric grid. WiMBex accommodates the new part of the standard, which specifies operation in the newly available 169 MHz band, and which will enable a radio range of 100+ meters (even in the presence of physical barriers). This is a great advantage compared to the vast majority of existing solutions, which operate at 868 MHz or 2.4 GHz. This approach will reduce the need for repeater nodes and their associated technical and commercial disadvantages. WiMBex will support the DLMS standard suite to provide an open, manufacturer independent, interoperable, device and interface specification for electricity, gas, heat and water meters. It is one of the essential elements of the WiMBex-project that it will also incorporate a cost efficient integrated energy harvesting system powered by the available water flow, to eliminate the need for battery replacement for near-zero maintenance costs. Using energy harvesting, WiMBex will provide at least one reading per 24 h, which can be considered relatively high for an AWMR that is independent from the electricity grid and that does not require battery replacement.
Layer 1
Application Layer (EN 13757-3) Network Layer (EN 13757-5) Data Link Layer Data Link Layer wired (EN 13757-2) wireless (EN 13757-4) Physical Layer Physical Layer wireless wired (EN 13757-2) (EN 13757-4)
Wireless M-Bus was standardized in European Norm EN 13757 (cf. Table I) by Cenelec Technical Committee TC294. TC294 has been re-launched in July 2009. ZigBee [5] specifies network layer, security toolbox and application profile. It was first ratified by the ZigBee Alliance in December and published in June 2005. With regard to smart metering, in 2008, the first version of ZigBee Smart Energy (ZSE) profile was ratified and published. It was driven by many market players and showed an enormous momentum with a variety of products being certified only a few months after the standard was finalized. At the time of writing this submission already more than 100 products found their way through the certification process. ZigBee Smart Energy version 2.0 is currently under development in cooperation with a number of other standards development groups. It will offer IP-based control as an alternative to the legacy ZigBee network (NWK) layer. It has to be highlighted that this standards development process is public, i.e. discussion of preliminary documents is opened to parties also outside of the ZigBee Alliance. In parallel to these protocols, which are very much determined for smart metering applications, more general protocols for short range wireless networks (SRWN) exist. This is most notably the 6LoWPAN protocol [12], which supports IPv6 over IEEE802.15.4. B. Implementation Platforms With regard to the implementation platforms, the background of the projects can be unambiguously understood. Whereas the activities around 6LoWPAN are mainly driven
92
from academia, both Wireless M-Bus and ZigBee clearly have a commercial background. Consequently, it is only for 6LoWPAN, that open source implementations exist. [13] give a very nice overview on these implementations. In the meantime, probably the Contiki platform [14] has gained the highest popularity. For ZigBee, most of the platforms are pure commercial stacks, with a few exceptions: OpenBee was a very early attempt with a nicely designed model based development process, using the UML tool Rhapsody and automatic code generation. However, last activities were around 2005. FreakZ is a open source platform, which was determined to be hardware independent and well portable [15]. However, last activities were observed in 2009. The open-ZB project [16] [17] provides open source tools for IEEE 802.15.4 and ZigBee, including an implementation of the time synchronized (beaconenabled) mode of the IEEE 802.15.4 protocol, developed in nesC, under the TinyOS operating system, an implementation of the ZigBee Network Layer supporting the cluster-tree topology, and an implementation of the security sublayer of the IEEE 802.15.4 standard.
B. Model and Test Driven Design Approach The design of the WiMBex protocol stack follows a very systematic model driven approach. It shall also serve as a proof that open source platforms and model-driven design processes can be the fundaments of commercially attractive products. The specifications of the standard are transformed into an extended system requirements specification document. There, they are rearranged with regard to the future implementation. These functional specification in a text document are then translated into models, are UML 2.4.1 exclusively [20]. These are first sequence charts, from where state charts are derived. In some cases, where existing implementation should be used, also flow charts are used. Fig. 3 shows a typical sequence diagram, where Fig. 4 shows a state chart. These models are not restricted to the mere functionality, but also include a systematic set of error handling. These models are then transformed into NesC-code units on a TinyOS platform [21]. Together with the code units, also unit tests are developed and executed. The firmware functionality shall be simulated in the open-source network simulator OMNET++ using NesCT [22].
Figure 2.
IV.
A. Starting point The starting point of the WiMBex project are two predecessor projects. Within the SyncSen project [18], the hardware pplatform (cf. Fig. 2) has been developed, which is also the basis for the WiMBex project. In addition, a TinyOS based implementation of the basic Wireless M-Bus functionality has been realized. Within the DEMAX project [19], a Wireless M-Bus stack has been developed in plain C, which was extensively tested and used in various industrial projects.
C. First Experiences At the given stage, the following basic experiences can be observed: It becomes clear that the formal approach consumes a lot of time and effort. But, as always, during this systematic approach, a very good understanding of the ideas, processes and functionalities can be achieved. The integration of the state diagrams into the TinyOS event driven approach can be very systematic, however,
93
also needs excellent understanding of TinyOS programming paradigm. The largest portion of complexity does not come from the pure functionality, but from all the different measures to support stability (error handling, time-outs, .) The consistent and systematic documentation eases the integration of a distributed workforce.
[2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]
Figure 4.
OUTLOOK The implementation work in both projects is at the time of writing the contribution ongoing. At the time of the conference, more results will be reported. REFERENCES
[1] A. Sikora, P. Villalonga, K. Landwehr, "Extensions to Wireless M-Bus Protocol for Smart Metering and Smart Grid Application", Int'l
Conference on Advances in Computing, Communications, and Informatics (ICACCI-2012), Chennai, India. http://www.wimbex.com/ http://www.m-bus.com/ http://www.wavenis-osa.org/ http://www.zigbee.org G. Kupris, A. Sikora, "ZigBee - Datenfunk mit IEEE802.15.4 und ZigBee", Franzis-Verlag Poing 2007, ISBN 978-3-7723-4159-5. http://www.z-wavealliance.org/ Communication systems for meters and remote reading of meters, Part 2: Physical and link layer, EN 13757-2. Communication systems for meters and remote reading of meters, Part 3: Dedicated application layer; EN 13757-3. Communication systems for meters and remote reading of meters, Part 4: Wireless meter readout (Radio meter reading for operation in the 868 MHz to 870 MHz SRD band), EN 13757-4. Communication systems for meters and remote reading of meters, Part 5: Wireless Relaying, EN 13757-5. http://datatracker.ietf.org/wg/6lowpan/charter/ Y. Mazzer, B. Tourancheau, Comparisons of 6LoWPAN Implementations on Wireless Sensor Networks, 3rd Intl Conference on Sensor Technologies and Applications, Athens (Greece) 2009. A. Dunkels, B. Grnvall, and T. Voigt, Contiki a lightweight and flexible operating system for tiny networked sensors, Proc. of EmNets I, Nov. 2004. http://freakz.sourceforge.net/ J.-H. Hauer, R. Daidone, R. Severino, J. Bsch, M. Tiloca, S. Tennina, An Open-Source IEEE 802.15.4 MAC Implementation for TinyOS 2.1; Poster Session of the 8th European Conference on Wireless Sensor Networks (EWSN 2011), Bonn, Germany, February 2011. http://www.open-zb.net/ http://syncsen.cric-projects.com/ http://www.ise.fraunhofer.de/de/presse-undmedien/presseinformationen/presseinformationen-2009/intelligentesenergiemanagement-in-smart-grids-fraunhofer-ise-koordiniert-projektzu-integralem-kommunikationskonzept http://www.uml.org/ http://www.tinyos.net/ http://nesct.sourceforge.net/
94