This book presents an examination of the middleware that can be used to configure and operate heterogeneous node platforms and sensor networks. The middleware requirements for a range of application scenarios are compared and analysed. The text then defines middleware architecture that has been integrated in an approach demonstrated live in a refinery. Features: presents a thorough introduction to the major concepts behind wireless sensor networks (WSNs); reviews the various application scenarios and existing middleware solutions for WSNs; discusses the middleware mechanisms necessary for heterogeneous WSNs; provides a detailed examination of platform-agnostic middleware architecture, including important implementation details; investigates the programming paradigms for WSNs, and for heterogeneous sensor networks in general; describes the results of extensive experimentation and testing, demonstrating that the generic architecture is viable for implementation on multiple platforms.