What is IoT Plug and Play?
IoT Plug and Play enables solution builders to integrate smart devices with their solutions without any manual configuration. At the core of IoT Plug and Play, is a device model that a device uses to advertise its capabilities to an IoT Plug and Play-enabled application. This model is structured as a set of elements that define:
- Properties that represent the read-only or writable state of a device or other entity. For example, a device serial number may be a read-only property and a target temperature on a thermostat may be a writable property.
- Telemetry that's the data emitted by a device, whether the data is a regular stream of sensor readings, an occasional error, or an information message.
- Commands that describe a function or operation that can be done on a device. For example, a command could reboot a gateway or take a picture using a remote camera.
You can group these elements in interfaces to reuse across models to make collaboration easier and to speed up development.
To make IoT Plug and Play work with Azure Digital Twins, you define models and interfaces using the Digital Twins Definition Language (DTDL). IoT Plug and Play and the DTDL are open to the community, and Microsoft welcomes collaboration with customers, partners, and the industry. Both are based on open W3C standards such as JSON-LD and RDF, which enables easier adoption across services and tooling.
There's no extra cost for using IoT Plug and Play and DTDL. Standard rates for Azure IoT Hub and other Azure services remain the same.
This article outlines:
- The typical roles associated with a project that uses IoT Plug and Play.
- How to use IoT Plug and Play devices in your application.
- How to develop an IoT device application that supports IoT Plug and Play.
IoT Plug and Play is useful for two types of developers:
- A solution builder is responsible for developing an IoT solution using Azure IoT Hub and other Azure resources, and for identifying IoT devices to integrate.
- A device builder creates the code that runs on a device connected to your solution.
Use IoT Plug and Play devices
As a solution builder, you can develop a cloud-hosted IoT solution that uses IoT Plug and Play devices. Use IoT Hub - a managed cloud service, that acts as a message hub for secure, bi-directional communication between your IoT application and your devices.
When you connect an IoT Plug and Play device to an IoT hub, you can use the Azure IoT explorer tool to view the telemetry, properties, and commands defined in the interfaces that compose the model.
If you have existing sensors attached to a Windows or Linux gateway, you can use IoT Plug and Play bridge, to connect these sensors and create IoT Plug and Play devices without the need to write device software/firmware (for supported protocols ).
Develop an IoT device application
As a device builder, you can develop an IoT hardware product that supports IoT Plug and Play. The process includes three key steps:
Define the device model. You author a set of JSON files that define your device's capabilities using the DTDL. A model describes a complete entity such as a physical product, and defines the set of interfaces implemented by that entity. Interfaces are shared contracts that uniquely identify the telemetry, properties, and commands supported by a device. Interfaces can be reused across different models.
Author device software or firmware in a way that their telemetry, properties, and commands follow the IoT Plug and Play conventions. If you are connecting existing sensors attached to a Windows or Linux gateway, the IoT Plug and Play bridge can simplify this step.
The device announces the model ID as part of the MQTT connection. The Azure IoT SDK includes new constructs to provide the model ID at connection time.
IoT Plug and Play devices must use MQTT or MQTT over WebSockets. Other protocols such as AMQP or HTTP are not valid to implement IoT Plug and Play devices.
The IoT Plug and Play device certification program verifies that a device meets the IoT Plug and Play certification requirements. You can add a certified device to the public Certified for Azure IoT device catalog.
Now that you have an overview of IoT Plug and Play, the suggested next step is to try out one of the quickstarts: