0

ModifyCloudToDeviceConfig sends command with qos 1. Is there any other method to send command other than ModifyCloudToDeviceConfig.

Honney Goyal
  • 247
  • 1
  • 5
  • 13

2 Answers2

1

We've just added a new Commands feature to IoT Core which does exactly this. It just went open beta, so you should have access to it now. In the console, if you drill down into a single device you'll see a "Send Command" next to the "Update Config" on the top bar. On command line with the gcloud SDK, you can do a gcloud components update and then gcloud beta iot devices --help to see the new commands command, and in the discovery API you should now have a SendCommandToDevice call to do it. Check the docs on it here

Gabe Weiss
  • 3,134
  • 1
  • 12
  • 15
0

According to the documentation of the MQTT Bridge, for device configurations you can specify two QoS levels:

  • QoS equal to 0: configuration version publish happens only once.
  • QoS equal to 1: the latest configuration update is retried until the device acknowledges it with a PUBACK.

Also, as per the documentation on MQTT device configuration, devices using MQTT can subscribe to a special topic in which configuration updates are received:

/devices/{device-id}/config

After the subscription, the MQTT bridge will respond with a SUBACK using the QoS specified for the config topic (which can either be 0 or 1, as discussed earlier).

Also, if you want to use HTTP Bridge instead, you can define the configuration in Cloud IoT Core, as described in the documentation and later retrieve it manually by explicitly requesting the device configuration.

So, as a summary, when updating the device configuration (which you do using the modifyCloudToDeviceConfig() method, although it can be done through gcloud or the Console too), you cannot specify the QoS level. At this point, the update will be available in Cloud IoT Core, but not applied in the corresponding device. Then, in the second step of the update, where you actually retrieve and apply the update in the device, you can use MQTT (and then specify the QoS level to use in the config topic) or HTTP (and manually retrieve the new configurations whenever you want).

dsesto
  • 7,864
  • 2
  • 33
  • 50