-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: retire IoT samples #241
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,7 @@ | ||
# Message Queue Telemetry Transport (MQTT) client for Google Cloud IoT Core | ||
# Deprecation Notice | ||
|
||
This sample app demonstrates connecting to Google Cloud IoT Core and publishing | ||
a single message. | ||
* <h3>Google Cloud IoT Core will be <a href="https://cloud.google.com/iot/docs/release-notes#August_16_2022">retired as of August 16, 2023</a>.</h3> | ||
|
||
## Building | ||
* <h3>Hence, the samples in this directory are archived and are no longer maintained.</h3> | ||
|
||
This example uses `vcpkg` and `CMake` to manage its dependencies. To compile this project: | ||
|
||
1. **Install vcpkg.** | ||
Clone the vcpkg repository to your preferred location. In these instructions we use`$HOME`: | ||
```shell | ||
git clone -C $HOME https://github.com/microsoft/vcpkg.git | ||
``` | ||
|
||
1. **Download or clone this repo** with | ||
```shell | ||
git clone https://github.com/GoogleCloudPlatform/cpp-samples | ||
``` | ||
|
||
1. **Compile this example:** | ||
Use the `vcpkg` toolchain file to download and compile dependencies. This file would be in the directory you | ||
cloned `vcpkg` into, `$HOME/vcpkg` if you are following the instructions to the letter. Note that building all the | ||
dependencies may take several minutes, up to half an hour, depending on the performance of your workstation. These dependencies are cached, | ||
so a second build should be substantially faster. | ||
```sh | ||
cd cpp-samples/iot/mqtt-ciotc | ||
cmake -S. -B.build -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake | ||
cmake --build .build | ||
``` | ||
|
||
# Running | ||
|
||
After you have successfully built the sample, you are almost ready to run the | ||
sample. | ||
|
||
1. Browse to the sample folder | ||
```shell | ||
cd mqtt-ciotc | ||
``` | ||
|
||
1. Create a Cloud Pub/Sub topic | ||
```shell | ||
gcloud pubsub topics create <Your telemetry topic> | ||
``` | ||
|
||
1. Setup the Cloud IOT environment | ||
```shell | ||
./setup_device.sh --registry-name <Your registry id> \ | ||
--registry-region <e.g. us-central1> \ | ||
--device-id <Your device ID> \ | ||
--telemetry-topic <Your telemetry Cloud Pub/Sub topic> | ||
``` | ||
|
||
1. Run the sample | ||
```shell | ||
./mqtt_ciotc <message> \ | ||
--deviceid <your device id>\ | ||
--region <e.g. us-central1>\ | ||
--registryid <your registry id>\ | ||
--projectid <your project id>\ | ||
--keypath <e.g. ./ec_private.pem>\ | ||
--algorithm <e.g. RS256> | ||
--rootpath <e.g. ./roots.pem> | ||
``` | ||
|
||
You must provide the deviceid, registryid, and projectid parameters as they are | ||
used in calculating the client ID used for connecting to the MQTT bridge. The | ||
ecpath parameter should point to your private EC key created when you registered | ||
your device. The rootpath parameter specifies the roots.pem file that can be | ||
downloaded from https://pki.google.com/roots.pem. For example: | ||
|
||
```shell | ||
wget https://pki.google.com/roots.pem | ||
``` | ||
|
||
The following example demonstrates usage of the sample if my device ID is | ||
my-device, registry ID is my-registry, and project ID is blue-ocean-123. | ||
|
||
```shell | ||
mqtt_ciotc "Hello world!" --deviceid my-device --registryid my-registry \ | ||
--projectid blue-ocean-123 --keypath ./rsa_private.pem --algorithm RS256 \ | ||
--rootpath ./roots.pem --region us-central1 | ||
``` | ||
* <h3>If you are customer with an assigned Google Cloud account team, contact your account team for more information.</h3> |
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the use of
<h3>
in markdown, and as a bullet point strikes me as odd... but whatevs. This README file will go away soon-ish.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We followed the template that was implemented in another sample repo... 🤷