To add a device to the device registry in Cloud IoT Core, you need to follow a series of steps that involve creating a device registry, generating an RSA key pair, registering the device, and finally, associating the device with the registry. This process allows you to securely connect and manage your devices within the Cloud IoT Core platform.
Here is a detailed explanation of each step:
1. Create a device registry:
– Open the Cloud IoT Core page in the Google Cloud Console.
– Select your project and click on "Create a device registry."
– Provide a unique ID for the registry and choose the region where you want it to be located.
– Specify the registry's event notification configuration, which includes Pub/Sub topics for state and configuration updates.
– Define the registry's authentication configuration, which determines how devices authenticate with Cloud IoT Core.
2. Generate an RSA key pair:
– Use a tool like OpenSSL to generate an RSA 256 key pair. This key pair will be used to authenticate your devices with Cloud IoT Core.
– Generate a private key and a public key certificate. The private key should be kept securely on the device, while the public key certificate will be used to register the device.
3. Register the device:
– In the Cloud IoT Core page, select your device registry and click on "Create a device."
– Provide a unique ID for the device.
– Choose the authentication type, which in this case is "Public key format."
– Copy and paste the public key certificate generated in the previous step.
– Optionally, you can add metadata to the device, such as device type or location.
4. Associate the device with the registry:
– After registering the device, it needs to be associated with the device registry.
– In the Cloud IoT Core page, select your device registry and click on "Add a device to this registry."
– Choose the device you want to associate from the dropdown list.
– Click on "Add device" to complete the association.
Once you have completed these steps, the device will be successfully added to the device registry in Cloud IoT Core. You can now use the provided MQTT or HTTP endpoints to securely communicate with your device.
Example:
Let's say you want to add a temperature sensor to your Cloud IoT Core device registry. You would start by creating a registry named "temperature-registry" in your preferred region. Then, you would generate an RSA key pair using OpenSSL, with the private key stored securely on the temperature sensor and the public key certificate used for registration. Next, you would register the temperature sensor device, providing a unique ID and selecting the "Public key format" for authentication. You would copy and paste the public key certificate into the registration form, and optionally add metadata such as the sensor's location. Finally, you would associate the temperature sensor device with the "temperature-registry" by selecting it from the dropdown list and clicking on "Add device".
Adding a device to the device registry in Cloud IoT Core involves creating a registry, generating an RSA key pair, registering the device, and associating it with the registry. Following these steps ensures secure connectivity and management of your devices within the Cloud IoT Core platform.
Other recent questions and answers regarding Examination review:
- How can you confirm that messages are being published to the Pub/Sub topic in Cloud IoT Core?
- What are the steps to create a subscription to the Pub/Sub topic associated with the device registry in Cloud IoT Core?
- Where can you find the necessary code for connecting to the device and viewing telemetry data in Cloud IoT Core?
- What are the necessary steps to get started with Google Cloud Platform's Cloud IoT Core?

