Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

IoT ESP32 Weather Station with Mongoose OS, Google Cloud Pla
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

IoT ESP32 Weather Station with Mongoose OS, Google Cloud Pla

by alphagenius on Wed Jul 29, 2020 11:46 am

I am following the tutorial found here: https://blog.adafruit.com/2017/10/24/mo ... sday-mqtt/ and came to a road block. When I enter the part like:

Code: Select all | TOGGLE FULL SIZE
gcloud beta iot registries create weather-station-registry --region us-central1 event-pubsub-topic=telemetry-topic


I get the following error:

Code: Select all | TOGGLE FULL SIZE
ERROR: (gcloud.beta.iot.registries.create) unrecognized arguments: event-pubsub-topic=telemetry-topic


I do not understand what is wrong in order to fix it. Will someone please help me?

alphagenius
 
Posts: 28
Joined: Sat Feb 04, 2017 4:27 pm

Re: IoT ESP32 Weather Station with Mongoose OS, Google Cloud

by mikeysklar on Wed Jul 29, 2020 6:42 pm

Hi alphagenius,

I think you forgot a set of double dashes with your part you entered before event-pubsub. Try this:

Code: Select all | TOGGLE FULL SIZE
# Create device registry:
gcloud beta iot registries create weather-station-registry --region us-central1 --event-pubsub-topic=telemetry-topic

mikeysklar
 
Posts: 1730
Joined: Mon Aug 01, 2016 8:10 pm

Re: IoT ESP32 Weather Station with Mongoose OS, Google Cloud

by alphagenius on Thu Jul 30, 2020 8:31 am

I tried that and now I get the following error:

ERROR: (gcloud.beta.iot.registries.create) unrecognized arguments: --event-pubsub-topic=telemetry-topic (did you mean '--state-pubsub-topic'?)

alphagenius
 
Posts: 28
Joined: Sat Feb 04, 2017 4:27 pm

Re: IoT ESP32 Weather Station with Mongoose OS, Google Cloud

by mikeysklar on Thu Jul 30, 2020 2:17 pm

Gotcha.

You probably have to take a step back and create the telemetry-topic for this to work. I don't believe this commands will work as one offs. Here is the full set:

Code: Select all | TOGGLE FULL SIZE
# Install beta components:
gcloud components install beta
# Authenticate with Google Cloud:
gcloud auth login
# Create cloud project — choose your unique project name:
gcloud projects create YOUR_PROJECT_NAME
# Set current project
gcloud config set project YOUR_PROJECT_NAME
# Add permissions for IoT Core
gcloud projects add-iam-policy-binding YOUR_PROJECT_NAME --member=serviceAccount:cloud-iot@system.gserviceaccount.com --role=roles/pubsub.publisher
# Create PubSub topic for device data:
gcloud beta pubsub topics create telemetry-topic
# Create PubSub subscription for device data:
gcloud beta pubsub subscriptions create --topic telemetry-topic telemetry-subscription
# Create device registry:
gcloud beta iot registries create weather-station-registry --region us-central1 --event-pubsub-topic=telemetry-topic

mikeysklar
 
Posts: 1730
Joined: Mon Aug 01, 2016 8:10 pm

Re: IoT ESP32 Weather Station with Mongoose OS, Google Cloud

by alphagenius on Sat Aug 01, 2020 1:36 pm

I did all of those steps already. They all worked fine. It is just that last step.

alphagenius
 
Posts: 28
Joined: Sat Feb 04, 2017 4:27 pm

Please be positive and constructive with your questions and comments.