Discover Packages
github.com/tbpg/golang-samples
iot
manager
command
Version:
v0.0.0-...-9f00414
Opens a new window with list of versions in this module.
Published: Mar 30, 2018
License: Apache-2.0
Opens a new window with license information.
Imports: 10
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Google Cloud IoT Core Device Manager Sample
Authentication
Create a project with the Google Cloud Console , and enable
the [Cloud IoT Core API][].
From the Cloud Console, create a service account,
download its json credentials file, then set the GCLOUD_PROJECT
and
GOOGLE_APPLICATION_CREDENTIALS
environment variable:
export GCLOUD_PROJECT=your-project-id
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your-project-credentials.json
Run the sample
To build and run the sample:
go run manager.go
Before you can connect devices, you will need to generate public / private key
credentials to register and connect.
The following commands generate keys suitable for use on a single device.
openssl req -x509 -newkey rsa:2048 -days 3650 -keyout rsa_private.pem -nodes -out \
rsa_cert.pem -subj "/CN=unused"
openssl ecparam -genkey -name prime256v1 -noout -out ec_private.pem
openssl ec -in ec_private.pem -pubout -out ec_public.pem
Expand ▾
Collapse ▴
Documentation
¶
Command manager lets you manage Cloud IoT Core devices and registries.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.