Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can use ClearBlade IoT Core to send commands to devices. Commands are transitory, one-time directives sent to devices connected to ClearBlade IoT Core and subscribed to the commands topic.

Compared to device configurations, commands are faster, can be sent more frequently, and are independent of other ClearBlade IoT Core features. When choosing between commands and configurations, consider whether you need speed and time-bound directives (commands) or persistence/knowledge over time (configurations).

...

Configurations

Commands

The latest config is retried until delivered (MQTT)

Retried for QoS 1, but not guaranteed to be delivered

Persistent, so if a device connects (MQTT) or polls (HTTP) later, the most recent configuration will still be delivered

Not persistent; delivered only to devices connected at the time the command is sent

Each new version replaces the previous version

No relationship or order among commands

Tells a device what to be; corresponds to state in ClearBlade IoT Core

Tells a device what to do at a specific time

Higher latency

Lower latency

Typically small (max 64 KB) in size

Up to 256 KB

Arbitrary, user-defined blob

Arbitrary, user-defined blob

One update per sec per device

1,000 per sec, per project (configurable)
2,500 per sec, per registry

...

  1. Go to the ClearBlade IoT Core console’s Registries page.

  2. Click the device registry ID.

  3. In the left registry menu, click Devices.

  4. Click the device ID you want to send the command.

  5. At the top right of the page, click the ellipsis (⋮) and choose Send command.

  6. Select the command’s format:

    • Text

    • Base64

  7. In the Command data field, enter the command.

  8. In the optional Subfolder field, enter the subfolder’s command name. Devices that are subscribed to the wildcard topic will receive commands sent to subfolders.

  9. Click Send command.

API

Use the SendCommandToDevice method to send a command.

Sending a command to a device code samples

...