Migrate IoT samples to Cloud Client library
See original GitHub issueBecause 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:
- Created 4 years ago
- Reactions:1
- Comments:8 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is not fixed, will resolve once migration is complete.
4/4 will wrap up when #1594 merges