You'll need an account to access the Google Cloud platform. Head over to https://cloud.google.com and make a new account.
Once logged in, navigate to https://console.cloud.google.com/iot.
Click Enable to enable the Cloud IoT API. It may take some time for the API to set up.
The Google Cloud IoT API links with your existing Google Cloud Services projects.
If you already have a project, select your project using the Select a project dropdown.
If you do not have a project, or would like to create a new one for this guide, select Create a project from the Select a project dropdown. Fill out the project name.
The header of your Google Cloud dashboard will display the project you created.
Click the navigation menu. From the navigation menu, click IoT Core.
You'll need to create a registry for your devices. A registry is a "container of devices...created in a specific cloud region, and belongs to a cloud project".
Click Create Registry
Set the Registry ID to the name of your container. The Registry ID must start with a lower case letter.
Select the Region closest to where your devices will be physically located.
You'll be connecting using the MQTT protocol to Cloud IoT Core. Under Protocol, select MQTT.
Underneath the Default telemetry topic dropdown, Create a new Default telemetry topic .
Name the topic events.
Then, Create a new Device State topic. Name the topic state.
Stackdriver Logging allows you to monitor and visualize network traffic as it comes into your Google IoT Core registry, in real-time.
Set the Stackdriver Logging level for this registry to Debug. This will enable Stackdriver logging for each device created in the registry.
Now that you created your registry, it's time to add a device to it!
Create a Device ID. This value is permanently tied to the device, make sure you like it before clicking Create.
Ensure that the public key format selected is RS256 since CircuitPython authenticates with the server using a RS256 private key.
Do not fill out the Public key value, you'll create one later in this guide.
Ensure your Device Details page displays a green checkmark underneath Device communication.
- If you see a red X, click Edit Device and select allow device communication.
Congrats - you've successfully set up Google Cloud IoT Core with a new device!