-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds MQTT device tests and example of configuration retrieval * Fixes compilation * Changes RSA certs to not expire, updates manager with setConfig, adds tests. * Updates MQTT client dependency to use latest version from Maven central. * Removes unused scripts and updates sample quickstart instructions. * Updates flaky tests in vision beta.
- Loading branch information
Showing
17 changed files
with
401 additions
and
420 deletions.
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 |
---|---|---|
|
@@ -4,35 +4,17 @@ Google Cloud IoT Core platform. | |
|
||
## Quickstart | ||
|
||
1. Install the gCloud CLI as described in [the Cloud IoT Core documentation](https://cloud.google.com/iot/docs/how-tos/getting-started#set_up_the_google_cloud_sdk_and_gcloud). | ||
2. Create a PubSub topic: | ||
|
||
gcloud beta pubsub topics create projects/my-iot-project/topics/device-events | ||
|
||
3. Add the special account `[email protected]` with the role `Publisher` to that | ||
PubSub topic from the [Cloud Developer Console](https://console.cloud.google.com) | ||
or by using the helper script in the [/scripts](./scripts) folder. | ||
|
||
4. Create a registry: | ||
|
||
gcloud beta iot registries create my-registry \ | ||
--project=my-iot-project \ | ||
--region=us-central1 \ | ||
--event-pubsub-topic=projects/my-iot-project/topics/device-events | ||
|
||
5. Use the [`generate_keys.sh`](generate_keys.sh) script to generate your signing keys: | ||
1. From the [Google Cloud IoT Core section](https://console.cloud.google.com/iot/) | ||
of the Google Cloud console, create a device registry. | ||
2. Use the [`generate_keys.sh`](generate_keys.sh) script to generate your signing keys: | ||
|
||
./generate_keys.sh | ||
|
||
6. Create a device. | ||
3. Add a device using the file `rsa_cert.pem`, specifying RS256_X509 and using the | ||
text copy of the public key starting with the ----START---- block of the certificate. | ||
|
||
gcloud beta iot devices create my-java-device \ | ||
--project=my-iot-project \ | ||
--region=us-central1 \ | ||
--registry=my-registry \ | ||
--public-key path=rsa_cert.pem,type=rs256 | ||
cat rsa_cert.pem | ||
|
||
7. Connect a sample device using the sample app in the [`mqtt_example`](./mqtt_example) folder. | ||
8. Learn how to manage devices programatically with the sample app in the | ||
`manager` folder. | ||
4. Connect a device using the HTTP or MQTT device samples in the [manager](./manager) folder. | ||
|
||
5. Programmattically control device configuration and using the device manager sample in the [manager](./manager) folder. |
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
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
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,18 +1,18 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIC+DCCAeCgAwIBAgIJAMLUy4Aee8f0MA0GCSqGSIb3DQEBCwUAMBExDzANBgNV | ||
BAMMBnVudXNlZDAeFw0xNzEyMTIyMDQ3MTNaFw0xODAxMTEyMDQ3MTNaMBExDzAN | ||
BgNVBAMMBnVudXNlZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN1a | ||
GQVrF7J5cp7ZJral+7MgYfmOaK4Or5sROZVFIxG40vejWHLEwAf49yHWHzJdpxYu | ||
qvCDiBKct+hJEhUJtPKMHyaJpsJnQiEscbgGz7djPYF/iw2I1BTdnryaRQEw9DGD | ||
y2VglH/Er3CdC/XiMXSUaqoE7cj0+7oAc3g+kECeizs8gzwHaYsMWSW2+hnHT9Jr | ||
3IiaTTVGU7RAaGQ1LrQBd0Pw9BloT3hvkvkDW/s+pVSbKpBdAco7gFqeI05z3Mxe | ||
DsSSVhZKk5FUr0TFhXsgCj/cbynjVweKbdC4pvEAAQS3QJ3vObW/1bQ9AtINRwJo | ||
53sNY78fAYUXb3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7Xb1gTTVsCAwEAAaNTMFEwHQYDVR0OBBYEFHnyjc53ia/A1m++Sfvp | ||
fck8S39bMB8GA1UdIwQYMBaAFHnyjc53ia/A1m++Sfvpfck8S39bMA8GA1UdEwEB | ||
/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAF0X7ZIejJTZANQL+EoaBg3kcqwS | ||
Ccmp+9pC7YnWL3JFLT3r5aGzv9SAHulJONylMUS70uw8ptN5KRRHZqEtEdZ3bYQN | ||
t5jPhnsEQ3fiuIaE3+M8vKpq/kvgI6JBNymuYM2F9g3RUfc9WyDKKa9pBhyj0/nc | ||
a8bY+mg3emC70S8xHLdFZozEm4mofQ3ag4S15CQKZG28PSB5ayCdIySxw8KVjghS | ||
nao01pCZuUOaZEWWJKUF0XkSMmEY+h32AQFgQQpRBCsain2XRJvfGm0Aa5akmvfJ | ||
cDZqe/pJ3fktbh1+HTkFC+tnfu3AhBPcL+sNVOQWn1+osBjVx51mIY6s4Ks= | ||
-----END CERTIFICATE----- |
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,28 +1,28 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDdWhkFaxeyeXKe | ||
2Sa2pfuzIGH5jmiuDq+bETmVRSMRuNL3o1hyxMAH+Pch1h8yXacWLqrwg4gSnLfo | ||
SRIVCbTyjB8miabCZ0IhLHG4Bs+3Yz2Bf4sNiNQU3Z68mkUBMPQxg8tlYJR/xK9w | ||
nQv14jF0lGqqBO3I9Pu6AHN4PpBAnos7PIM8B2mLDFkltvoZx0/Sa9yImk01RlO0 | ||
QGhkNS60AXdD8PQZaE94b5L5A1v7PqVUmyqQXQHKO4BaniNOc9zMXg7EklYWSpOR | ||
VK9ExYV7IAo/3G8p41cHim3QuKbxAA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XfHHpAr23DxVEpP | ||
uSIYM7ASFETC+w7IX2qcjAQX1uTUG/2sRuzpaoZe9VoaUZNdnXgQXOBhNkQlgHgm | ||
8LQhN+CFlQZAbqvLvj46UjNwBxwISQW4Qd904VuJuC4ew+OsA8ZxWe/BrbDU8zHM | ||
Vu1eSu89BrQB15CNQmkDkhIACwKBgQDJcI+zcPV0Lcf5JnA2LrttqosFMJ0XAlvV | ||
+KLLNG13oGuPWW2sROvtpHiPFO/FzX9hR3NSocNjwj0Y7QlULr7KfPK1nLHBa1Os | ||
DFnKVLb9UUIqDsMCAzupY3zc4fh7Jw9FfIveLYf0nDjSuTeyp8Mt93m4bmLhFgBs | ||
dKs9546p8QKBgCE+AYubbiOmy9Gzm14CPPFQX+RS5i+TUPVvy+hlFZewMg6mwhZj | ||
BNmHOW4Q0YEy0Yx9j+q6z8/8jHT3RQ1QXMLXFboEHzQ3rn53DzWLlIpJzxF6LAZQ | ||
PFcbIDB1FOxRXRlQN5eBKE6Rl02E44bKSbNMs5KvLoFyP1YJD6yAmHU/AoGAe6dz | ||
Lu26XvTzeogT/c62E13LNQZgiA1UnoagOCkYwYRiQn7dChDM2vZJY1uwzDWXafnY | ||
WvMd5BEKPFDVly2SxO3qd32WyGq/1C9ItyFFqz7EZNjm8EdXymVd8qFsTPzvLPKF | ||
UX+Vo5x6bTBxdmPxNjhiKcrpO86rt+fubnPEaaECgYBn2dFS/G7kUs0ybH2JZTp3 | ||
Y68lnY3mzfQCX4J83I81aAXU+IhHK7n1hegVGP47dVZ2iizaib+ubX0JCaa0pwHe | ||
K/geI+vcK7WNa3LKXL70OmZO0ToscdUC5jVKFCohmDo9+oecOndQ8OkjLkZMiBDG | ||
oOwoxIvf1KkQ7VyFYgnOBA== | ||
-----END PRIVATE KEY----- |
Binary file not shown.
Oops, something went wrong.