Skip to content

Commit

Permalink
samples: net: google_iot: Fix unclear documentation
Browse files Browse the repository at this point in the history
The instructions on setting the necessary Kconfig values is unclear.
Add a description based on values that can be found in the Google IoT
Core console.

Signed-off-by: David Brown <[email protected]>
  • Loading branch information
d3zd3z authored and carlescufi committed May 8, 2020
1 parent 2873afb commit 961e7e7
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions samples/net/cloud/google_iot_mqtt/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,28 @@ Run the ``create_keys.py`` script in the
``samples/net/cloud/google_iot_mqtt/src/private_info/`` directory.

Users will also be required to configure the following Kconfig options
based on their Google Cloud IOT project:

- CLOUD_CLIENT_ID - created from <telemetry>/<region>/registries/<registry name>/devices/<device name>
- CLOUD_AUDIENCE - created from telemetry without projects on front
- CLOUD_SUBSCRIBE_CONFIG - created from /devices/<device name>/config
- CLOUD_PUBLISH_TOPIC - created from /devices/<device name>/state
based on their Google Cloud IOT project. The following values come
from the Google Cloud Platform itself:

- PROJECT_ID: When you select your project at the top of the UI, it
should have a "name", and there should be an ID field as well. This
seems to be two words and a number, separated by hyphens.
- REGION: The Region shows in the list of registries for your
registry. And example is "us-central1".
- REGISTRY_ID: Each registry has an id. This is a string given when
creating the registry.
- DEVICE_ID: A name given for each device. When viewing the table of
devices, this will be shown.

From these values, the config values can be set using the following
template:

.. code-block: kconfig
CLOUD_CLIENT_ID="projects/PROJECT_ID/locations/REGION/registries/REGISTRY_ID/devices/DEVICE_ID"
CLOUD_AUDIENCE="PROJECT_ID"
CLOUD_SUBSCRIBE_CONFIG="/devices/DEVICE_ID/config"
CLOUD_PUBLISH_TOPIC="/devices/DEVICE_ID/state"
See `Google Cloud MQTT Documentation
<https://cloud.google.com/iot/docs/how-tos/mqtt-bridge>`_.

0 comments on commit 961e7e7

Please sign in to comment.