0
votes

I have a device that is an mqtt client to Azure IoT Hub and want the devcie to be notified about changes/updates in the device-twin for that device.

I've successfully connected and updated the reported value in the device-twin from the device but can't seem to get an event when I change some of the desired properties in the device-twin from the Azure shell (https://shell.azure.com/) using a command like this:

az iot hub device-twin update -n <myIotHubBame> -d <myDeviceId> --set properties.desired='{"foo":"bar"}'

On the device I've tried subscribing to $iothub/twin/res/# and devices/<myDeviceId>/messages/devicebound/# but am not receiving any message after issuing the az command from the Azure shell.

I tried also setting a message route with Data Source = Twin Change Events and Endpoint = event but still no message being received in the device.

Anyone has a suggestion on how to get notification to the device when properties in the device-twin changes ?

1

1 Answers

0
votes

The MQTT device needs to subscribe on the following topic

$iothub/twin/PATCH/properties/desired/#

for receiving a notification changes on the device twin desired properties.