Perform LwM2M Execute#
This section describes how to perform a LwM2M EXECUTE operation in your Azure IoT Hub.
An EXECUTE operation lets you perform operations on IoT devices such as a reboot or a firmware upgrade, only on individual resources.
In this section, you learn how to:
- Perform a LwM2M EXECUTE operation on a resource
Prerequisites#
- An active Azure IoT Hub with hub owner access permissions.
- A Coiote IoT DM user account with permissions to use the integration extension.
- A device group created in Coiote IoT DM.
- A configured extension between Coiote IoT DM and Azure Iot Hub.
- A configured integration template in Coiote IoT DM, assigned to the device group.
- A connected device.
Perform EXECUTE#
Let’s perform an EXECUTE operation on the Factory Reset resource with ID 3/0/5.
Note
From the Azure IoT integration standpoint, Factory Reset is interpreted as a Command. Read more about how LwM2M data model is mapped to Azure IoT Hub mechanisms in Concepts.
-
In your Azure IoT Hub account, go to Devices from the left pane.
-
Click on the device and then go to Direct method.
-
As Method name, type
execute
. -
In Payload, paste the following snippet and click Invoke method:
{ "path": "3.0.5" }
Note
The exact LwM2M path of the Factory reset resource depends on the LwM2M client used and may vary slightly, e.g. in the object instance number: 3/1/5. For the purpose of this tutorial, the Anjay LwM2M Client is used. If needed, modify the snippet according to your case.
See value changes in Azure IoT Hub#
The result of the EXECUTE operation is displayed in the same Direct method tab. Scroll down to the Result field and check the HTTP code. The following result means that the device has executed the resource successfully:
{"status":200,"payload":"Executed `3.0.5` successfully"}