question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrate IoT samples to Cloud Client library

See original GitHub issue

Because it’s easier to instantiate client libraries, we should migrate the IoT samples to the Cloud Client library. Example code showing send command to device:

  const iot = require('@google-cloud/iot');

  const newclient = new iot.v1.DeviceManagerClient({
    // optional auth parameters.
  });

  const parentName = `projects/${projectId}/locations/${cloudRegion}`;
  const registryName = `${parentName}/registries/${registryId}`;
  const binaryData = Buffer.from(data).toString('base64');
  const request = {
    name: `${registryName}/devices/${deviceId}`,
    binaryData: binaryData,
  };
  newclient.modifyCloudToDeviceConfig(request)
    .then(responses => {
      const response = responses[0];
      // doThingsWith(response)
    })
    .catch(err => {
      console.error(err);
    });

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
gguusscommented, Nov 13, 2019

This is not fixed, will resolve once migration is complete.

0reactions
gguusscommented, Jan 17, 2020

4/4 will wrap up when #1594 merges

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating to the Cloud Client Library for Storage
Overview of the migration process. To migrate your Python app to use the Cloud Client Library for Cloud Storage instead of the App...
Read more >
Use Python client library to build a sample application
Follow this step-by-step tutorial to build an Internet-of-Things (IoT) application with InfluxData client libraries and your favorite framework or language.
Read more >
Azure IoT Hub
Manage billions of IoT devices with Azure IoT Hub, a cloud platform that lets you easily connect, monitor, provision, and configure IoT devices....
Read more >
AWS Solutions Library | Amazon Web Services
Deploy an AWS Solution that coordinates and automates many of the manual migration processes, leveraging Cloud Migration Factory on AWS to simplify, expedite, ......
Read more >
Oracle IoT Cloud Service Client Software Library Downloads
Client Software Libraries enable you to connect devices to Oracle IoT Cloud Service over HTTPs, and are available for a range of programing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found