Before you begin

Note: If you don't plan to keep the
resources that you create in this procedure, create a project instead of
selecting an existing project. After you finish these steps, you can
delete the project, removing all resources associated with the project.

Set up the Google Cloud SDK and gcloud

Install the Google Cloud SDK. Cloud IoT Core requires version 173.0.0 or higher of the SDK.

Run the following command to update the gcloud CLI that's included in the SDK:

gcloud components update

If you're using a Compute Engine VM with the default installation of
gcloud, you won't be able to update the components. To enable Cloud IoT Core
on a Compute Engine VM, reinstall gcloud by running the following commands:

Introduction to Cloud IoT Core

Device registration

In order for a device to connect, it must first be registered with Cloud IoT Core. Registration consists of adding a device to a collection (the registry) and defining some essential properties. You can register a device with Cloud Platform Console,
gcloud commands, or the REST-style API. For details, see Creating Registries and Devices.

Collectively, the features that allow you to register, monitor, and configure devices are called the device manager.

Protocols (MQTT and HTTP)

Cloud IoT Core supports two protocols for device connection and communication: MQTT and HTTP. Devices communicate with Cloud IoT Core across a "bridge" — either the MQTT bridge or the HTTP bridge. When you create a device registry, you select protocols to enable: MQTT, HTTP, or both.

MQTT is a standard publish/subscribe protocol that is frequently used and supported by embedded devices, and is also common in machine-to-machine interactions.

HTTP is a "connectionless" protocol: with the HTTP bridge, devices do not maintain a connection to Cloud IoT Core. Instead, they send requests and receive responses.

Device control from the cloud

With Cloud IoT Core, you can control a device by modifying its configuration. A device configuration is an arbitrary, user-defined blob of data that may or may not be structured. If your devices use MQTT, configurations are automatically propagated to them. If your devices connect over HTTP, they must explicitly request configurations.