Comments (6)
Thanks for the heads up, I took a look while adding exponential backoff, maybe you're passing the --deviceid as the first parameter?
from cpp-samples.
This is still broken as far as I can see. The example client now publishes to the hardcoded topic ""/devices/{your-device-id}/events"" as opts.topic is never changes from its initial string. Trying out the example results in an error notification on my registered device in the GCP stating:
mqtt: PUBLISH:Unauthorized MQTT publish topic: /devices/{your-device-id}/events, expects /devices/{device-id}/events
Looks like the only way to get it to publish to the correct topic is to manually modify the .topic = "/devices/{your-device-id}/events" string in the example code and rebuild.
The example code is referenced from documentation on page https://cloud.google.com/iot/docs/samples/mqtt-samples as the C example.
from cpp-samples.
Thank your the update. It looks like you did the right thing.
I did not write the sample, but I think the author actually intended for readers to modify the source code like you did. Do you see a way to better communicate that to the reader? Or perhaps, to not require the reader to modify the source code?
from cpp-samples.
I looked at the instructions provided in https://github.com/GoogleCloudPlatform/cpp-docs-samples/blob/master/iot/mqtt-ciotc/README.md and from reading that I don't think the (current) intention is to modify the source code as you can/must provide the different options on the command line, --deviceid for example (bottom of README). The MQTT topic must be automatically assembled from the deviceid you supply as command option.
I made a fix in line with the existing code that could be used for inspiration (not sure if I can accept the corporate CLA without approvement, so cant create a pull request yet) here:
HMS-LIG@1eb86de
from cpp-samples.
It's been a while since I last looked at the code here but the intention originally had been to support command-line parameters for the sample once it had been built. I'm not sure I actually tested it very thoroughly and I recall fixing an off-by-one bug on the ordered parameters.
from cpp-samples.
This should be fixed in:
from cpp-samples.
Related Issues (20)
- Dockerfile for Cloud Run hello world is out of date
- [Policy Bot] found one or more issues with this repository. HOT 1
- Ignore - Old Dependency Dashboard
- Ignore - Old Dependency Dashboard HOT 1
- [Policy Bot] found one or more issues with this repository.
- Dependency Dashboard
- Dependency Dashboard
- Running the examples - grpc error HOT 5
- Jwt.h on example HOT 2
- Trouble creating a Google Cloud Speech to Text Client using HOT 2
- run streaming_transcribe Error in windows HOT 8
- How to set speech language in streaming_transcribe HOT 5
- Google cloud speech library is static library HOT 1
- "Segmentation fault" error while running "streaming_transcribe_singlethread" on Linux Mint x64. HOT 5
- New HOT 1
- Action Required: Fix Renovate Configuration
- fix(pubsub_opentelemetry): segfault on publisher HOT 4
- [pubsub-otel] Add trace screenshots for zipkins
- [pubsub-otel] Add screenshots of the unary pull telemetery data HOT 1
- [pubsub-otel] Does not build at head HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpp-samples.