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) |
...
Go to the ClearBlade IoT Core console’s Registries page.
Click the device registry ID.
In the left registry menu, click Devices.
Click the device ID you want to send the command.
At the top right of the page, click the ellipsis (⋮) and choose Send command.
Select the command’s format:
Text
Base64
In the Command data field, enter the command.
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.
Click Send command.
API
Use the SendCommandToDevice method to send a command.
Sending a command to a device code samples
...