Google Icon

Helium Google Cloud IoT Core Channel Guide


Google Cloud IoT Core is a fully managed service that allows you to easily and securely connect, manage, and ingest data from millions of globally dispersed devices. Google Cloud IoT Core, in combination with other services on Google Cloud IoT Core platform, provides a complete solution for collecting, processing, analyzing, and visualizing IoT data in real time to support improved operational efficiency.

Helium built the Google Cloud IoT Core Channel to let IoT developers take advantage of this infrastructure quickly, easily, and securely. Once deployed, you'll have a complete, secure, bi-directional data and control pipeline between your Helium devices and Google Cloud IoT Core.


Prerequisites

To get started, you'll need accounts for both Helium Dashboard and Google Cloud IoT Core.

Finding your IoT Core Credentials

Log into IoT Core and click Menu. From there, navigate to IoT Core under Big Data and enable IoT Core. In IoT Core, click Create Device Registry.

google8

Next you need to Create a new Device Registry with a custom Registry ID and your selected Region. Additionally, select or create a new Telemetry Pub/Sub topic for your devices. You can edit these topics later.

google7

From there, navigate to IAM & Admin and select Service Accounts. You may have to create a project to continue. If you do, follow the prompts. You may also be asked to create a service account.

google1

Once in Service Accounts, click Create Service Account and give it a name.

google2

Under Role, select Cloud IoT Editor and make sure Furnish a new private key and JSON are both checked. Click Create.

google3

After this is complete, you'll see a confirmation and a JSON file will be saved to your machine. We'll need this file momentarily.

google4

Configure the Google Cloud IoT Core Channel in Helium Dashboard

Once you've configured your Google Cloud IoT Core account per the intrsuctions above, go to the Channels section in Dashboard and create a new Google IoT Core channel. You'll need to provide your Registry ID, Region, and JSON Private Key. Once these are supplied, give the Channel a name in the next section and finish the process by clicking Next.

google9

Deploying Channel Code to Your Device

Congratulations. Your Google Cloud IoT Channel is now live. It's now time to deploy the Channel code to your device and get data flowing throug the network. To make this easy, we generate a code snippet in the Channel itself for Raspberry Pi, Arduino, and ARM Mbed platforms that refereces the name of the GCP IoT Core Channel you just created. For example, the following code is all that's required to get a Raspberry Pi-based Helium device sending data to a channel called Google IoT Core.


from helium_client import Helium

helium = Helium("/dev/serial0")
helium.connect()

channel = helium.create_channel("Google IoT Core")
channel.send("hello from Python")

For all the generated code snippets, head to the Code section in the Channel you just created. It will look like this:


google10

Verifying Data is Being Sent to the Channel and Google Cloud

Once your Channel is deployed in Dashboard and your device code has been updated with the Channel code, the last step is to verify that data is flowing successfully from your device into Google Cloud IoT Core. You can do this in two ways.

Within the Channel UI, the Events Log will show details on all data sent to that Channel. Succesful events will have a response of OK.

google11

And to verify data is arriving in Google Cloud IoT Core via Helium, navigate to Home, click on APIs, and click on Google Cloud IoT API to view incoming requests and their status codes.

google11