IPSO Alliance21 March 2017 — The availability of the Internet Protocol (IP) suite on constrained devices, including IPV6 and 6LowPAN, makes a new kind of interoperability for connected devices and Smart Objects possible. IPSO’s Smart Object Guidelines provide a common design pattern, an object model, that can effectively use the IETF CoAP protocol to provide high-level interoperability between Smart Object devices and connected software applications on other devices and services. In this guest article, member company STMicroelectronics showcases how it has adopted the IPSO Smart Object guidelines, along with OMA’s LWM2M and other open standards to simply and effectively manage wireless IoT sensor nodes from the Internet, demonstrating the broad applicability of these technologies for IoT applications.

Thanks to the use of open standards such as OMA Lightweight M2M and IPSO Smart Objects, and STM32 ODE function packs from STMicroelectronics, managing wireless IoT sensor nodes from the Internet has never been so easy!

— Fabien Castanier, STMicroelectronics

Thanks to their performance, scalability and low power consumption, 6LoWPAN wireless sensor networks (WSNs) are emerging as a key technology for a variety of IoT use cases, such as smart home/building or smart lighting applications. Key benefits include mesh networking capability and high scalability, thanks to the use of an IPv6-based protocol suite. 6LoWPAN WSNs truly enable the deployment of IoT application scenarios involving hundreds of wireless sensors within the same network.

Moreover, over the past few years, significant efforts have been made by the Internet Engineering Task Force (IETF) in the area of RESTful environments for constrained devices. In such environments, the device resources (for example, the representation of a temperature sensor value) can be accessed and manipulated using a predefined set of stateless operations, which is the same paradigm used in the traditional Web. These efforts have led to the standardization of a new application layer protocol, the Constrained Application Protocol (CoAP, RFC 7252) along with other related protocols addressing requirements such as Block-wise transfers, HTTP-to-CoAP mapping, Observe/Notification (implementation of Publish/Subscribe paradigm) and group communications.

Furthermore, the Open Mobile Alliance (OMA) has recently defined a new standard for resource-constrained device management called OMA Lightweight M2M (LWM2M). LWM2M builds upon the latest IETF standards. LWM2M defines some interfaces for bootstrapping, registration, object/resource access and reporting. In fact it defines everything that is needed to remotely manage a “lightweight” IoT device (think of a low-power wireless sensor hub, for example) and to access the data that the device produces. The CoAP protocol is used to transfer data between the device and a LWM2M server. OMA Lightweight M2M also defines a simple and extensible object and resource model for application semantics. In addition, the OMA provides a public registry of Objects, managed by the Open Mobile Alliance Naming Authority (OMNA), that OMA and other organizations can use to register new Objects.

Building upon these open standards, the IPSO Alliance has published a set of Objects defining the most common sensors and actuators. These Objects have been specified in the IPSO Smart Object Guidelines, available from the IPSO Alliance website. As an example, a temperature sensor is defined by the “IPSO Temperature Sensor” Object, whose ID is 3303. This Object is compliant with the OMA Lightweight M2M standard and it has been registered by the OMNA. This registration guarantees that the object is uniquely defined. Let’s now assume that a manufacturer creates a device supporting the OMA Lightweight M2M protocol and that the device has a temperature sensor, whose data model is the one defined by the “IPSO Temperature Sensor” Object, then any application server compliant with the LWM2M protocol will be able to interact with the device (for control and data exchange), to access the specific temperature sensor data and to understand its meaning!

This essentially opens the door to the level of application-layer semantic interoperability that the IoT market so desperately needs to reach its full potential.

Putting all the above-mentioned hardware and software technologies together to create such a device may seem a daunting task, but it needs not be so thanks to the solutions recently released by ST and part of the STM32 Open Development Environment (STM32 ODE). The STM32 ODE includes hardware components that enable the development of complete prototypes that can be later refined into final designs. It also includes software packages that are released as STM32 ODE Function Packs, putting together all the functions needed to implement complete application scenarios.  In this specific case, the solutions enable building 6LoWPAN WSNs using sub-1GHz RF communication between nodes, and they enable connection of the nodes to the Internet through Wi-Fi, leveraging the state of the art previously mentioned application layer protocols (namely CoAP, LWM2M, and the IPSO Smart Objects).

With these solutions, you can implement a connected light bulb or an ultra-low power sensor hub that can be controlled from any Internet-connected device with everything based on open standards!

The 6LoWPAN node

All that’s needed is an STM32 Nucleo development board (NUCLEO-F401RE or NUCLEO-L152RE) and a sub-1GHz RF communication expansion board (X-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5) to create a device able to communicate in the 6LoWPAN network. Of course, depending on the application scenario, it may make sense to include some sensors on the node, and this can be done by adding to the kit another STM32 Nucleo expansion board such as the motion MEMS and environmental sensor expansion board (X-NUCLEO-IKS01A2) or the proximity and ambient light sensor expansion board (X-NUCLEO-6180XA1). Actuators can also be implemented as well, in our case we provide a simple example of remote light control of the user LED available on the STM32 Nucleo development board. In order to fully leverage all the features of this hardware development kit, ST has released the FP-SNS-6LPNODE1 software package containing everything that a developer needs, from the low-level device drivers to the IPv6/6LoWPAN communication protocol stack, to the embedded web server and application layer protocols. Needless to say, all the sensors and actuators present on the STM32 Nucleo expansion boards have been represented by IPSO Smart Objects, guaranteeing application level interoperability with any LWM2M-compliant server.

The 6LoWPAN-Wi-Fi gateway

Sensor nodes inside a 6LoWPAN network are useful for a variety of applications, and they can be controlled from other devices in the local network of course. But to truly fulfill the needs of the emerging IoT applications, the nodes need to be connected to the Internet. To reduce costs, we leverage the most broadly deployed LAN technology: Wi-Fi. Using the ST solution, connecting a 6LoWPAN network to the Internet through Wi-Fi connectivity is straightforward. On the hardware side, the solution is based on an STM32 Nucleo development board (NUCLEO-F401RE), a sub-1GHz RF communication expansion board (X-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5) and a Wi-Fi expansion board (X-NUCLEO-IDW01M1). The FP-NET-6LPWIFI1 software package provides the whole gateway functionality.

Putting things together – an end-to-end application scenario example

By using one or more 6LoWPAN IoT sensor nodes and a gateway, it is easy to implement an end-to-end application scenario. In fact, an out-of-the-box experience is possible by leveraging the ready-to-use firmware provided inside the packages. By following the simple step-by-step instructions described in the quick start guides, it is possible, for evaluation purposes, to quickly connect the nodes to a public OMA Lightweight M2M server on the Internet (in our example implementation, we use the server provided by the LWM2M Eclipse Leshan  and to visualize in real time the sensor data associated to each Object (e.g. IPSO Temperature, IPSO Humidity, IPSO Magnetometer, IPSO Presence Sensor, etc…) or to control an actuator (e.g. IPSO Light Control). The solutions are built using open-source components, allowing developers to further extend them in order to implement their own application use cases.

Thanks to these solutions from ST and the use of open standards from the IETF, OMA and the IPSO Alliance enabling interoperability up to the application layer, it has never been so easy to connect wireless IoT sensor nodes to the Internet, to control them and to leverage their data inside any IoT application!

Learn more at www.st.com/stm32ode-fp