This folder contains Java samples that demonstrate an overview of the Google Cloud IoT Core platform.
-
Install the gCloud CLI as described in the device manager guide.
-
Create a PubSub topic:
gcloud beta pubsub topics create projects/my-iot-project/topics/device-events
-
Add the special account
cloud-iot@system.gserviceaccount.com
to that PubSub topic from the Cloud Developer Console or by using the helper script in the /scripts folder. -
Create a registry:
gcloud alpha iot registries create my-registry
--project=my-iot-project
--region=us-central1
--pubsub-topic=projects/my-iot-project/topics/device-events -
Use the
generate_keys.sh
script to generate your signing keys:./generate_keys.sh
-
Create a device.
gcloud alpha iot devices create my-java-device
--project=my-iot-project
--region=us-central1
--registry=my-registry
--public-key path=rsa_cert.pem,type=rs256 -
Connect a sample device using the sample app in the
mqtt_example
folder. -
Learn how to manage devices programatically with the sample app in the
manager
folder.