Send Data to Google Cloud

Before you begin

  1. Download the Google root CA certificate from https://pki.google.com/roots.pem.
  2. Create public/private key pairs. Use OpenSSL only for testing purposes.

About this task

To send data to a Google Cloud device, you can choose any of the following collectors:
  • The iFIX collector
  • The MQTT collector
  • The ODBC collector
  • The OPC Classic DA collector
  • The OPC Classic HDA collector
  • The OPC UA DA collector
  • The OSI PI collector
  • The Server-to-Server collector
  • The Simulation collector
  • The Windows Performance collector
  • The Wonderware collector

Procedure

  1. Access Google Cloud Platform.
  2. Create a project. Note down the project ID.
  3. Create a registry.
    When you create the registry:
    • Use the MQTT protocol.
    • You can choose to provide a CA certificate.
    Note down the registry ID and the region values.
  4. Add a device to the registry.
    When you add the device:
    • Allow device communication.
    • Upload the public key or enter the details manually.
    Note down the device ID.
  5. Access Configuration Hub.
  6. In the NAVIGATION section, under the Configuration Hub plugin for Historian, select Collectors.
    A list of collectors in the default system appears.
  7. If needed, select the system in which you want to add a collector instance.
  8. If needed, select the system in which you want to add a collector instance.
  9. In the upper-right corner of the main section, select .
    The Add Collector Instance: <system name> window appears, displaying the Collector Selection section. The MACHINE NAME field contains a list of machines on which you have installed collectors.
  10. In the COLLECTOR TYPE field, select a collector type, and then select Get Details.
    The INSTALLATION DRIVE and DATA DIRECTORY fields are disabled and populated.
  11. Select Next.
    The Source Configuration section appears.
  12. As needed, enter values in the available fields.
  13. Select Next.
    The Destination Configuration section appears.
  14. Select MQTT, and provide values as described in the following table.
    Field Description
    HOST ADDRESS Enter mqtt.googleapis.com. A value is required.
    PORT Enter 8883 or 443.
    CLIENT ID Enter the ID of the device that you created in the following format: projects/<project ID>/locations/<cloud region>/registries/<registry ID>/devices/<device ID>. For example: projects/mygcpproject/locations/asia-east1/registries/testmqttgcpiot/devices/gcptesting

    A value is required and must be unique for an MQTT broker.

    TOPIC Enter devices/<device ID>/events.
    AUTO REFRESH Indicates whether you want to automatically refresh the authentication token when it expires. If you switch the toggle off, you must manually provide the token as soon as it expires. Google Cloud accepts only those tokens that expire in 24 hours or less; therefore, we recommend that you switch the toggle on.
    USERNAME Enter any value. This value is not used, but only if you enter a value, you can proceed.
    PASSWORD If you have switched the AUTO REFRESH toggle on, leave this field blank. Historian generates a JSON Web Token (JWT) and uses it automatically.
    CA SERVER ROOT FILE Enter the path of the Google root CA certificate that you have downloaded.
    CLIENT CERTIFICATE Enter the path to the client certificate.
    PRIVATE KEY FILE Enter the complete path to the private key file. A value is required.
    PUBLIC KEY FILE Enter the path to the public key file. A value is required.
    CHOOSE CONFIGURATION The type of the configuration to specify the tags whose data you want to collect. Select one of the following options:
    • Historian Configuration: Select this option if you want to add the tags manually. If you select this option, the CONFIGURATION HISTORIAN SERVER field appears.
    • Offline Configuration: Select this option if you want to provide the tag names using the offline configuration file instead of adding tags manually. By default, this file is located in the following location: <installation folder of Historian>\GE Digital\<collector name>
    CONFIGURATION HISTORIAN SERVER The host name of the machine from which you want to access Historian Administrator to add the tags manually for the collector. This field appears only if you have selected Historian Configuration in the CHOOSE CONFIGURATION field.
  15. Select Next.
    The Collector Initiation section appears.
  16. Enter a collector name.
    The value that you enter:
    • Must be unique.
    • Must not exceed 15 characters.
    • Must not contain a space.
    • Must not contain special characters except a hyphen, period, and an underscore.
  17. In the RUNNING MODE field, select one of the following options.
    • Service - Local System Account: Select this option if you want to run the collector as a Windows service using the credentials of the local user (that is, the currently logged-in user). If you select this option, the USERNAME and PASSWORD fields are disabled.
    • Service Under Specific User Account: Select this option if you want to run the collector as a Windows service using a specific user account. If you select this option, you must enter values in the USERNAME and PASSWORD fields. If you have enabled the Enforce Strict Collector Authentication option in Historian Administrator, you must provide the credentials of a user who is added to at least one of the following security groups:
      • iH Security Admins
      • iH Collector Admins
      • iH Tag Admins

    If you choose the first option, you can also configure the collector to start automatically when you start the computer, or, in the case of iFIX collectors, whenever you start iFIX.

  18. Select Add.
    The collector instance is created.
  19. Access Google Cloud Platform, and select Pub/Sub > Topics.
  20. Select Messages > PULL.
    Messages published to the topic that you have created appear. These messages contain the data sent by the collector instance. You can verify that the message content is correct by selecting Message body.