Source: Introducing Cloud IoT Core commands: increased flexibility to control your fleet of embedded devices from Google Cloud
Today’s businesses need a fast and responsive way to communicate with and control the fleets of IoT devices out in the field. Today, we’re announcing a new device commands feature for our Cloud IoT Core managed service, providing high-frequency, low-latency, ephemeral messaging between the cloud and IoT devices.
Device commands provide a real-time alternative to Cloud IoT Core device configs, enabling many new IoT use cases. Starting today, device commands are generally available in IoT Core for all Google Cloud Platform users.
Understanding device commands
IoT deployments require bidirectional communication between devices and the cloud. Sending data from a device to the cloud is usually trivial, but sending data back down to devices—particularly with high throughput and low latency—can be quite a challenge. Many users choose to leverage MQTT for their communication, mainly because its publish-subscribe pattern simplifies the process of sending useful data to devices. If you want to sell a lightbulb that turns on as soon as the user says “OK, Google, turn on the light,” fast response times are essential to a good user experience.
Cloud IoT Core provides channels for secure, persistent bidirectional communication via the existing state and config topics. These topics can be used to update the respective state and configuration settings for a device in the cloud. The config topic provides message persistence and guaranteed delivery to the device whenever it comes online. Config is great for setting persistent configuration information such as firmware version, an asset tag, or the device’s physical installation location. However, it’s not intended for sending high-frequency or ephemeral messages, like turning on or dimming a light.
Cloud IoT’s new device commands feature can play an essential role in certain IoT scenarios, because it provides high-frequency, low-latency, ephemeral messaging between the cloud and each device. Commands lets users send up to 100 messages per second, per device, from the cloud to the device, and each message payload can be up to 256 kb in length. This limit is much greater than the current limit of 1 update per second for config messages. Devices subscribed to the IoT Core MQTT Bridge will receive these messages instantly, creating a low latency channel that users can trust for real-time control. Device commands is exposed as a new API in the IoT Core device manager, which lets you easily integrate with existing applications and Google Cloud IAM for access management. Commands supports the MQTT QoS 1 specification, which lets the user know right away if their message was delivered to the device or if it needs to be sent again (a “retry”) later.
Configs vs. commands
Now that IoT Core provides two channels for communication down to devices from the cloud—config and commands—you need to know the best option for your communication needs. You’ll likely want to use config topic for low-frequency updates and modifying the actual configuration of a device—these could be a “mode” or “frequency” setting, for example. You should use device commands for real-time control or to send update messages such as “turn on” or “set RPM speed.” Commands can also be useful in cases where many applications communicate with a single device, and you’d prefer to not need to version of the config message.
What our customers saying
“Device commands enable Smart Parking to continue to achieve its mission of ‘Re-inventing the Parking Experience’ by securely and reliably displaying signs with live information anywhere and everywhere,” explains John Heard, CTO of Smart Parking. “Using device commands, the SmartCloud Platform is able to be an open message management solution.”
“The new device commands feature from Cloud IoT Core provides SOTEC’s industrial gateway customers with real time cloud-to-device control,” says Matthias Feurer, Head of Smart & Connected Systems, SOTEC. “This empowers industrial automation equipment to be cloud-connected and -controlled. This will help us and our customers further realize our vision for smart factories and manufacturing.”
Device commands are now generally available, so take a look at the documentation and try it out.