Use Of Cloud IoT Core

  • Use IoT Core to create a registry
  • Use IoT Core to create a device
  • Use Stackdriver Logging to view device logs

Enable APIs

In this section, you check that all the APIs you will use in this lab are enabled.

  • In the GCP Console, on the Navigation menu (), click APIs & Services.
  • Scroll down and confirm that your APIs are enabled.
Cloud IoT API
Cloud Pub/Sub API
Container Registry API
  • If an API is disabled, click Enable APIs and services at the top, search for the API by name, and enable it for your project.
  • Make sure you are in the correct Qwiklabs project. Your project can be found in the connection details. Compare this project to the one listed at the top of the GCP Console page. If they do not match, expand the menu and select the correct project.

Task 1. Create a topic and subscription

In this section, you create a Pub/Sub topic and subscription.

  1. On the Navigation menu, click Pub/Sub > Topics.
  2. Click Create a Topic.
  3. For Name, type device-data, and then click Create.
  4. On the expansion menu () for the topic device-data, click New subscription.
  5. For Subscription name, type device-data-sub
  6. For Delivery Type, select Pull.
  7. Click Create.
naviga_pubsub.png


create_topic.png

Task 2. Create a device registry

In this section, you create a device registry.

  1. On the Navigation menu, click IoT Core.
  2. Click Create a device registry.
  3. Specify the following, and leave the remaining settings as their defaults:
PropertyValue(Type or select)
Registry IDdeviceReg
Region<closest region to you>
Default telemetry topicdevice-data
Device state topicdevice-data
  1. Click Create.

Task 3. Create a device

In this section, you create a device and manually add the authorization key.

  1. Click Devices then click Create a device.
  2. Specify the following, and leave the remaining settings as their defaults:
Device IDdevice1
Device communicationAllow
AuthenticationEnter manually
Public key formatRS256_X509
Public key value(Copy the entire key value, including the dashes at the start and end of the key.)Note: Remove any extra spaces in between -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----.—–BEGIN CERTIFICATE—–MIICmzCCAYOgAwIBAgIBATANBgkqhkiG9w0BAQsFADARMQ8wDQYDVQQDEwZ1bnVzZWQwHhcNNzAwMTAxMDAwMDAwWhcNNDgwMTAxMDAwMDAwWjARMQ8wDQYDVQQDEwZ1bnVzZWQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCUrW81drdHhmda0Deap7uih8weYj763nW3smZaSzPxVKHIkDskV4wimd0givJtfaTk4yY7kEydCLkirjMN79w5Y1Cwr5d+kQ/0lj0zCcGdKfk5Lf+G/Jod3prYFYNREZxUaGoz49sbHt/LuqlDRc5Ew/39pmx1w+BvRC1hvUOos6LLsxqQZt8e1jbpSJNvDZokJMaqVurH5oNIdn/+GZ72jX6BsXdjyku4bLDtbOqtTlU01tbzxzhpBCcWXLT6oUUtIir+XufAtOHCh8fBFrbtArxhcgnzluPcxFXX06reFhxEtbqr9AkHOKby07d7Z+UwxNSGCP3js5F6/GWQwSGNAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAHaZ4IPQZgTjyIsxu42Y/mXgX86p/2tSGXQp3ujcCS4m7BKfFPWw+FBbL3f0As9a90BZTi4ayUjMx7BA/1RePaVoiBC9zpvxdvwxgPvSUqaqY5qVZqBjrjohsOx8Ks+Ib428hLsxeHaXj3xQ/EO/mXp4lSp4kEfAuWgFuoanB0mQ9/YJGjNeW/YKhsc8kTsrbJR6ZsRK9PYz9iSSoj2MNM7dIC9xxe7neopyN+8T45UcZ94PuCeGVIH40f8yExFxSQbQQHZ9p994vUBmWQYk8j81hRJUfpPojvGH5u6qePsfeUxVU/N1pYG/an43muUnvL+5RydxAeNwVl4njBKE1CE=—–END CERTIFICATE—–
  1. Click Create.

Task 4. View Logs

In this section, you check the logs for the registry and device you created.

  1. On the Navigation menu, click Logging > Logs.
  2. For first dropdown – Select Cloud IoT Device > All device_num_id

The logs display: <date> <time> <IAM Role> <CreateDevice> <region> <email>

The logs do not display the published messages because Cloud IoT doesn’t provide DATA_READ, DATA_WRITE logs.

One thought on “Use Of Cloud IoT Core

  1. Manage environmental factors like air, humidity, temperature, and water quality, which directly affect human life Introduction of IoT is changing the world, making it better for each of us. The more IoT solutions are being implemented, the more data needs acute analytics and even artificial intelligence to swiftly receive relevant information. Such info allows companies pinpoint deviations and technical breakdowns in real time. For example, automotive industry improves traffic safety using smart technologies like crash prevention, traffic routing, and eyes-off-the-road detection systems. With all said above, real-time decision making in IoT systems is yet limited with cost, form factor limitations, data transfer delay, and other criteria. Google Cloud IoT tries to change the existing situations using machine learning on the end devices and by introducing services like Cloud IoT Core, Cloud IoT Edge, Edge TPU.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s