Files
pycom-documentation/content/pybytes/integrations/google.md
Emmanuel Florent 48e3a22c9e initial commit
2019-06-17 14:24:53 +02:00

3.7 KiB

title, aliases
title aliases
pybytes/integrations/google.html
pybytes/integrations/google.md

Whenever one of your integrated devices sends a signal to our broker, we republish the binary payload to the Google endpoint specified for its integration through MQTT protocol.

Integrate your devices

  1. First of all, you have to create a Google project or select an existing one inside Google console (read also here for further information). Take note of the Project ID, which it will be used for integrating your devices.
  2. Make sure to enable billing and the Cloud IoT Core API for that project.
  3. At this point, you should see inside your Google IoT dashboard that your project is correctly bound to Google IoT services

Google dashboard

  1. Now let's access Pybytes and click Integrations > New integration > Google Cloud

Google Cloud's selection

  1. You'll see that Pybytes requires you to authenticate with your Google account. The account you'll be using, must have the privileges to access that project.

Google's authentication

  1. Once you've logged in, the first thing to do is to specify the project's ID and the region. This is required to correctly identify a resource and list all the related registries.

Step 1: project ID and region

  1. The following step allows you to create a new registry or select an existing one. Whenever you choose a registry, the corresponding topics will be loaded in the dropdown menu below. This is required by Google, but it's different from the topics used by the integration to publish payloads to Google cloud. For further information, please read this section.

Step 2: registry and topic

  1. The last step allows you to choose the devices you want to integrate and summarizes the identifying elements of this integration.

Step 3: Choose devices

  1. Once you click Create, if the operation is successful, you'll be able to see the final screen which states the correct integration.

Successfully integrated

If you access the registry on Google cloud, you'll be able to see the just created device there as well.

Google registry's devices view

Final considerations

We create an ES256 key with a self-signed X.509 certificate for every device. The private key will be used for authenticating the device with the Google's broker. You could access the StackDriver application to see the events, according to the log level you chosed for a device. In case you haven't chosen one, it will inherit the level of the registry it belongs.

Warning: do not delete Google devices directly from Google cloud user interface, otherwise the integration with Pybytes will stop working. Always use Pybytes interface to delete Google devices.